Skip to content

Keep focus rings clear of the neighbours that paint after them - #3111

Merged
max-sixty merged 2 commits into
mainfrom
choice-focus-ring-overlap
Oct 17, 2026
Merged

max-sixty merged 2 commits into
mainfrom
choice-focus-ring-overlap

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A focused playground choice's ring sat beneath the next choice's outline. The ring reaches 4px outside its face (2px offset, 2px width), but the choices were spaced by --sp-1, which is 3px in working density. Grid and flex items paint whole in document order, so the next face drew its 1px border over the ring's outer pixel. The choices now space themselves by --focus-ring-room and draw the ring a pixel inside it.

Focusing every control in every example, in both densities, found the same cause twice more:

  • the trace viewer's image tools (the shared button ring, 2px off, in a 3px working-density gap) now take --focus-ring-room as their gap;
  • a focused tab panel's outward ring ran under the tab strip's fill, so it now draws its ring inside, as other panes do.

The ring check (focus_rings.js) counted only a neighbour's fill as covering a ring, so a face drawn by its border alone covered it unseen. It now also counts a border the sample lies on, and RING_CASES samples a working-density playground choice and a tab panel. Run on its own, the check reports both old faults on main and none on this branch.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits October 16, 2026 22:29
A focused playground choice's ring stood 4px outside its face (2px offset,
2px width), but the choices' gap was --sp-1: 4px in the default density and
3px in working density. Grid and flex items paint whole in tree order, so the
next face painted its 1px border over the ring's outer pixel. The choices now
space themselves by --focus-ring-room and draw the ring a pixel inside it.

A survey of every example's Tab stops in both densities found the same cause
twice more: the trace viewer's image tools (the shared button ring, 2px off,
in a 3px working-density gap) now take --focus-ring-room as their gap, and a
focused tab panel, whose outward ring ran under the strip's fill, now wears
its ring inside like other panes.

The ring reading counted only a neighbour's fill as covering a ring, so a
face drawn by its border alone covered the ring unseen. It now also counts a
border the sample lies on, and the ring cases sample a working-density
playground choice and a tab panel; both report the old faults on the base.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 0956ab6 into main Oct 17, 2026
3 checks passed
@max-sixty
max-sixty deleted the choice-focus-ring-overlap branch October 17, 2026 06:51
max-sixty added a commit that referenced this pull request Oct 17, 2026
Deleting the auxiliary surfaces made chrome.js's foreground dialog the
chrome's home but dropped the envelope rule that sized it to nothing, so
every page drew the browser's dialog face: a 34px white square with a
black border where the document ends, just above the floating panel. It
covered the bottom of a tall lf-ask's ring in notification-playground,
which the focus-ring check main added in #3111 reports. The rule comes
back as `.lf-foreground`, minus the pointer-events and anchor-scope only
the drawers needed.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty pushed a commit that referenced this pull request Nov 16, 2026
…where #6110 and #5963 moved them (#6193)

The focus-ring sweep held two samples that later product changes had
made stale. This PR updates both to where those changes deliberately
moved the ring.

- **notification-playground**: `lf-playground input[type=radio]` now
resolves first to the Banner format card. #6110 made a candidate card
wear its radio's ring, because the label's own ring "ran through its
words" (its description). The sample still expected the `.lf-choice`
label's ring. It now takes the rail's Tone radio (`#tone`), the dense
choice it was added for in #3111, where the label still wears the ring.
A second sample checks that the format card (`#format`) wears the
`lf-playground-choice` ring.
- **triage-board's panel field**: the sweep reaches this stop once the
first one passes. #5963 moved the field's ring from the editor to the
field's slot `.lf-fp-field`, so Send stays put. The sample expected
`.lf-fp-field .lf-compose-field` and now expects
`[data-lf-control-focus-visible] > .lf-fp-field`.

No product code changes. Locally on Linux, before the change the test
failed at notification-playground's radio with the message in #6182.
With the change, every sample passes, both new expectations included.
The test still fails on eight ring faults on `lf-ask` sections and a
trace mark. These were hidden behind the stale samples and are a
separate cause, filed as #6192.

Closes #6182 — automated triage

Co-authored-by: leaf-agent <[email protected]>
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.

2 participants