Skip to content

Inspect: off-screen children don't count toward the per-node child cap (#249) - #250

Merged
iamnbutler merged 1 commit into
mainfrom
inspect-offscreen-cap
Nov 12, 2026
Merged

iamnbutler merged 1 commit into
mainfrom
inspect-offscreen-cap

Conversation

@iamnbutler

Copy link
Copy Markdown
Contributor

Fixes #249. This is the gap left by #238, which superseded PR #212 for #178.

processChildren took prefix(maxChildren) (100) before the visible-only skip. A container whose every child is in the Accessibility tree, scrolled to its middle, therefore offered 100 off-screen children and no visible ones. Now a child skipped as off-screen doesn't count toward the cap. A visible-only walk scans up to 10× the cap (PR #212's bound), since each skipped child still costs one descriptor read. Scoped and other full walks (no clip) still stop at the first 100 children, as before.

New fixture: native2/fixture/longlist.swift, a scroll area holding a stack of 400 rows, all Accessibility children, scrolled past the first 190.

Checked

  • Before (main): 7 elements, no rows, offscreen_omitted: 100.
  • After: rows 209–224 are listed and offscreen_omitted: 384. This matches the screenshot, which shows rows 209–223 with 224 partly visible.
  • swift test --package-path native2 passes. Checked live through the standalone host built from this branch; the dev app here still has no Accessibility or Screen Recording grant.

🤖 Generated with Claude Code

#249)

A visible-only walk took a node's first 100 children and only then skipped the
off-screen ones, so a long list scrolled to its middle listed none of its visible
rows. Skipped children no longer count toward maxChildren, and the walk reads up to
ten times the cap, as PR #212 did. Adds the longlist fixture: 400 rows, all
Accessibility children, scrolled past the first 190.

Why: native2/Sources/DesktopMac/Elements.swift | the per-node child cap counts only children a visible-only walk kept; skipping happens per child after its descriptor read, so the scan is bounded separately (10x the cap) to keep a huge list's read cost finite

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@iamnbutler
iamnbutler merged commit 83ed0f8 into main Nov 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

desktop_inspect lists no visible rows of a long list scrolled past its first 100 children

1 participant