Skip to content

fix(window): stop WebKit dropping clicks on controls the page repaints mid-press - #500

Merged
GeiserX merged 8 commits into
mainfrom
fix/w41pin-flake
Nov 1, 2026
Merged

GeiserX merged 8 commits into
mainfrom
fix/w41pin-flake

Conversation

@GeiserX

@GeiserX GeiserX commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

In WebKit, clicking "Back to live" sometimes did nothing. The page rewrites the button's text on every paint, which happens once a second and on every new line, even when the words stay the same. WebKit remembers the text node a press landed on, and if that node is gone by the release it sends no click. So any press held across a repaint was lost. A tenth-of-a-second press spans the one-second paint about one time in ten. Stop has the same problem. Chromium sends the click anyway, so only CI's WebKit leg caught it: the W4.1 parity test timed out with "waiting for pinned after Back to live while lines arrive" (run 41157257991 on main).

The fix adds a label() helper in src/ui/dom.ts that writes a control's text only when the words changed. Every control the window's paint and the share viewer relabel now goes through it: Back to live in the window and in the share viewer, the title (a click renames the call), the words-to-review pill, the Record key, Stop, Mute, Pause, and the banner's action button.

How the cause was pinned:

  • A temporary workflow ran the W4.1 test 480 times in Playwright WebKit on fresh Ubuntu runners and logged pointer events. It failed 3 times, and 9 times in another 480 runs with Playwright's debug log on, which shifts the timing. Every failure showed the same trace: a trusted mousedown and mouseup on #jump, no click, and a new line rendered between the two.
  • A minimal page reproduced it with nothing but button.textContent = "Back" on a timer: WebKit lost 15 of 150 clicks and Chromium lost 0 of 150. Updating the existing text node's data lost none. WebKit's EventHandler::nodeWillBeRemoved clears the remembered click node when that node is removed.

Before and after, W4.1 in CI's WebKit:

  • before: 3 of 480 failed, and 9 of 480 with debug logging
  • after: 0 of 360, and 0 of 360 with debug logging

Regression test: [DK-W1] in tests/ui/parity.test.ts holds a press on Back to live, then a second one on the title, each across a new line and the one-second paint. It checks that Back to live, the title, the review pill, Stop, Mute, Pause and the banner action all kept their text node, that the first release goes back to live, and that the second opens the rename box. On macOS it passed 10 of 10 runs per engine. The first version (Back to live only) passed 720 of 720 WebKit runs on CI.

Positive control: writing textContent unconditionally fails it in WebKit and in Chromium, for Back to live, the title and the review pill alike, and the failure names the control that lost its node. With the old title line, WebKit also drops the rename click itself. The test can't see the Record key, because the test rig registers no global hotkey and the label stays empty there. That one goes through label() too, but no test covers it.

The trap is written down as DK-W1 in docs/TRAPS.md. The temporary workflow is deleted.

The branch has temporary diagnostic commits, so please squash-merge it.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between cafc089 and 89ab341.

Files selected for processing: 5
  • docs/TRAPS.md
  • src/ui/app.ts
  • src/ui/dom.ts
  • src/ui/share-viewer.ts
  • tests/ui/parity.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…ble across a repaint

paint() still rewrote three control texts on every tick, so a press held on
the title lost its rename click in WebKit the same way Back to live did.
Route them through label() and extend DK-W1 to hold a press on the title and
check every relabelled control keeps its text node.
@GeiserX GeiserX changed the title fix(window): stop WebKit losing a Back to live click when the page repaints mid-press fix(window): stop WebKit dropping clicks on controls the page repaints mid-press Oct 31, 2026
@GeiserX
GeiserX merged commit 9a52a74 into main Nov 1, 2026
30 checks passed
@GeiserX
GeiserX deleted the fix/w41pin-flake branch November 1, 2026 00:51
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