Skip to content

macos: walk the focused window and menu bar - #42

Open
charan-rathore wants to merge 1 commit into
awlevin:mainfrom
charan-rathore:fix/focused-window-ax-walk
Open

charan-rathore wants to merge 1 commit into
awlevin:mainfrom
charan-rathore:fix/focused-window-ax-walk

Conversation

@charan-rathore

Copy link
Copy Markdown
Contributor

Summary

Fixes #36. The macOS actionable-control walk previously started at the app, traversing every window and desktop icon before it reached the front Finder window's controls. It now walks the focused window and the menu bar under the existing app root. When no focused window is available, it keeps the original app-wide fallback.

This changes only the macOS actionable walk. It does not change the shared bounded walker, Windows, or OCR. Open PR #18 adds separate macOS menu and unnamed-control walks, but leaves this actionable_elements path intact.

Checks

  • uv run --no-sync ruff check .: passed.
  • uv run --no-sync ruff format --check .: passed.
  • uv run --no-sync pytest -q: 616 passed, 3 skipped, 1 xfailed on Linux.
  • Fake accessibility trees cover three windows with a 250-node simulated cap, front-window controls, a menu-bar item, missing menu bar, and no-focused-window fallback. The old app-wide walk hits that simulated cap while the scoped walk does not.

Caveat

No real Finder replay or macOS accessibility capture was run here. The before/after assertion is a fake AX tree; CI's macOS job will test the code path, but not Finder's live tree.

Instinct assisted.

@charan-rathore

Copy link
Copy Markdown
Contributor Author

This is green on CI and conflict-free on my end. Is there anything you'd like changed before it can land? Happy to adjust.

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.

Accessibility walk lists every window of the frontmost app

1 participant