Repository navigation
Distinguish thread focus from control focus - #391
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
Two things, one verified in Chrome and one alignment gap. The rest of the change reads well — swapping the card's mark from a second perimeter to a repaint of its own edge is the right call for a composite region, and the test rewrite keeps the cut/covered halves honest (COVERED_TOP still runs at every landing of the walk).
The panel-side mark disappears under forced colors when the reader arrives by pointer
The removed comment named this case exactly: :focus-within and not :focus-visible, "because a reader who reached the comment with the mouse had the page marked and the card left plain". In normal colors the new treatment keeps that promise. Under Windows High Contrast Mode it does not, because forced colors overwrite border-color and background-color with the system palette but leave an outline standing as a distinct band.
I reproduced it against /usr/bin/google-chrome with the two rule bodies side by side, focused by click:
Repro and readings
[forced-colors=active] NEW focused: border rgb(0,0,0) bg rgb(255,255,255) outline none :focus-visible False
[forced-colors=active] resting : border rgb(0,0,0) bg rgba(255,255,255,0) outline none
[forced-colors=active] OLD focused: border rgb(0,0,0) bg rgba(255,255,255,0) outline solid 2px rgb(0,0,0)
The current card and a resting card compute to the same forced border, and Canvas over Canvas is not a wash — so there is nothing left on the card at all. The chrome layer's existing rescue, :scope :focus-visible { outline: 2px solid Highlight !important; } in the @media (forced-colors: active) block near the end of runtime/chrome.css, does not reach it: a click on a card gives :focus without :focus-visible.
The keyboard path is fine. I checked separately that a script focus() driven by a keydown does set :focus-visible in Chrome (both with and without forced colors), so the t/T walk still lands on the Highlight outline. It is the pointer landing that loses everything.
A Highlight border under @media (forced-colors: active), keyed on the same :focus-within predicate rather than on :focus-visible, would close it and stay next to the rules already there. Happy to push that as a commit if you want it in this PR.
Two runtime modules still describe the ring the thread no longer draws
CLAUDE.md asks that the implementation and its owning references stay aligned, and these two are the prose that owns the pairing rather than incidental comments.
skills/leaf/assets/runtime/anchors.js, in the block that explains the two halves of lf-mark-here:
While typing, the reply box carries the strong focus ring and the enclosing thread keeps a subdued outline.
The thread now writes outline: none and keeps a quiet border instead — a reader following this to the CSS finds the opposite of what it says.
skills/leaf/assets/runtime/conversation/landing.js, in the comment explaining why the landing hangs off focus and why block: "nearest":
The thread holding the focus, not the card alone: the ring is the thread's, drawn for
:focus-within, so it is cut in the same place whether the reader is standing on the card or writing in its box.
The card's paint is now inside its own box, so "cut in the same place" is a claim about a ring that is gone. The scroll reasoning that follows it still holds, but its stated reason no longer does.
Both are outside the diff, so I have not put them inline — say the word and I will push them with the forced-colors rule.
leaf-agent
left a comment
There was a problem hiding this comment.
The forced-colors rule closes the pointer landing on a card, and the prose realignments in anchors.js and landing.js now read correctly against the rules they describe. One case is still open, inline: the same rule is outranked while the reply box holds focus, so writing in a comment leaves the card with a resting card's edge under high contrast. Readings and a suggestion are on the line.
|
So two of the three are live on main rather than introduced here, and the third is the merge base being behind. The Runs behind each lineEach row is
For the ring walk, dumping Bisected on main: |
# Conflicts: # tests/test_render_conversations.py
leaf-agent
left a comment
There was a problem hiding this comment.
The panel half of this pair reads settled. The inline rule the last commit adds keys its current-region paint on :focus-visible, so a reader who arrives by pointer gets no mark at all — reproduced in Chrome, with a suggestion on the line. A second point sits on the forced-colors twin, whose test stays green with the rule it names deleted.
Superseded by the review on a later commit.
leaf-agent
left a comment
There was a problem hiding this comment.
One finding, inline on the rule: the inline half of the pair draws its quiet edge on the content rather than beside it, where the panel card's repaint stands 8px off. The remedy is a layout choice rather than a one-liner, so it is a note rather than a suggestion.
leaf-agent
left a comment
There was a problem hiding this comment.
One finding on the room this commit reserves, inline on the rule: it is overridden for every inline thread after the first, so a conversation with two root comments paints its current region lopsided. Reproduced in Chrome with readings on the line. The remedy is the same kind of layout call as the last round, so it is a note rather than a suggestion.
Closeout work from the UI and UX sweep that landed in #379, and the reds it turned up on main along the way. **The wide shelf's height was reading its chords.** #388 gave a banner control that opens a stable destination a quiet second line carrying its chord, and paid for that line with `padding-block: 3px 14px` on `[data-lf-chord]` — the controls that happen to be carrying one. The runtime writes that attribute only while a binding is live and unshadowed, so it comes and goes as the reader moves: a letter typed inside the go-to prefix filters the visible targets and takes every chord off the row. Measured at 1200px, each control went 33px → 30.3px and the row 41px → 38.3px on that gesture, which is a metric expressing state. The wide shelf now reserves the line for every control it draws, so the chord's text is the only thing left for state to paint, and `test_the_shelf_keeps_its_height_when_its_chords_are_shadowed` pins it. #407 landed the compact half of this while the branch was open, and its answer stands: a forty-pixel aim has no second line to give, so the compact block states the row's whole box and drops the hint there. It does not reach the wide row, where the news chip carries no chord — verified against `main`'s tip, where the shelf still loses 2.7px a control. The sheet test goes back to reading each label centred in its own box, which is what #407's fix restores. **The margin thread's composer is read against the card's content box.** `test_the_margin_groups_meanings_at_one_destination_without_moving_the_page` asserted the composer's right edge meets the thread card's, which #391 made false by four pixels when it gave the card symmetric resting room to draw its focus edge inside. That room is the design; the claim the assertion was making — the composer spans its card — is about the content box, and a composer genuinely inset from the card still fails it. #410 is open against the same two hunks of that test from the opposite premise: that the card's inner gutter is a defect the margin seat should spend rather than resting room to measure around. The two layouts are compatible even though the accounts are not — under #410's geometry the thread keeps its padding and `threadRight - threadPad` is still the composer's right edge, so this assertion holds either way, and its CSS stands or falls as a design change on its own. Whichever lands first, the other's test hunks want a rebase. **`scripts/linux-suite.sh` can now build for the host's architecture** (`LEAF_SUITE_NATIVE=1`). Emulating amd64 is what makes the image CI's, and on Apple silicon without Rosetta it is also what breaks: qemu kills Chromium's GPU process before the first context opens, on `about:blank` as readily as on a page, which surfaces as `TargetClosedError` and reads like a product failure. The native build gives up Google Chrome, which ships for amd64 only, and keeps CI's fonts — so it answers a question about how wide something is with CI's own numbers, and is not the control for a case that drives the installed launcher. CLAUDE.md's landing-past-a-red rule now says which mode it means. **A section is watched at its heading.** `lf-toc` observed each section's destination, which for a generated destination is a 1×0 span whose resize observation can never fire. **One test no longer depends on where the run's temporary directory is.** `test_an_unidentified_old_service_is_not_mislabeled_as_the_calling_leaf` read the whole startup note for the calling payload's path, which also reads the page and stop lines — and the page directory legitimately sits under the checkout whenever a run is given a `--basetemp` there. Equality on the runtime line says what the absence was reaching for. A full local `--run-nightly` run on this head is 2149 passed, 1 failed: `test_render_widgets.py::test_suggestion_controls_stay_out_of_the_column[no-preference]`, which reproduces deterministically with `main`'s own `chrome.css` in place and belongs to a module this PR does not touch. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Thread browsing used to surround an entire conversation with a persistent 2px accent outline, making a large composite region read like a focused control. This replaces that second box with a shared current-surface treatment: panel cards repaint their existing 1px edge, while unbordered inline conversations reserve a small symmetric resting gutter and draw the same quiet edge inside it. Both receive a slight wash, and compact controls retain the strong focus ring.
When the reply field takes focus, its ring becomes primary and the parent conversation recedes. Windows forced-colors mode restores a system Highlight outline where high contrast suppresses the surface paint. Browser coverage now distinguishes thread surface paint from compact focus rings and checks keyboard and pointer landings, content clearance without focus reflow, later inline siblings, scrolling, sticky headings, reduced motion, and forced colors.
Tested with
uv run pytest tests(907 passed), the complete navigation browser file (93 passed), the Leaf Chrome render gate in light and dark, responsive browser sweeps, and a live keyboard and pointer user pass.