Repository navigation
Keys reach a SwiftUI List and a WebKit page in the background; web terminals are typed into, never pasted - #240
Merged
Merged
Conversation
…d; web terminals are typed into, never pasted - desktop_key makes an inactive app's window key first (key_window), focuses the window's one selected list when only the window has focus (list_focused), and says when neither is possible instead of reporting completed (#226). - desktop_insert types into a web terminal's input (xterm.js) and refuses route paste there, since xterm clears its input and a paste could never be confirmed (#229). - desktop_inspect waits for a WKWebView's lazily built tree, and keys reach a WebKit page's focused field (#5). - Fixtures: native2/fixture/keysfix.swift (AppKit table and SwiftUI List) and webfix.swift (WKWebView page). Fixes #226 Fixes #229 Refs #5 Why: native2/Sources/DesktopMac/Keyboard.swift#focusSelectedList | an Accessibility row press selects a SwiftUI List row without making the list first responder; a key into a window whose focused element is the window itself is dropped (checked live with native2/fixture/keysfix.swift) Why: native2/Sources/DesktopMac/Keyboard.swift#focusedWebElement | a WKWebView app reports no AXFocusedUIElement; the page's field reports AXFocused itself and can sit under a label group that doesn't Why: native2/Sources/DesktopMac/BackgroundPreparation.swift | two title-bar preparation clicks within the double-click interval zoom the window even with click state 1; skip once the app reports AXFrontmost with this window focused Why: native2/Sources/DesktopHost/Text.swift | xterm's helper textarea clears itself after every input, so a paste into it can never be read back and would stay on the clipboard Why: native2/Sources/DesktopMac/WebAccessibility.swift#awaitsWebKitTree | WebKit builds a WKWebView's tree on the first Accessibility request; that read finds only an AXGroup, and the AXWebArea appears under it milliseconds later
…ays nothing was sent The key result reused the paste path's refusal text, so it said both that the keys were sent and that nothing was sent. It now gives only the cause. Co-Authored-By: Claude <noreply@anthropic.com>
…lank tab strip
Chromium has no standard title bar: its tab strip fills the title row, inside groups that span the whole window,
so preparation found no blank space and every background key into Chrome was unknown (KEY_WINDOW_UNAVAILABLE).
In a Chromium app only leaf elements in the title row count as drawn, and an empty unlabeled group without a press
action is blank strip, where the click goes. Checked live in a temp-profile Chrome that was never activated: keys
into a page field arrive with key_window made_key, then already_key, and the window doesn't move or zoom.
Why: native2/Sources/DesktopMac/BackgroundPreparation.swift#isBlankChrome | Chrome's title row holds a labeled group spanning the whole window ("<title> - Google Chrome") and an empty unlabeled AXGroup right of New Tab; AX hit-testing the blank strip returns that group, not the window
# Conflicts: # CHANGELOG.md # native2/Sources/DesktopMac/WebAccessibility.swift
Merged
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.
Fixes #226
Fixes #229
Refs #5
#226: keys into a list in a window that isn't key
Cause: there were two layers.
List/onDeleteCommanddrops a background key unless its window is key.Fix:
desktop_keymakes an inactive app's window key first. It uses the same SkyLight activation and title-bar click that background paste uses, so the app isn't brought forward. The result reportskey_window: made_key | already_key | not_key.desktop_keyfocuses the window's one list, table or outline with a selected row (list_focused). Focus never leaves the window.KEY_WINDOW_UNAVAILABLEorKEY_NO_FOCUSED_VIEW, when neither works.Live check (
native2/fixture/keysfix.swift, app inactive, user's frontmost app unchanged):completed,made_key,list_focused, and the fixture loggedlist deleted ["two"]. Before the fix it wascompletedwith nothing deleted.already_key).#229: Cloud Shell xterm paste
Cause:
unknown, and the text stayed on the clipboard.onData.Fix:
desktop_insertinto a web terminal's input (xterm class, or "Terminal input" on a web field) types instead of pasting.route: "paste"there is refused withPASTE_UNVERIFIABLE_RECEIVER; nothing is written to the clipboard.web_terminal: true, and a hint to check withocrand press Return withdesktop_key, never to retype.Live check (
webfixterminal input): paste refused; typing gaveweb_terminaland the page received e-c-h-o-space-h-i; a newline was refused. In Chrome, xterm in a cross-origin iframe received " xt3". Chrome doesn't name xterm's textarea as focused there, so that result is the genericwindow_focusunknown.#5: WebKit page fields and background Command-V (partly)
Findings:
AXFocusedUIElement, so background keys were refused. The page's field reportsAXFocuseditself.AXEnabledfalse) in a background WebKit app before preparation.Fix:
Live check (
native2/fixture/webfix.swift):text/plain.Not done:
desktop_insertroute: "paste"into a web<input>is still refused before sending, because its text can't be read back. That is the existing behaviour, unchanged.Fixtures
native2/fixture/keysfix.swiftandnative2/fixture/webfix.swift; build commands are in their headers.Tests
swift test --package-path native2: passes, including the newKeyboardRouteTests.npm run check: passes.npm test: passes.