Repository navigation
State where a box's marks stand once, on the box, and read it for every mark - #4773
Merged
Merged
Conversation
…ry mark
Where a focus ring, a location ring or an overlay mark stood round a box was decided in two places. Each control's focus rule set a distance of its own, eight of them from 5px inside to 6px outside, 17 written as lengths, and `standOver` sorted targets into controls and regions separately. They disagreed wherever a control's rule chose otherwise: Alt over a choice's label stood 3px out while its keyboard ring stood one band inside.
A box now states it once, as its own `outline-offset` in its face's rule, from four kinds base.css names ("Where it stands"): a region's gap, a control's, its edge (0), or one band inside (`--focus-ring-inset`, new). The layer's focus floor draws every keyboard ring, so a control's rule no longer restates the ring to set its distance; a box that wears the ring for a control inside it draws one and states its kind on itself. `standOver` reads the target's stated offset and keeps its own guess, a control's gap or a region's, for a box that states none. A stated 0 reads as none there, since 0 is the property's initial value, so a mark round a field stands at a control's gap; the spec says so. `test_every_ring_stands_at_a_kind_of_box` refuses an `outline-offset` written as a length. Rules that set a ring's distance only while the box holds focus go from 60 to 17, the floor and the boxes and pseudo-elements that wear a control's ring.
Behavior changes, which tests and stills read:
- Buttons, inline presses, a quote, the composer's Send and Dictate, an attachment, a trace's timeline, a live sample's frame, a tab's name and a thread card's buttons stood 1-2px out and stand at a control's 3px.
- Margin entries and reactions, 4px apart, and a diff line's comment press stood 1px out and stand on their edge.
- The rows of every list (`.lf-row`), a table's cells, a choosing group's rows and its add row, a gloss and a draft stand their ring, and every mark over them, one band inside; a draft's ring stood 5px inside. A timeline's steps and a review's cases stood 3px out.
- A side list's tab rings its whole row, inside its edge, where the ring round its name ran over the summary under it, and its open panel fills its cell, so the panel's ring meets the frame when the list is taller than the panel. Only the open panel stretches: a closed one keeps its box in the cell.
- The Alt aim over an SVG element traces its contour, as a comment on it does; it bracketed the element's box. A whole inline `<svg>` is a box for both, bracketed rather than traced shape by shape.
- An action's target no longer draws a 1px accent outline inside its edge under the overlay's brackets.
- The floating panel's faces and its view chooser read the runtime's focus-visible rather than the browser's, at the inset token, and the floor leaves a box whose focus the overlay projects to the overlay.
Tests: `test_a_side_lists_open_panel_rings_its_whole_cell` covers the side list (both halves fail with the fix reverted); the aim test on a cramped cell reads the mark's offset rather than the removed `data-lf-mark-on`; the ring cases expect the floor where it now draws.
# Conflicts: # browser/base.css # packages/default/styles/tabs.css # packages/default/styles/toc.css
leaf-agent
approved these changes
Oct 30, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
One focused check fails on both this head and current main: test_controls_show_keyboard_focus_without_ringing_pointer_activation reports the shadow button’s top ring under the preceding Add row. I reproduced it on base 363404fde38ddfdc6f084d3568509f110dbaec27; main’s CI run records the same diagnostic. This is inherited and does not withhold approval under the repository’s review policy.
leaf-agent
added a commit
that referenced
this pull request
Oct 31, 2026
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
max-sixty
added a commit
that referenced
this pull request
Nov 3, 2026
…ring as a mark over the decision (#5116) Every box now states once, as `--lf-ring-at`, where its marks stand. Its keyboard focus ring, the Alt aim, a comment's brackets, the margin trace and the location ring all read that one statement. The location ring is now drawn by the core painter as a mark over the decision, so it gets the overlay's handling of a box that clips the decision. Follows #4773, which made each box state its marks' place as one of four kinds. Two marks still disagreed after it: - **A field's aim.** A box stated its place as its own `outline-offset`. A field states its edge, `0`, which is also `outline-offset`'s initial value, so the overlay read it as nothing stated and stood the Alt aim 3px outside a field whose focus ring replaces its border. - **The location ring.** It was the one mark still drawn on the decision itself, as its outline, so it got none of the overlay's clip check. In a box that clips the decision without room round it, only a line across the top survived. A question filling a full-height workspace needed a container style query, a pseudo-element painted over its contents and an `!important` to stand inside instead. ## What changed for the user - The Alt aim and a comment's mark round a field stand on its edge, where its focus ring stands. They stood 3px out. - The location ring round a question that a box clips with no room round it is whole, just inside the question. Drawn as an outline, it kept only a line across the top. - A question filling a full-height workspace keeps its location ring 6px clear of its heading at the sides and 4px above, and stands it inside only along the window's foot. It stood inside on every side, on the heading's first letter. - A decision a page styles without a box of its own wears one location ring round all the boxes it shows through, where each wore its own. - Tab onto a control inside a question scrolls the question's ring into view, as it already did for other decisions. ## How it works - **The statement** (`base.css`, "Where it stands"; `surfaces.css`). `--lf-ring-at` is a registered property with no initial value that doesn't inherit, so a box that states nothing reads as stating nothing. A zero-specificity rule sets every box's `outline-offset` from it, so the keyboard rings stand where they did. The focus floor falls back to a control's gap. The 38 box statements across the kernel and packages move from `outline-offset` to `--lf-ring-at`. A pseudo-element or `::part` that draws a box's ring keeps stating `outline-offset`. `test_every_ring_stands_at_a_kind_of_box` holds both to the four kinds. - **The location ring** (`target-paint.js`, `paintLocation`). `markHere` draws it round the decision the user stands in, through `standOver` like every other mark, and layout changes and scrolls move it as they move the target trace. It is also the decision's focus ring: each box it is drawn round wears `lf-projected-location`, and the focus floor, which every shadow stage adopts, stands down there. It paints over a decision only from a layer above it, so a decision in a modal dialog keeps its own focus ring. A control inside the decision stands it down with `--lf-obligation-ring: none`, now read from `page-paint.js`, on every draw. The CSS ring on `[data-lf-obligation]` and lf-ask's ring rules are gone. - **Stacking** (`annotation-chrome.css`). The ring is page paint now, and margin entries at rest stand below page paint. The entry for the obligation the user stands in shows its question at rest, so where that label reached over the decision's edge the ring ran through its words. That entry's cluster now rises above page paint, as the one under pointer or focus already did. - **Where a mark stands near a clip** (`target-paint-geometry.js`, `sideGaps`). The window counts as a clip on a side no scroll of the page can bring into view (`pageExtent`). Where a box that clips the target leaves any side short of room, the mark stands one band inside on every side, since such a box can hold rows edge to edge. Where only the window leaves a side short, that side alone stands inside, as far out as the window allows, and the others stand where they would anywhere on the page. A side within a pixel of its clip counts as flush, since clip bands are measured in whole pixels. ## Trade-off A page with no side gutter whose rows are packed edge to edge, touching the window's edge, now gets brackets above and below a row over its neighbours. The old rule put the whole mark inside there because the window happened to meet the row. The same rows one pixel from the edge got the overlap before and after this change. Reserving the ring's room in the workspace layout instead would avoid the window rule, at the cost of a strip at the foot of every workspace page. ## Tests - New: `test_the_aim_round_a_field_stands_on_its_edge_where_its_ring_does`, `test_the_ring_round_a_clipped_question_stands_inside_it`, and `test_the_aim_on_a_row_a_clip_packs_stays_inside_the_row`. Each fails on the code before the change it covers. - `test_the_ring_round_a_question_stands_clear_of_its_words` also holds the workspace question's ring clear of its heading. - The location ring tests read the overlay box (`LOCATION_RING`) instead of an outline on the decision, and wait for the repaint frame before reading a ring a control stood down. - The ring sweep (`focus_rings.js`) counts the location ring as the focus cue of a decision holding focus. - Local: `pnpm run check`, pre-commit, the runtime tests, the ring and Alt-aim browser tests, and Firefox probes of a field, a clipped question, a full-height workspace, a modal and a shadow stage. - `leaf-dev stills` over 37 states against main: the workspace question's ring moves out from its heading (playground-choice, playground-text); every other state's pixels match within antialiasing, and its computed styles differ only in the declarations that now state each place. - Inherited: `test_each_sampled_focus_ring_is_shown_whole_in_its_surface` fails on main 65ac1a0 with the same two diagnostics as here (the On me chip not taking focus after its key, and the gallery's contents link never showing), so it blocks nothing; main's daily report #4225 tracks it. > _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.
Where a focus ring, a location ring or an overlay mark stood round a box was decided in two places. Each control's focus rule set a distance of its own, eight of them from 5px inside to 6px outside, 17 written as lengths, and
standOversorted targets into controls and regions separately. They disagreed wherever a control's rule chose otherwise: Alt over a choice's label stood 3px out while its keyboard ring stood one band inside.A box now states it once, as its own
outline-offsetin its face's rule, from four kinds base.css names ("Where it stands"): a region's gap, a control's, its edge (0), or one band inside (--focus-ring-inset, new). The layer's focus floor draws every keyboard ring, so a control's rule no longer restates the ring to set its distance; a box that wears the ring for a control inside it draws one and states its kind on itself.standOverreads the target's stated offset and keeps its own guess, a control's gap or a region's, for a box that states none. A stated 0 reads as none there, since 0 is the property's initial value, so a mark round a field stands at a control's gap; the spec says so.test_every_ring_stands_at_a_kind_of_boxrefuses anoutline-offsetwritten as a length. Rules that set a ring's distance only while the box holds focus go from 60 to 17, the floor and the boxes and pseudo-elements that wear a control's ring.Behavior changes, which tests and stills read:
.lf-row), a table's cells, a choosing group's rows and its add row, a gloss and a draft stand their ring, and every mark over them, one band inside; a draft's ring stood 5px inside. A timeline's steps and a review's cases stood 3px out.<svg>is a box for both, bracketed rather than traced shape by shape.Tests:
test_a_side_lists_open_panel_rings_its_whole_cellcovers the side list (both halves fail with the fix reverted); the aim test on a cramped cell reads the mark's offset rather than the removeddata-lf-mark-on; the ring cases expect the floor where it now draws.Follows #4732.