[object Object]

← back to Pattern Vault

auto-save: 2026-07-09T18:11:36 (2 files) — whimsical-compare/daily/scripts/diagnose_sf_upload.js whimsical-compare/daily/scripts/upload_sf.js

45745d8c6d3bcd183fd6cc9a356f498f03fe8fe5 · 2026-07-09 18:11:39 -0700 · Steve Abrams

Files touched

Diff

commit 45745d8c6d3bcd183fd6cc9a356f498f03fe8fe5
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Jul 9 18:11:39 2026 -0700

    auto-save: 2026-07-09T18:11:36 (2 files) — whimsical-compare/daily/scripts/diagnose_sf_upload.js whimsical-compare/daily/scripts/upload_sf.js
---
 .../daily/scripts/diagnose_sf_upload.js            | 22 ++++++++++++++++++++++
 whimsical-compare/daily/scripts/upload_sf.js       |  3 ++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/whimsical-compare/daily/scripts/diagnose_sf_upload.js b/whimsical-compare/daily/scripts/diagnose_sf_upload.js
index ba2eafa..b1bdee3 100644
--- a/whimsical-compare/daily/scripts/diagnose_sf_upload.js
+++ b/whimsical-compare/daily/scripts/diagnose_sf_upload.js
@@ -40,6 +40,28 @@ async function dump(pg, label) {
     await sleep(3000);
     out.steps.push(await dump(pg, 'upload-page-loaded'));
 
+    // DEEP: what is the "Choose Files" control, and where does the consent element live?
+    out.chooseFiles = await pg.evaluate(() => {
+      const els = [...document.querySelectorAll('button,label,a,div,span,input')];
+      const cf = els.find(e => /choose files/i.test((e.innerText || e.value || '').trim()));
+      if (!cf) return { found: false };
+      return { found: true, tag: cf.tagName.toLowerCase(), htmlFor: cf.getAttribute('for') || null,
+        role: cf.getAttribute('role') || null, outerHTML: cf.outerHTML.slice(0, 300),
+        parentTag: cf.parentElement && cf.parentElement.tagName.toLowerCase() };
+    }).catch(e => ({ err: String(e).slice(0, 100) }));
+    out.consent = await pg.evaluate(() => {
+      const els = [...document.querySelectorAll('button,a,div,span')];
+      const c = els.find(e => /agree & continue|agree and continue/i.test((e.innerText || '').trim()));
+      return c ? { found: true, tag: c.tagName.toLowerCase(), outerHTML: c.outerHTML.slice(0, 200) } : { found: false, note: 'not in top document (may be in iframe)' };
+    }).catch(e => ({ err: String(e).slice(0, 100) }));
+    out.iframes = await pg.evaluate(() => [...document.querySelectorAll('iframe')].map(f => ({ src: (f.src || '').slice(0, 120), id: f.id || '', title: f.title || '' }))).catch(() => []);
+    // does clicking "Choose Files" fire a native filechooser?
+    const chooser = await Promise.race([
+      pg.waitForEvent('filechooser', { timeout: 6000 }).then(() => true).catch(() => false),
+      pg.click('text="Choose Files"').then(() => sleep(6500)).then(() => false).catch(() => false),
+    ]).catch(() => false);
+    out.chooseFilesFiresFilechooser = chooser;
+
     if (stageFile) {
       const fi = await pg.$('input[type=file]');
       if (fi) {
diff --git a/whimsical-compare/daily/scripts/upload_sf.js b/whimsical-compare/daily/scripts/upload_sf.js
index 90b9372..2ebb1b4 100755
--- a/whimsical-compare/daily/scripts/upload_sf.js
+++ b/whimsical-compare/daily/scripts/upload_sf.js
@@ -124,9 +124,10 @@ async function messyType(el, text) {
       // Drive the REAL uploader via the "Choose Files" button + native filechooser.
       // DIAGNOSED 2026-07-09: setInputFiles() on the hidden input is a NO-OP against
       // Spoonflower's React dropzone (file never registers → upload never starts → id:null).
+      // proven working selector (diagnostic 2026-07-09: text="Choose Files" fires the filechooser)
       const [chooser] = await Promise.all([
         pg.waitForEvent('filechooser', { timeout: 12000 }).catch(() => null),
-        pg.click('button:has-text("Choose Files"), text="Choose Files"').catch(() => null),
+        pg.click('text="Choose Files"').catch(() => null),
       ]);
       if (chooser) {
         await chooser.setFiles(d.file);

← 0c248af daily_run: count only real-id uploads (dry-run id:null no lo  ·  back to Pattern Vault  ·  spoonflower: proven filechooser selector + network-block con 7fb0d68 →