Repository navigation
native2: desktop_read scope walks the element's own subtree (#204) - #209
Merged
Merged
Conversation
iamnbutler
force-pushed
the
fix-read-element
branch
9 times, most recently
from
October 25, 2026 01:02
ebc20b2 to
be12b9e
Compare
A scoped read walked the whole window and cut the scope out, so a busy window could spend the 4000-element budget before the walk reached the scope. It now walks from the snapshot's live reference. A top-level snapshot and element, which the schema never had and were silently ignored, are read as the scope. Why: native2/Sources/DesktopHost/TextRead.swift#fn textRead | a scoped text read walks from the snapshot element's AXUIElement, so element depths start at 0 there; the table read still walks the window because its row IDs map to snapshot IDs by depth
iamnbutler
force-pushed
the
fix-read-element
branch
from
October 25, 2026 01:03
be12b9e to
44b91f4
Compare
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 #204
desktop_readwalked the whole window (4000-element budget) and then cut out the scope's subtree, so on a busy page the budget or deadline could run out before or inside the scope, leaving only part of its text. It now walks from the scope element's live Accessibility reference held by the snapshot, so the whole budget goes to the subtree. Existing bounds stay (96 KB text,truncated/truncationwithtext_limit).desktop_readhas no top-levelsnapshot/element; those were silently ignored and the whole window came back, which is what the report saw. They're now read asscope; anelementwithout asnapshot(or alongsidescope) is refused with how to pass a scope. No schema change.Checked on the dev app (native2) with a Safari page holding a 1148-character JSON
<pre>in a table cell beside 300 filler rows:scope {snapshot, element: <cell>}and top-levelsnapshot+elementboth return the cell's full 1148 characters, traversing 4 elements;elementalone is refused.swift build -c releaseandswift testpass.