Skip to content

Draw target brackets flush outside their shared focus perimeter - #4294

Merged
max-sixty merged 3 commits into
mainfrom
codex/flush-outside
Oct 26, 2026
Merged

max-sixty merged 3 commits into
mainfrom
codex/flush-outside

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Alt targeting and comment references now draw constant end brackets immediately outside the target. Returning from Comment with Escape completes that same perimeter as a full keyboard-focus ring, without shifting its bounds or corners.

The existing anchored geometry owns every rectangular contour: scrolling clips the original perimeter instead of rebuilding a smaller rectangle. SVG targets retain their own contours. Focus reads the existing ring carrier so private controls, checkbox labels, tab panels, and pane bodies keep their component-owned ring; ordinary page controls work with or without IDs and repaint when keyboard modality changes in place. Native tables no longer gain an anonymous spacer row, and projected references preserve authored outlines.

The simplicity pass draws full focus with the bracket’s existing outline, removes unreachable fallback contours and redundant assertions, consolidates bracket selectors, and reuses the existing page-content predicate. It keeps the separate focus-visibility notification because changing modality is not navigation. Full focus uses the existing after-pseudo convention. The ring diagnostics distinguish projected focus from reference brackets; a small real interaction replaces the obsolete fallback-class fixture. No per-widget geometry rules or scroll-positioning loop are added. The outside stroke has a known 2px allowance at a declared sticky-header edge.

Validation: independent Opus review; Chromium interaction and compositor-scroll regressions; Firefox focus ownership and clipped-target journeys; build/type checks, 668 runtime tests, and lint. Against current main, startup adds no requests and approximately 1.2KB of code before the page is presented, with no observed layout shifts.

This was written by Codex on behalf of max-sixty

Aim, references, traces and full target focus use the same outline geometry.
Brackets expose constant-width end strips; focus completes the perimeter.
Keep the target's full box and radius in anchored clipping frames, so scrolling
clips its real corners instead of inventing corners or lagging the compositor.
Give target contours their stroke's room at a clipping edge.

Read focus visibility from its canonical owner and repaint when modality changes
without a move. Keep private controls and declared surrounding focus frames with
their owners, and preserve authored outlines beneath reference paint.

Replace the table clearance pseudo-element with padding: a collapsed native table
must end at its last row rather than acquire an anonymous empty row. Block tables
retain their scrollbar clearance.

Exercise Alt-click/Escape, scrolled borders, authored outlines, idless controls,
modality changes, shadow controls, checkbox labels and tab-panel focus frames.
Reuse the bracket's outline for full focus, delete unreachable source-contour
fallbacks, and use the existing page-content predicate. Keep the two simple end
clips instead of replacing them with an eight-point polygon.

The pane's inset focus frame now declares its existing ring ownership. Projecting
ordinary page focus makes that declaration necessary to prevent a second ring,
as well as to give landing geometry the right carrier.

Remove redundant assertions and cover keyboard arrival on a scrolling pane.
Keep the existing browser-anchored full perimeter: rebuilding visible rectangles
in script lagged compositor scrolling in the earlier prototype.

Use the existing after-pseudo focus convention and teach ring diagnostics to
read projected focus from its existing semantic state. Replace the obsolete fallback-class fixture
with a small real targeting-to-keyboard journey.
@max-sixty
max-sixty merged commit 6ab28d9 into main Oct 26, 2026
4 checks passed
@max-sixty
max-sixty deleted the codex/flush-outside branch October 26, 2026 23:38
leaf-agent added a commit that referenced this pull request Oct 27, 2026
Two reaction tests treated projected keyboard focus introduced by #4294
as a reaction contour or as the subject's identity. The tests now
distinguish focus contours from reaction paint and assert Escape's
return directly on `#gallery`, removing the class-based identity helper.
Runtime behavior is unchanged; the part anchor, announcement, seated
glyph and absence of reaction paint remain checked.

