Repository navigation
macOS engine: arrow keys in background Firefox take the held-focus route, so they move a rich editor's caret (#360) - #397
Merged
Conversation
…held activation (refs #360) In a background Firefox a rich editor keeps its caret disabled until it has focus, so a posted Left, Option+Left or Cmd+Left scrolled instead of moving the caret (#360's hosted spike, run 44024467862: 0 of 120; 120 of 120 after route 3's prelude). Following ruling 764, press_key now routes a sequence holding a caret-navigation key (an arrow, Home, End, Page Up or Page Down, with any modifiers) through the same held activation a Command chord takes, when the app's page engine is Gecko and the app does not believe it has focus. - Routes.swift: caretNavigationKeyCodes, isCaretNavigation and needsHeldActivation; pressKeyRoute takes the page engine. - Input.swift: pressKey passes webAccessibility.pageEngine(app.appPath), the principal-class read #313 introduced. - No editor role is read, and nothing reads the caret back: the answer is the posting's, since Firefox's AXSelectedTextRange is stale (#394). - Foreground Firefox, other apps and every other key keep their route. The native engine spec's Decision Log records the entry, and the Design's route table names the exception. Sminos-Session: cursor235#b93055dd (cua on macbook)
…(refs #360) The model's document gains one sentence closing the background-click paragraph: in a Firefox window in the background, a pressKey of an arrow key, Home, End, Page Up or Page Down first focuses the field the key goes to, which the page can see as a focus event. The docs oracle's copy, the core documentation test's copy, PROVENANCE.md and the surface inventory's new Table 3 addition (2026-11-16, #360) carry it. Sminos-Session: cursor235#b93055dd (cua on macbook)
…n Log records the result (refs #360) docs/evidence/2026-11-17-firefox-nav-focus/README.md records the two hosted runs, linked rather than copied: - Spike 44024467862 (Firefox 159.0): the cause, and the interventions it ruled out. - Qualification 44047809532 (Firefox 160.0): the fix's own press_key against main. - Background passed 560 of 560 and foreground 560 of 560. Rich Left and Option+Left went from 0 of 80 on main to 80 of 80. - The watch observed no activation or raise in 501,913 samples. This is sampled evidence, not a no-flash guarantee. - Route 3 costs 110/147 ms p50/p95 cold, against 3/6 ms for the plain post. - The single-line input's Home/End/Page cells are N/A. The Decision Log entry's "not yet measured" item now holds the measured result and the route-3 cost. Sminos-Session: cursor235#b93055dd (cua on macbook)
…(refs #360) Ruling 767 narrows #360's rule to Left, Right, Up and Down, with any modifiers (Shift included). Home, End, Page Up and Page Down go back to 2' in a background Firefox. Qualification run 44047809532 found that they scroll rather than move the caret, and main's plain post already matched the foreground for them in the rich editors (160 of 160). - Routes.swift: caretNavigationKeyCodes becomes arrowKeyCodes (0x7B to 0x7E) and isCaretNavigation becomes isArrowKey. - RouteTests: every arrow under eight modifier prefixes takes route 3 in background Firefox. Home, End and the page keys under the same prefixes keep 2', or route 3 as a Command chord. Both sets keep their route in foreground Firefox and in background Chrome and Safari. - Decision Log: the entry becomes "#360's arrow keys". It names ruling 767, says which qualification cells cover the rule (Left, Option+Left, Cmd+Left and Cmd+Shift+Left in all four editors, 320 of 320), records that the four other keys were measured to work without it, and notes the one gap: a background textarea's Home, End and page keys by 2' were not run. The route-3 cost becomes item 7. Sminos-Session: cursor235#b93055dd (cua on macbook)
…ly (refs #360) Following ruling 767, the background paragraph's sentence now reads "a pressKey of an arrow key, with or without modifiers, first focuses the field". The oracle copy and the core-documentation test copy are byte-identical to it. PROVENANCE.md and the surface inventory's #360 addition are updated to match. The evidence README now names the narrowed set and ruling 767, and says which qualification cells cover the rule. It also records the measurement that took Home, End and the page keys out, and states that the watch's longest gap was 176 ms (p50 5.0 ms), so a flash shorter than that window cannot be excluded. Sminos-Session: cursor235#b93055dd (cua on macbook)
…#360) Kept both sides of the three conflicts: - PROVENANCE.md: main's agent-cursor.md row, which adds the sixth paragraph (#354), plus #360's clause on the background paragraph's last sentence and its description. - docs-oracle.mjs: main's comment list, then #360's clause. - surface inventory: #360's Table 3 addition (2026-11-16), then #354's amendment (2026-11-17, ruling 1ea561bc:765). agent-cursor.md and its copies merged cleanly and stay byte-identical: #354's typing paragraph and #360's arrow-key sentence are both in each one. Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
What changes
On macOS,
press_keyof Left or Option+Left into a rich editor (contenteditable, a compose box) in a background Firefox window answered ok but left the caret where it was. The key reached the page and Gecko decoded the right command. But Firefox's caret-collapse commands check whether the editor's caret is enabled, and scroll instead when it isn't. The editor only enables its caret when it has logical focus, which a background window's editor doesn't.Now, in a Firefox that doesn't believe it has focus, a key sequence that holds an arrow key (Left, Right, Up or Down, with any modifiers, Shift included) goes by route 3, the held activation with its guard that Command chords already take (rulings 1ea561bc:764 and 767). Route 3 gives the field logical focus before the key, which the page can see as a focus event. The answer stays what
press_keypromises, posted rather than confirmed, and no AX caret check is added (#394).The rule lives in
native/engine/Sources/Engine/Routes.swift(arrowKeyCodes,needsHeldActivation). Gecko is detected by the existing page-engine classification. Unchanged: foreground Firefox, every other app, and every non-arrow key. Home, End, Page Up and Page Down keep plain posting (see Limits).Evidence
Tables are in docs/evidence/2026-11-17-firefox-nav-focus/README.md. Both runs judge against the fixture page's own DOM 1 s after the key, never against AX.
Right, Up and Down weren't run. They take the same rule on the same route.
Limits
Verification
swift test(native/engine), after merging main cde920f: 1,216 tests, 0 failures, 1 skipped; KeyRouteTests 11/11. Node: docs-oracle, core-documentation and inventory 27/27. The new sentence is byte-identical in agent-cursor.md and its three copies.Plugin 0.28.5.
Closes #360
Sminos-Session: cursor235#b93055dd (cua on macbook)