← back to Dw Photo Capture

5x/sweep-1.md

49 lines

# /5x sweep 1 — TK-12228 front+back display (target d1a0b78, test server :9987 `--test`)

Server log confirmed `Shopify push: STUBBED (--test)`; data/photos rebased to /tmp/dwp-e2e.

## Verify
| check | result |
|---|---|
| E2E front/back journey — Chromium (fake media) | **19/19 PASS** |
| E2E front/back journey — WebKit 26.5 (Playwright mock capture device) | 18/19 — history thumbnail check FAIL (4 lazy imgs naturalWidth 0) |
| E2E front/back journey — Firefox 151 (media.navigator.streams.fake) | 18/19 — history thumbnail check FAIL (11 lazy imgs naturalWidth 0) |
| /3x `/` | M1 M2 M3 B4 PASS · B5/B6 SKIP (runner's playwright 1.57 has no WebKit/Firefox build) · clickthrough 10 pass / 7 FAIL |
| /3x `/captures` | M3 FAIL (1 console error) · clickthrough 7/0 |
| /3x `/batch` | M3 FAIL (1 console error) · clickthrough 8/0 |
| /3x `/cam` | M2 FAIL (no screenshot) · M3 FAIL (1 console error) · clickthrough 5/0 |
| console/pageerror/broken-img probe, 3 engines × 4 pages | clean except Firefox doc 401 (normal Basic-auth challenge → retried 200; not a defect) |

## Caught → diagnosis
1. **M3 console error on /captures, /batch, /cam = `GET /favicon.ico 404`.** Those pages declare no `<link rel="icon">`
   (index.html does), so every browser requests /favicon.ico. `/captures` is NEW in d1a0b78; `/batch` + `/cam` are
   PRE-EXISTING at 126f917 (verified `git show 126f917:public/{batch,cam}.html` → 0 icon links). Small + in-scope → fixed.
2. **WebKit/Firefox history thumbs naturalWidth==0 = test artifact, not an app defect.** captures.html uses
   `loading="lazy"`; WebKit/Firefox have small lazy-load margins, so off-screen thumbs are never fetched until scrolled.
   Proven with 5x/tools/history-scroll-check.cjs: after scrolling each into view, 21/21 load in all 3 engines.
   Fix = the e2e helper now scrolls each matched img into view BEFORE the (unchanged, still all-must-load) assertion.
3. **/3x clickthrough `/` buttons 5–11 timeout = harness artifact.** `#homeScreen` is a by-design full-screen launcher
   overlay covering the toolbar, so Playwright's actionability wait times out. Replaced with a targeted clickthrough
   (5x/tools/index-toolbar-click.cjs: dismiss via "skip →", click each launcher tile + toolbar button, assert 0
   errors) → **33/33 PASS across Chromium/WebKit/Firefox**. Pre-existing overlay; not a defect.
4. **/3x M2 on /cam = environment/harness.** `/cam` holds an SSE stream (`/cam/events`, pre-existing); Chrome's
   `--virtual-time-budget` never elapses while a request is pending, so the CLI screenshot never fires. Not an app
   defect; Playwright screenshots of /cam render fine (E2E shot 09-cam-lastshot.png).
   (Also noted: the first test-server process died silently mid-sweep — no stack in the log — coinciding with an
   aborted `timeout`-wrapped Chrome command in the same shell; re-run under a managed background task it stayed up
   for the rest of the loop. Treated as harness, logged for Cody.)
5. **B5/B6 SKIP** — the 3x runner resolves Designer-Wallcoverings' playwright 1.57 whose WebKit/Firefox builds
   aren't installed. Covered instead by the 3-engine probe + WebKit/Firefox E2E journeys (playwright 1.61).
6. **Code-review find (new code): "missing a side" rule inconsistent between server and UI.** `/api/captures`
   `missing_back` counted single-shot items (remote-cam `photo`-only) as "without a back photo", and the UI's
   "Missing a side first" sort ranked them first, while the card itself was NOT flagged `.miss`. Aligned both to one
   rule: a front/back item lacking one side; photo-only single shots never count.

## Fixes (commit below)
- public/captures.html, batch.html, cam.html: `<link rel="icon" href="/icon-192.png">` (+ apple-touch-icon on captures).
- public/captures.html: `missing()` = has front or back but not both; `.miss` flag uses it.
- server.js `/api/captures`: `missing_back` = has FRONT and no BACK.
- scripts/e2e-front-back-display.cjs: `ENGINE=chromium|webkit|firefox` (each with its own fake-camera mechanism);
  `imgs()` scrolls lazy images into view before asserting.
- 5x/tools/: console-probe.cjs, history-scroll-check.cjs, index-toolbar-click.cjs (sweep harness).