Skip to content

fix(window): a double-click during the stream's redraw now opens the fix - #498

Merged
GeiserX merged 3 commits into
mainfrom
fix/fixforget-flake
Oct 31, 2026
Merged

GeiserX merged 3 commits into
mainfrom
fix/fixforget-flake

Conversation

@GeiserX

@GeiserX GeiserX commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Sometimes a double-click on a word did not open the fix. The stream redraws the lines a fix corrected about 150 ms after the fix, on its own 250 ms tick, even when their text did not change. fillRow set textContent every time, which swaps the text node and drops any selection inside it. If the second press of a double-click landed before that redraw and the release after it, the double-click selected nothing. WebKit then fires no dblclick at all, and Chromium fires one with an empty selection. Either way the popover never opened.

That is the flake in tests/ui/fix-word.test.ts on ui (webkit). It failed 3 times in about 290 runs between 2026-10-24 and 2026-10-31 (jobs 120929861148, 122299006696, 124640033164). All three were waitForSelector('#popover .fix-learned') timing out on a double-click made within a second of a fix. It also hits a real user who double-clicks or drag-selects a word just as a vocabulary change comes in.

Fix

fillRow (src/ui/transcript.ts) only sets the text when it changed. A redraw with the same text leaves the node, and the selection, alone.

Evidence

  • Trace on WebKit and Chromium: the stream's read {all:true} arrives about 150 ms after the fix answer and redraws l000002 and l000003. With the second press held across that redraw, the old code opened no popover in either engine.
  • New [W4.9] a line the stream redraws mid double-click keeps the word, and the fix still opens. It holds the second press, adds a word to the vocabulary file so a read arrives during the press, and checks that the text node is the same one and the fix opens with the word selected. It fails on the old fillRow in both engines and passes with the fix.
  • Positive control: replacing the text node during the press, which is what the old redraw did, opens nothing.
  • Before and after on fresh Linux WebKit runners: a temporary workflow ran the learned-word tests 150 times on 4 shards per side. The workflow is deleted before merge.
  • Mac WebKit with natural timing never failed, before or after (0 in 120, 0 in 200).

New entry in docs/TRAPS.md: "A redraw that drops the selection".

Numbers: on fresh Linux WebKit runners (a temporary workflow, 4 shards × 150 reruns of the "a word a fix learned" tests), main failed 7 of 1,800 test runs, every one the same fix-learned timeout seen in CI. With the fix, 0 of 3,000. The held-press regression test fails on the old fillRow in WebKit and Chromium. The temporary workflow was added and removed on this branch; squash-merging keeps it out of main.

…ged line

A line drawn again with the same text had its text node replaced, so a
double-click whose release came after the stream's read redraw selected
nothing and the fix never opened (tests/ui/fix-word.test.ts, ui webkit).
@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 24 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 81ee47a and 9d92e78.

Files selected for processing: 3
  • docs/TRAPS.md
  • src/ui/transcript.ts
  • tests/ui/fix-word.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

@GeiserX

GeiserX commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

Before and after on fresh Linux WebKit runners (temporary workflow run 41240601834, now deleted). Each side ran the "a word a fix learned" tests 150 times on each of 4 shards.

  • Before (main's transcript.ts and test file): 7 failures in 1800 test runs (0.39%). Every one was waitForSelector('#popover .fix-learned') timing out, in all three learned-word tests, the same as the CI failures.
  • After: 0 failures in 3000 test runs. That covers the same three tests 1800 times plus the two new ones.

Full bun run check on macOS: 3596 passed, 0 failed.

@GeiserX
GeiserX merged commit 3b01911 into main Oct 31, 2026
29 checks passed
@GeiserX
GeiserX deleted the fix/fixforget-flake branch October 31, 2026 23:29
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