Both reported tests failed on current main and pass with these
assertions. The earlier push run 40419540771 records both passing before
#4294; its focus projection change explains the new readings.

Closes #4313 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 27, 2026
The browser contour tests still read source outlines or continuous
borders after #4294 moved rectangular target paint to projected
brackets. Read the bracket pseudo-elements and use the shared focus-ring
diagnostic for keyboard visibility. The screenshot pixel checks now
measure both vertical sides and all four end caps at the projected
perimeter, using its actual outline color.

All ten reported tests failed on current main and pass with these
assertion changes. I inspected fresh captures of the screenshot's
pending comment and quiet margin trace: both bracket sides and their end
caps paint above the edge-to-edge frame. The preceding CI run's JUnit
records also show these ten tests passing before the bracket change.
Ruff checks and formatting pass.

This changes tests only; #4294's focus and annotation behavior stays
intact. The clipped-option paint repair remains in #4308.

Closes #4311 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 27, 2026
A hidden target keeps its overlay record after its projection class has
been cleared. Retiring that record called `classList.remove()`, which
rewrote the already empty class attribute. Use the platform's forced
toggle instead, preserving the shared focus and annotation paint while
avoiding that redundant mutation. This changes no rendered state.

The readiness case and both obligation-walk variants fail with the
reported teardown diagnostics before the change and pass afterward. All
668 runtime tests and `pnpm run check` pass, and the committed kernel is
rebuilt. Served `ship-review` previews on base and candidate each load
46 requests through upgrade and first server-state presentation, with 7
additional JavaScript bytes and no layout shifts.

The broader page-control focus projection in #4294 exposes this existing
retirement path; the earlier push's JUnit records pass these three
cases, while run 40423336764 records their unchanged-class writes. A
temporary write-stack probe identifies `paintTargets` retirement as the
writer after the hidden-target branch has already cleared the class.

Closes #4315 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 27, 2026
The shadow visual clipping test still required a contour to stop exactly
at its host edge, while #4294 deliberately lets one stroke survive
beyond each clipping band. Both the comment mark and Alt aim therefore
end at 342px rather than 340px in this fixture. Rendering is unchanged.

The test now requires the exact host edge plus the theme's stroke width
and verifies that the underlying shadow surface extends farther, so
losing host clipping still fails. This preserves #4294's outside-stroke
intent without adding a rendering exception.

The original assertion fails on current main. The corrected test and two
nearby visual geometry tests pass (3 focused browser tests). Local Ruff
checks could not run because Ruff is unavailable in the prepared
environment; PR CI supplies the remaining checks.

Closes #4314 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 27, 2026
Focus projection in #4294 adds presentation classes to focused controls.
The watches still report the injected faults, but assertions compared
complete class strings and rejected the correct nodes. Shared finding
assertions now compare each diagnostic step's tag, ID and requested
classes while allowing additional classes and a different class order.
The shift tests use the same comparison when identifying a node inside a
host.

Diagnostic output retains all classes. Path length, shadow hosts,
required classes, finding codes and other fields still have to match.
This preserves #4294's focus behavior and the watches' fault detection.

Validation: all six browser cases reported in #4312 pass locally,
including the injected 40px growth and 20px modality shifts. The three
growth/modality cases failed locally before this change; the preceding
and failing CI runs' JUnit records also bracket all six regressions. The
five floating-plane variants linked from #4316 also pass, including both
fault-free controls and all three injected 80px residuals. Eight focused
developer-tool checks cover extra/reordered classes and rejection of
wrong nodes, fields, hosts, paths, movement and missing required
classes. Python compilation and Ruff checks pass.

Closes #4312 — automated triage

