Repository navigation
fix(link-hints): a pick decided when the labels come survives a click during their draw (follow-up of #32537) - #34042
Conversation
…me key gets the keys from its cmux window (browser-click-then-type, red; ChildPageFocus takes a page-window lookup, unused yet)
…become key takes the keys from its cmux window, so typed keys reach the page (browser-click-then-type)
…om the cmux window to the page window, also for a delayed grant (browser-click-then-type, review of #32537; red). The ChildPageFocus hand-over is taken back: every grant path goes through CEFTab.grantFocus
…e cmux window to the page window, in CEFTab.grantFocus that every grant path uses (browser-click-then-type, review of #32537)
…ile red at 637d3fc: NSWindow not in scope)
…h the keyboard passes its letters to the field (browser-click-then-type VERDICT app, STATUS 7518; red, the editing answer is a stub)
… a link hint session started by a stale unhandled-key report then ends and gives the letters it took to the field, in order (browser-click-then-type VERDICT app)
…h key as typed); ask the page whether a field has the keyboard in a session-only script, so window hints keep the plain target list (review of #32537)
…ile red at 1972dd8: switch must be exhaustive in WindowHintController)
… text field once each in order; case 2, hint letters typed before the labels show pick and never reach the page (lead review of #32537; red: the rework sent them to the page, LinkHintHeldKeys is a stub)
…nt keys checked when the labels show (never sent to the page), or, when the page says a text field has the keyboard, sent to it once each in order (lead review of #32537)
… never taken again, so the keys that reach the page equal the keys typed (v5 of #32537 looped without end; red, LinkHintReplays is a stub)
…never held again, so link hints can no longer loop it (v5 of #32537 sent the same keys without end)
…n started) is never sent back; the keys the page receives equal the keys typed (v6 of #32537 doubled the first letters; red: the typed time is not read)
…to the page; the session takes it but never sends it back, so the page gets each key once (v6 of #32537 doubled the first letters)
… mutating; the macro's closure made it immutable: compile red at 706883c)
…ed after it reaches the page once; a key Chromium sent back is never the session's (browser-click-then-type, lead on STATUS 7738; red: route(typedAt:) is a stub)
…: it goes on to the page on its normal path, once, so a key still queued at the start is not lost and a key Chromium sent back is not doubled (browser-click-then-type, lead on STATUS 7738)
…reaches the page once in order (a field) or is a hint key; a key that is no hint key, Escape, an early end and a key-up keep their order; a key is the session's unless the app already dispatched it (browser-click-then-type, review of #32537; red: the new types are stubs)
… answer and then reaches the field once in order or is a hint key; a non-hint key, Escape, a click, a lost focus, a failed or slow page call never lose a key; a key-up waits behind its key-down; a key the app already dispatched is the page's (browser-click-then-type, review of #32537)
…es, and two identical keys in one refresh are two keys (lead on STATUS 7898; red: the answer needs targets; the two-keys test is a guard, green before and after)
…cts its targets only when no text field has the keyboard, so a heavy page's target walk never delays a field's keys; each page call's time goes to the input journal (browser-click-then-type, lead on STATUS 7898)
…ng delimiter sets the indentation; d17dbcb did not compile)
…g of event time and key code; a synthetic key by its object), so a plain key in a terminal makes 0 allocations again (KeyRouterBench: 66 per key at c62a2e4; browser-click-then-type)
…omium page window, so typing anywhere else does no link-hint work at all (lead on STATUS 8037)
…tood in for): a field gets every key once in order, a slow target collect never sends hint letters to the page, a click or no answer gives the held keys to the page, and a key Chromium sent back is the page's when Chromium loaded after the first key (review 6594559342; red: the bound covers the target collect and the page window class is cached as missing)
…remembered as missing before Chromium loaded), the answer's bound covers only the focus check (a heavy page's target collect never sends hint letters to the page), and a bound that passes after the tab closed still gives the held keys to the page (review 6594559342)
… tests did not compile in Swift 6 at 64a9d57/eab99a7)
…: seeded random keys, clicks, focus changes, page answers and the bound against a reference model, checked after every event (no key lost or doubled, no hint letter to the page, order kept, one session); the controller's label scripts and answer bound get test seams (red: a label typed in full before the labels came keeps the session live while they draw)
…e session when the page answers, and the pick waits only for the labels' draw, so a key typed while they draw is the page's, never taken (it was lost, and the pick with it); found by LinkHintControllerFuzzTests
… sent back to the page no longer unmarks the rest of that send, so a key after two link-hint chords in one send-back goes to the page, never into the newest session (found by LinkHintControllerFuzzTests at e98112e: seed 4642252087, sequence 10)
…k or a new start during their draw: it removes the labels and acts (review 6603845634 finding 1, a regression of e98112e; red)
…eaches, so a click or a new start during the labels' draw no longer drops it and leaves the labels on the page (review 6603845634 finding 1)
…ick-during-draw # Conflicts: # Packages/macOS/CmuxNext/Sources/CmuxNextBrowser/LinkHints/LinkHintController.swift # Packages/macOS/CmuxNext/Tests/CmuxNextBrowserTests/CEFDeferredFocusTests.swift # Packages/macOS/CmuxNext/Tests/CmuxNextBrowserTests/LinkHintControllerTests.swift
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 83c8336 to compare; do not merge until green; see lane-rules Shipped in:
|
|
Review (independent subagent): SHIP at 5e3cb1b I found no correctness defect. I read the diff against What I checked
Nits (not blocking)
I posted nothing on GitHub. Files:
|
|
Review (independent subagent): SHIP at 52d8656 Head 52d8656 has the same change that was reviewed at 5e3cb1b. The merge changed nothing in the PR's paths.
|
…h-pick-during-draw # Conflicts: # Packages/macOS/CmuxNext/Tests/CmuxNextBrowserTests/LinkHintControllerTests.swift
|
Review (independent subagent): SHIP at 6a79970 The merge resolved the test-file conflict correctly, and the auto-merge of the controller joins the two features without problems. I did not compile or run anything; this review only reads the code. 1. PR diff now (
2. Merge resolution (
3. Interaction between the two features
No findings that block. |
|
Found 12 test failures on Blacksmith runners: Failures
...and 2 more test failures. View all on Blacksmith: run 41702723268, run 41702723426
|
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Summary
Follow-up of #32537 (P0 browser-click-then-type), review 6603845634 finding 1. It fixes a regression from #32537's commit e98112e.
When a full link-hint label is typed before the labels come, the pick is decided when they come and acts after their draw. Before this PR, the pick ran in the controller's
worktask. A click (the app's mouse-down observer callscancel()) or a newfduring the draw, which takes a few ms, cancelled that task. The pick then never clicked, and the labels the draw had put on the page stayed until a scroll or resize.Now a decided pick runs in its own task (
picking) thatcancel()does not reach. The session ended when the pick was decided, so nothing in that session is left to cancel.Testing
Fleet,
package-test-lane.sh suite, 5 runs each,proof-step.py. A step counts only with "Test run with N tests", N > 0.aPickDecidedWhenTheLabelsComeSurvivesAClickDuringTheirDrawfailed 5/5 (the remove script was never asked: the pick was dropped).LinkHintControllerTests,LinkHintControllerFuzzTests,LinkHintTypingTests5x each). Compile-check app and CmuxNext passed at b0e60ca and 2c5a388.LinkHintControllerTests,LinkHintControllerFuzzTests,LinkHintTypingTests5x each).Observed / Not run
Changelog
Fixed: A link hint you type in full before the labels show now always clicks, also when you click the page while the labels appear
Proof
No capture: key routing; the proof is the tests.