Skip to content

fix: credit a choice's label with its focused checkbox's ring in the ring probe - #5497

Merged
leaf-agent merged 3 commits into
mainfrom
fix/issue-5460
Nov 5, 2026
Merged

leaf-agent merged 3 commits into
mainfrom
fix/issue-5460

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

#5230 made visual review's "Looks right" checkbox a .choice, and a choice's label wears the focus ring for its input (:is(.lf-choice, .choice):has(> input[data-lf-focus-visible]) sets --lf-wears-ring: 1, browser/styles/components/controls.css). The ring is painted on the label, but the test probe's carriesFocus (tests/page_scripts/focus_rings.js) didn't recognise that declaration, so it marked the label's ring as not the focused control's and current_location_ring returned None. ringsDrawn now credits the box the runtime's ringBox (browser/runtime/focus.js, exported through browser/runtime/check-api.js) names for the focused control, so the probe and the runtime share one reading of which box wears a ring. Only the test probe and the diagnostic check API change; nothing a user sees changes.

git bisect run over the scheduled-run range 19757c94c59b..8b759a5663b5 found #5230 (b63836193) as the first commit where the journey fails with the focused destination paints no keyboard ring. test_an_authenticated_navigation_journey_becomes_credential_free_review_evidence (--run-nightly) fails on main and passes with this change.

The same step also unblocks test_visual_review_keeps_its_inline_comment_editor_in_view_after_phone_resize[600|760]. Its earlier assert_keyboard_focus calls now pass, and it fails later, at line 206, with {'unobscured': False, 'inViewport': False}. #5475 (#5228) already owns that failure.

Other probe consumers run

Passed with the change: tests/browser/controls/test_rings.py, the rest of tests/browser/test_render_visual_review_journey.py, test_a_key_onto_a_control_at_a_scrollers_edge_shows_its_ring, test_escape_on_a_declaring_control_does_exactly_what_it_says, test_a_label_press_keeps_the_controls_current_keyboard_location, two test_render_pages.py ring tests, and tests/journeys/test_render_controls.py (Chromium). Two tests failed both with and without the change, so the change didn't cause them: test_trace_pointer_annotation_stays_inside_the_panned_image_viewport (ring 5px outside the image viewport) and test_each_sampled_focus_ring_is_shown_whole_in_its_surface (the diff file's inline response, which #5496 targets).

Closes #5460 — automated triage

…ring probe

#5230 made visual review's "Looks right" a `.choice`, whose label wears the
focus ring for its checkbox (`--lf-wears-ring: 1`, controls.css). The test
probe's `carriesFocus` didn't know that declaration, so it read the label's
ring as not the focused control's and `current_location_ring` found none,
although the ring was painted. The probe now credits the nearest box around
the focused control that declares `--lf-wears-ring: 1`, the box the runtime's
`ringBox` (focus.js) already names. No behavior a user sees changed.

Closes #5460
@max-sixty

Copy link
Copy Markdown
Owner

@leaf-agent The ring probe now credits the right label, but its new wearer walk copies the runtime's existing ringBox rule for --lf-wears-ring. Please expose ringBox through browser/runtime/check-api.js and use that owner in tests/page_scripts/focus_rings.js for focus attribution. ringsDrawn already awaits __lfCheckApi(). Keep the probe's independent measurement of ring paint and its existing proxy/projected-ring cases.

This was written by Codex on behalf of max-sixty

…ringBox

The ring probe's own walk for `--lf-wears-ring` copied `ringBox`
(focus.js). check-api.js now exports `ringBox`, and `ringsDrawn` credits
the box it names with the focused control's ring. The probe still
measures ring paint itself, and its proxy and projected-ring cases are
unchanged. `seenStop` keeps its ancestor walk, which already reaches a
wearing label.
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Done in 3de453e: check-api.js exports ringBox, and ringsDrawn takes it from the __lfCheckApi() it already awaits. It credits the box ringBox names for the focused control in both focused and sample; sample already covered it through holds. The copied walk is gone. carriesFocus is back to its proxy and projected-location cases, and the probe still measures ring paint itself. seenStop is unchanged: it is synchronous, and its ancestor walk already reaches a label that wears the ring.

The claimed journey (test_an_authenticated_navigation_journey_becomes_credential_free_review_evidence, --run-nightly), tests/browser/controls/test_rings.py, and the label-press and scroller-edge ring tests pass locally on this head.

@leaf-agent
leaf-agent merged commit e32c0af into main Nov 5, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5460 branch November 5, 2026 14:11
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.

test_an_authenticated_navigation_journey_becomes_credential_free_review_evidence: the focused destination paints no keyboard ring

2 participants