Skip to content

Stop the Display P3 history smoke tests losing a click after swatch drags - #235

Merged
vycdev merged 1 commit into
developfrom
t3/fix-image-decode-reuse-flakes
Nov 28, 2026
Merged

vycdev merged 1 commit into
developfrom
t3/fix-image-decode-reuse-flakes

Conversation

@vycdev

@vycdev vycdev commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

The four opaque Display P3 history smoke tests in image-decode-reuse.spec.ts (8- and 16-bit, bitmap and img fallback) failed now and then on fast machines. Each one clicks 2D right after a swatch drag. dnd-kit keeps a capture-phase click listener on the document that stops propagation, and only removes it 50 ms after the drag ends. A click inside that window is lost: 2D gets focus, 3D stays pressed, and the next file import times out.

The tests now wait until a probe click gets through again. The probe is a non-bubbling synthetic click on a throwaway element outside the app root. This waits on the actual blocker instead of a guessed delay. first-layer-reconciliation.spec.ts uses the same helper in place of its fixed 100 ms wait from #178.

Evidence (local macOS, Chromium, production build on a private port)

  • Without the fix: 3 of 40 runs failed. All 3 failed the same way: setInputFiles timed out after the 2D click, and the snapshot showed 2D focused and 3D pressed.
  • Probe check: probing every few ms right after mouse.up() found clicks blocked for up to 50 ms in 7 of 8 runs, so the probe detects the real blocker.
  • With the fix: 60 of 60 runs passed, and 25 of 25 runs of first-layer-reconciliation.spec.ts passed.
  • npm run lint and npm run test:e2e:all pass (8 suites).

This is not an app bug. Real users can't press and release another control within 50 ms of dropping a swatch, and the blocker exists so the drop itself doesn't count as a click.

Fixes #183

Reviewed with sol-loop: 1 round with gpt-6.2-sol. Sol verdict: approved

Created with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

@vycdev
vycdev force-pushed the t3/fix-image-decode-reuse-flakes branch 2 times, most recently from ba1beee to 52cdfee Compare November 28, 2026 12:04
The opaque Display P3 history tests clicked 2D right after a swatch
drag. dnd-kit stops click propagation for 50 ms after a drag ends, so
the click was sometimes lost and the next import timed out. Probe with
a synthetic click until one gets through, and use the same helper in
the first-layer spec instead of its fixed 100 ms wait.

Fixes #183

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vycdev
vycdev force-pushed the t3/fix-image-decode-reuse-flakes branch from 52cdfee to 7ac4dfd Compare November 28, 2026 12:20
@vycdev
vycdev merged commit 1f072e4 into develop Nov 28, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant