Skip to content

fix: stand a clipped target's contour inside its edge - #4297

Merged
max-sixty merged 1 commit into
mainfrom
chosen-option-face
Oct 26, 2026
Merged

max-sixty merged 1 commit into
mainfrom
chosen-option-face

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The contour a thread draws round its element (.lf-visual-mark) stands outside the target at the focus ring's gap. A joined lf-options group clips its cells to its frame (overflow: clip), so on an option the clip cut away the contour's sides and left two accent lines above and below the card, across the neighbouring cells. Next to a chosen card's green ring, they read as a second border in a different colour.

The painter (visual-mark-paint.js) already measures every box that clips its target, so it can see when this will happen. Where a clip shows the target's edge but not the ring's room beyond it, the contour now stands just inside the edge, the way a control packed into a list insets its own ring. An edge the clip already cuts, such as on a target scrolled partly out of its scroller, keeps the contour outside.

Before / after (leaf-dev stills --state ship-option-thread-open, a new catalogue state; the dark state changes the same way, and ship-thread-open, a heading with room around it, is unchanged):

Before: the contour's top and bottom only, the lower line running across the next option. After: one closed contour just inside the chosen cell's edge.

test_a_contour_stands_inside_a_target_its_clip_leaves_no_room_around checks this in Chromium and Firefox, with a paragraph as the control that keeps the contour outside. With the toggle disabled, it fails.

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

The contour a thread draws round its element (`.lf-visual-mark`) stands
outside the target at the focus ring's gap. A joined `lf-options` group
clips its cells to its frame, so on a cell the clip cut away the
contour's sides and left two accent lines above and below the card,
across the neighbouring cells, reading as a second border in another
colour beside the chosen card's green ring.

The painter already measures every box that clips its target. Where one
shows the target's edge but not the ring's room beyond it, the contour
now takes the band just inside the edge instead, as a control packed
into a list insets its own ring. An edge the clip already cuts, as on a
target scrolled partly out of its scroller, keeps the contour outside.

Adds a test in Chromium and Firefox with a paragraph as the control, and
`ship-option-thread-open` stills (light and dark) for the state.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@max-sixty
max-sixty merged commit 7ec4cb7 into main Oct 26, 2026
4 checks passed
@max-sixty
max-sixty deleted the chosen-option-face branch October 26, 2026 23:24
max-sixty added a commit that referenced this pull request Oct 27, 2026
[#4297](#4297) drew the thread
contour just inside a target that a clipping box leaves no room around,
such as a cell of a joined `lf-options` group.
[#4294](#4294) then redrew every
rectangular contour as two brackets on `::before` and `::after`, flush
outside the target, and removed the outline that the inset rule moved.
On a chosen option, the group's frame again cuts away the brackets'
sides and leaves their corner stubs sticking out across the frame and
the neighbouring options.

The inset now moves the brackets. The rule sits with the bracket rule in
`browser/styles/chrome.css` and shifts both pseudo-elements one band
inside the edge. The painter now measures the band (`--focus-ring-w`) as
the room a contour needs, since the brackets no longer stand at the
focus ring's gap.

`leaf-dev stills --state ship-option-thread-open`: in the before still,
the bracket stubs stand outside the chosen cell's corners, over the
group frame. In the after still, the brackets sit inside the cell's
edge. The dark state changes the same way, and `ship-thread-open`, a
heading with room around it, is unchanged.
`test_a_contour_stands_inside_a_target_its_clip_leaves_no_room_around`
now reads the bracket's outline; it fails with the toggle disabled and
passes in Chromium and Firefox.


`test_render_aim.py::test_a_shadow_visual_surface_is_clipped_by_its_host`
also fails on `main` since #4294 (342 against a limit of 340), with or
without this change.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 <[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