Repository navigation
fix(window): a double-click during the stream's redraw now opens the fix - #498
Merged
Merged
Conversation
…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).
|
Warning Review limit reachedYou'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. View limit details
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. |
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.
Full |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
fillRowsettextContentevery 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 nodblclickat 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.tsonui (webkit). It failed 3 times in about 290 runs between 2026-10-24 and 2026-10-31 (jobs 120929861148, 122299006696, 124640033164). All three werewaitForSelector('#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
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.[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 areadarrives 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 oldfillRowin both engines and passes with the fix.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.