Co-authored-by: leaf-agent <[email protected]>
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]>
max-sixty added a commit that referenced this pull request Oct 27, 2026
The suggestion-ring test read the projected focus contour since #4322, which
stood in for the obligation's outline once #4294 projected focus onto every
focused page element. The projection now leaves an obligation to its own
location ring, so the test reads that outline, as it did before #4294.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
max-sixty added a commit that referenced this pull request Oct 27, 2026
… whole (#4337)

An ask reached by `m` was framed by two concentric blue lines, and a
picked option's green ring lost half its lower edge to the grey divider.
Both came from two mechanisms drawing on the same pixels.

**One ring round an arrived-at ask.** Since #4294 the annotation overlay
projects a focus contour flush outside any keyboard-focused page
element. An `m` arrival focuses the obligation, which already wears its
location ring at the ring's gap (`chrome.css`, and `ask.css`'s overlay
for an ask), so the two stood 3px apart. Before #4294 the projected
focus stood at the same gap and the two coincided. `anchor-paint.js` now
leaves an element wearing `data-lf-obligation` to its location ring, as
it already leaves a face wearing another control's ring. The
suggestion-ring test, which #4322 pointed at the projected contour,
reads the obligation's own outline again.

**The joined options' hairline takes its own pixel.** The line between
joined cells was each cell's 1px outer shadow cast over its neighbour,
so whichever cell painted later cut the other's edge: a single pick lost
half its bottom edge, and standing the pick above its neighbours only
moved the cut onto the upper of two adjacent picks in a `choose
multiple` group. The group now paints its ground in the rule colour and
lays its cells 1px apart, each cell painting its own ground. That
deletes `--lf-cell-rule`, the shadow on every cell and the reserve, and
the `z-index` on the picked, keyboard-ringed and add rows. The
laid-across column floor subtracts each column's share of the gaps
(swept 700–1800px in Chromium and Firefox: never a 2+1 split), and the
reserve for a missing Add and Done counts the gap between them.

Changed behavior: a joined group grows 1px per hairline, and cards laid
across are each about 1px narrower.

Tests: an `m` arrival on an ask draws one ring (`test_rings`); a picked
cell's ring is equally thick on all four sides in both joined forms,
with two adjacent rows picked (`test_render_options`). Each fails with
its fix removed, and the ring-thickness test also fails against the
earlier `z-index` fix. Tests that read the shadow mechanism now read the
gap and the grounds either side of it.

Not caused by this change, failing on main too:
`test_a_card_group_taking_a_pick_reads_as_one_control`,
`test_a_group_of_bare_labels_reads_as_a_question_about_the_page` (option
marks computing `font-size: 0`),
`test_a_quoted_widget_exhibits_without_taking_input`, and
`test_a_focused_card_comment_never_paints_over_the_cards_contents`.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 27, 2026
The target-hint reaction journey counted the keyboard focus ring
introduced by #4294 as an unwanted reaction contour, then expected the
former native outline. The runtime is behaving as intended: the returned
target has a projected focus ring, and the reaction leaves only its
margin glyph once focus leaves.

Update the journey to check the projected focus ring and its painted
outline, then require every projected contour to disappear after focus
leaves while the reaction glyph remains. No product behavior changes.

Validation: the named journey failed before this change with `projected:
1` and passes after it (`1 passed`). The earlier scheduled run
40311120380 passed this test; dispatch 40445030137 records the reported
assertion failure on both platforms.

Closes #4372 — automated triage

---------

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 27, 2026
The focus-ring sweep now expects the rules that paint five specimens:
the release-notes paragraph’s projected mark, the thread card’s Resolve
icon, the floating response field, a contents link and a settled option.
Their stale selectors stopped the sweep despite painted rings belonging
to the focused samples. The ownership, paint-token, clipping and
coverage assertions remain unchanged; runtime and visual behavior are
unchanged.

The complete sweep passes in 382 seconds, including the corpus-wide Tab
walk and every named specimen. Isolated runs reproduce the stale
expectations before correction and pass afterward. The existing
projected-focus regression also passes, including its control that
removes the ring and requires the focus reading to reject it. Python
compilation and `git diff --check` pass.

