Skip to content

fix: drop go_back from the kind choice when a Back button is on screen - #60

Open
bluzername wants to merge 1 commit into
awlevin:mainfrom
bluzername:fix-go-back-overlaps-back-button
Open

bluzername wants to merge 1 commit into
awlevin:mainfrom
bluzername:fix-go-back-overlaps-back-button

Conversation

@bluzername

Copy link
Copy Markdown

Fixes #40.

In System Settings the window has its own labelled Back button, so
"click_item (Go Back)" and go_back are the same move. Offering both at
once split the vote (the issue report say kind split 0.44/0.40 on one step)
and read as doubt in the kind answer.

kind_criteria now takes the screen items and drops go_back from the
criteria when one of them is a real AX button labelled "Back" or "Go Back"
(a source="ax" item with role="button", not just text that happens to
read "Back" off the screen by OCR). Clicking the button stays available
through click_item either way, so nothing is lost, only the duplicate
path.

Test approach (TDD): added three tests to tests/test_decide.py -
test_kind_criteria_drops_go_back_when_a_labelled_back_button_is_on_screen,
..._for_a_go_back_labelled_button, and
test_kind_criteria_keeps_go_back_without_a_real_back_button (which also
checks an OCR-only "Back" text block does NOT suppress go_back, only a real
AX button does). Confirmed RED against current main (kind_criteria() did
not accept an items argument), implemented has_back_button and the
items param, confirmed GREEN.

Verification: uv run ruff check . && uv run ruff format . clean, uv run pytest -q
733 passed, 2 skipped, 1 xfailed (730 on main plus the 3 new tests).

🤖 Generated with Claude Code

In System Settings, the window has its own labelled Back button, so
click_item on it and go_back are the same move. Offering both split
the vote between them and read as doubt in the kind answer.

kind_criteria now take the screen items and drop go_back when one of
them is a real AX button labelled Back or Go Back. Click on the
button stay available through click_item either way, nothing is lost.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

go_back overlaps an on-screen Back button

1 participant