Repository navigation
fix: an open menu is not skipped like a closed one in the AX walk - #70
Open
bluzername wants to merge 1 commit into
Open
bluzername wants to merge 1 commit into
bluzername wants to merge 1 commit into
Conversation
Fixes part of awlevin#58 (bug 6, "An open menu is invisible"). AX_SKIP_SUBTREE_ROLES always skip AXMenu subtrees. That is right for a closed menu, it report a zero-size frame and thousands of items, none on screen. But an open menu has a real frame on the display, so it get skipped too, and clicker never see its items. With TextEdit's File menu open, clicker could not find New. Fix: only skip an AXMenu subtree when its frame is not real and on display. A closed menu still skip (frame has no size, so clickable() and the display check both say no), an open one is now walked like any other subtree. Test: added test_walks_into_an_open_menu_whose_frame_is_real_and_on_the_display in tests/test_ax.py, a menu with a real on-screen frame and one menu item. Confirmed RED on main (menu item was missing from found), then fixed ax_walk.py and confirmed GREEN. The existing closed-menu test (test_skips_closed_menu_subtrees_but_keeps_the_menu_bar_item) still pass unchanged, it did not need touching. Verification: uv run ruff check . && uv run ruff format --check . clean, uv run pytest -q: 731 passed, 2 skipped, 1 xfailed (one more pass than main's 730, the new test). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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 part of #58 (bug 6, "An open menu is invisible").
AX_SKIP_SUBTREE_ROLESalways skipAXMenusubtrees. That is right for a closed menu, it report a zero-size frame and thousands of items, none on screen. But an open menu has a real frame on the display, so it get skipped too, and clicker never see its items. With TextEdit's File menu open, clicker could not find New.Fix: only skip an
AXMenusubtree when its frame is not real and on display. A closed menu still skip (frame has no size, soclickable()and the display check both say no), an open one is now walked like any other subtree.Test (TDD): added
test_walks_into_an_open_menu_whose_frame_is_real_and_on_the_displayintests/test_ax.py, a menu with a real on-screen frame and one menu item. Confirmed RED on main (the menu item was missing fromfound), then fixedax_walk.pyand confirmed GREEN. The existing closed-menu test (test_skips_closed_menu_subtrees_but_keeps_the_menu_bar_item) still pass unchanged, it did not need touching.Verification:
uv run ruff check . && uv run ruff format --check .clean,uv run pytest -q: 731 passed, 2 skipped, 1 xfailed (one more pass than main's 730, the new test).🤖 Generated with Claude Code