The paragraph expectation became stale when #4294 moved focus paint onto
the projected mark. This branch includes main’s merged #4413
selector-serialization repair, which lets the sweep reach these stale
expectations.

Closes #4414 — automated triage

---------

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Oct 30, 2026
Leaf's focus marks stood at different distances from the same block.
Since #4294 the Alt aim, a comment's brackets, the margin trace and
projected keyboard focus stood flush on a region's edge, while the
location ring that arriving with `m` draws stood 3px out. Prose has no
padding, so the flush line ran along the first letter of every line,
going from aim to comment to arrival moved the frame 3px each time, and
two marks on one question drew two lines.

`browser/base.css` now states the rule beside the ring tokens. What a
mark says sets its stroke: the focus ring and the location ring draw the
whole band, brackets draw its two ends, an SVG target takes its own
contour, and a large composite takes a quiet ground. The box a mark
stands round sets where the band stands:

- a region (a section, question, figure or paragraph) at
`--focus-region-gap`, 6px out, which every mark on it shares;
- a control at its ring's 3px gap, or closer where its neighbours stand
closer;
- a field on its border;
- a box packed into a list, padded inside a frame it fills, or clipped
with no room outside, one band inside its edge.

The user chose 6px for regions from captures at 3px and 6px: at 3px the
band still stood close to the first letter, and past 6px a bracket meets
a heading's link icon.

### How the marks follow it

- `standOver` (`browser/runtime/target-paint-geometry.js`) decides, for
the aim, the trace and every comment mark alike, whether the mark stands
on a control, on a region, or inside a target its clip leaves no room
around, and how far it may reach past each side a scroller cuts.
`css-anchors.js` reads that room per side, and `visual-mark-paint.js` no
longer checks for cramped targets on its own.
- The bracket overlays draw with the outline's own offset, so their
corners round as the location ring's do, and the aim's tint fills out to
its brackets.
- The location ring on a question and on an `lf-ask` stands at the
region gap. A landing keeps the widest ring's room at a scroller's edge
(`--focus-ring-landing`), and the sidebar's track body and full-height
tab sets pad by the region's room so the ring isn't cut there.
- A choosing `lf-options` that is itself the decision hands its location
ring to the row the user tabs to, as one inside an `lf-ask` already did.
It used to keep both, two accent lines a few pixels apart.
- A page's own tabs hang their panel's ring from the strip's rule and
stand it 6px clear of the text on the other three sides. Inside the
panel's edge, the band had run down the first letter of every line, and
out on the top too, the strip covered it. A boxed set, a side list and a
page's parts pad their panel inside a frame, so their ring stays inside.

### Tests

Changed behavior: brackets, the trace, projected focus and the location
ring on a region stand 6px out; a page tab's panel ring stands outside
the panel on three sides. Tests that read the old distances now read the
region gap from the theme. New tests cover a bare choice handing its
ring to the row, the aim and a comment standing inside a table cell its
frame leaves no room around, and the page tab's ring standing 8px out
(the gap plus the band) on three sides. The bare-choice and page-tab
tests fail with their CSS rule disabled. `mark_edges` takes an `outset`
for a mark standing outside the element's edge.

### Left for follow-ups

- An SVG part still changes shape between aim and comment: Alt brackets
the part's box, while a comment draws the part's own contour at 1.5px.
- Where a box stands its mark is decided twice. `standOver` decides it
for the overlays, and each control's CSS ring rule decides it for that
control. The overlays don't know which boxes draw their own ring inside:
Alt over a `label.choice` stands 3px out, while its keyboard ring stands
2px inside. The CSS rings don't get the overlays' clip check either: a
question's location ring or a page tab's panel ring inside an unpadded
`overflow: clip` box loses its sides. One per-box property, read by both
the CSS rules and `standOver`, would settle both.

> _This was written by Claude Code on behalf of max-sixty_
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