Repository navigation
fix: confirm suspected focus ring covers against painted pixels - #4836
Merged
Merged
Conversation
Hit testing can rank the Add form over a shadow button's outline even when the screenshot shows the complete ring. Reuse the pixel reader to confirm candidate covers without changing its tolerance or product styling. Keep a real painted cover assertion on the same shadow button. Closes #4824
max-sixty
added a commit
that referenced
this pull request
Nov 25, 2026
… reach over a ring as no cover (#7129) In an opened settled decision whose options are bare rows, with the keyboard in the group so its digits show, the focus ring on an option's mark stood the row's full height: a tall ring round the 11px circle, reaching 5px above and below the row, with its bottom run under the next row's ground. It hugs the mark again, as it did before #7091. **Cause.** #7091 made a row's mark stand the row's height while the digit shows, so that the mark's reach (the transparent `::after` #7075 added) covers the whole digit column. A ring follows the box it is drawn on, so the mark's own ring grew with it. In a live group the row wears the mark's ring and the mark's own is off, so nothing visible changed there, and #7091's stills showed only live groups. An opened settled group is the one place the mark wears its own ring, and no still covered it with the digits showing. **Fix.** The mark stands the row's height only in a live group. In a settled group it keeps its 11px box, and its reach covers the digit's height, as in #7075; one `inset-block: min(0px, (100% - var(--lf-key-badge-size)) / 2)` serves both. A new stills state, `settled-option-row-keyboard`, shows the surface. To weigh: in an opened settled group, a press in the digit column above or below the digit (6px each side on a one-line row) lands on the row again. It picks the row, but focus leaves the group and the digits disappear, which #7091 had fixed. Keeping both would need the ring off the mark's box, for example by having the row wear the ring in a settled group as it does in a live one. That changes how a settled group shows focus, so it is left for you to decide. **The ring check's other five faults.** `test_each_sampled_focus_ring_is_shown_whole_in_its_surface` also reported the left edge of a live row's ring in ship-review and feature-gallery as "under" the row's own mark. That ring is whole: the screenshot shows the ring's colour at each sampled point. The box over the left band is the mark's reach, which takes hits and paints nothing. The check counted a hit on a box inside the control as paint whenever the box's own styles showed a fill or border, and a hit on a pseudo-element is read through its host's styles. These covers now go through the screenshot confirmation that a neighbour's cover already goes through (#4836). The new `test_the_ring_reading_passes_over_a_reach_inside_the_control_that_paints_nothing` fails without that change. The defect surfaced as a failure of that ring test in #7119, the runtime's layer move, which doesn't cause it: the test fails the same way on `main` at 109461e and f9ff587. A pull request runs it only when it edits the test's file. max-sixty asked for refactoring to continue while each change improves the code. Checks: the ring test passes (it failed with 6 faults before); the new ring-reading test and two neighbours; 11 option tests by node id, including the digit-column press test in Chromium and Firefox; `leaf-dev stills --base` in Chromium and Firefox (the settled state changes, `ship-option-row-keyboard` is identical); the stills model tests; pre-commit; `pnpm run check:browser`. > _This was written by Claude Code on behalf of max-sixty_
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.
The ring probe reports the Add form over the shadow button even though the screenshot paints the button's complete blue outline. On current main, the original test fails at sample (304, 486), whose screenshot pixel is the ring's RGB (47, 84, 128). Hit testing sees boxes rather than outline paint, so its stacking inference can identify a surface beneath the outline as a cover.
Candidate neighbour covers now go through the existing screenshot colour reader at their reported point, when the ring is opaque, unscaled and a single fragment. A candidate is dismissed only when that pixel shows the ring. The existing colour tolerance is unchanged; product styles and the focus perimeter introduced by #4773 are unchanged.
Validation: the original test failed before the fix and passes after it. Six focused browser tests pass, covering the original route, actual covers, positioned neighbours, inset rings and displaced pseudo-elements. The original test also now plants a red band over the same shadow ring and requires the probe to report it. Ruff, Python type checking and JavaScript syntax checking pass.
Closes #4824 — automated triage