Skip to content

Stand a question's ring on its frame, or a region's gap out where it has none - #6408

Merged
max-sixty merged 7 commits into
mainfrom
focus-ring-gap
Nov 18, 2026
Merged

max-sixty merged 7 commits into
mainfrom
focus-ring-gap

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Next On Me drew the location ring round an option group asked alone in a thread message 6px off the group's frame, while the ring round a question on the page stood 3px out. Neither box stated --lf-ring-at, so both took the press list's guess in surfaces.css: the thread's lf-options has no role and fell to a region's gap, and lf-group's role="group" matched the list's [role] (#5306) and took a control's. This PR has each box state its kind in the rule that draws it. The joined option group draws a frame, so it states 0 and its ring lies on the frame, as a field's does. A named group draws nothing, so it states a region's gap. The taxonomy in tokens.css states the rule for any box that draws a frame round itself, naming no widget, and lists the named group with regions.

Decided: Max chose this on a design page: the ring on the frame where a question has one, and 6px where it has none. It replaces the 3px for every question that an earlier commit on this branch drew. Firefox stills against main, 2x:

main this PR
Option group asked alone in a thread: 6px → on the frame
Question on the page: 3px → 6px
Group asked in a thread message: 3px → 6px

The named group has to state its gap, since [role] would otherwise give it a control's; narrowing the press list to roles that take a press is a separate change. Tests: the ring-kind model test, test_current_location.py (its choice's arrival ring now reads 0) and the ring and aim tests that use groups pass. Stills of ten question states in Firefox change pixels only in the four states that show these three cases; the rest change computed outline-offset on unringed groups. The new stills state plan-card-choice-keyboard reaches an option group asked in a thread card.

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

An option group the agent asks alone in a thread message is its own
question, and Next On Me drew its location ring 6px off the group's
frame: the group stated no `--lf-ring-at` and has no role, so its marks
fell to a region's gap. A question on the page is an `lf-group`, whose
`role="group"` matches the press list in surfaces.css, so the same ring
stood 3px out there. Measured in Chromium, Firefox and WebKit alike: 6px
of page between the ring and the frame in a thread, 3px on the page.

A question now states a control's gap in the rules that draw it: the
live `lf-options` (options.css) and every `reading-role: group` box
(base.css), so the group no longer depends on its role reaching the
press list. The taxonomy in tokens.css moves "a question" from the
regions to the controls, with the reason. This narrows the user's choice
in #4732 of a region's 6px for every mark on a question; prose regions
keep it.

Changed behavior: the location ring, the aim and a comment's brackets on
a live option group stand 3px outside its frame rather than 6px;
`test_a_choice_sharing_its_group_hands_its_ring_to_the_row_the_user_tabs_to`
now reads the control's gap. A new stills state,
`plan-card-choice-keyboard`, reaches an option group asked alone in a
thread card.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The body leaves the 3px-vs-6px call under What to weigh to Max. It would reverse #4732's recorded choice, so I'm leaving the verdict open rather than approving and having a yolo merge decide it.

One fact for that call: the base.css rule stands the marks at a control's gap on every reading-role: group box, not only on groups that ask a question. lf-group's instructions say "one holding no question is a named part of the page like any other", which tokens.css counts as a region. So choosing 3px here means 3px for every named group, including a prose-only group that a reader aims at or comments on. Pixels on the page don't change, because role="group" already pulled those groups into the [role] press list in surfaces.css. The difference is that the rule now states this on purpose. The new tokens.css line, "a question … (a group, …)", reads as though every group is a question. If 3px is the choice, the taxonomy should list a named group as its own kind of box, so that a later change doesn't treat a group with no question as a region again. Separately, [role] matching roles nobody presses, such as group, note and figure, is the incidental route this PR is working around. It still sends any author box carrying a non-control role to the control gap.

Max picked 3px over 6px for both kinds of question, a named group on the
page and an option group asked alone in a thread message, from 2x
captures of each on a design page. The ring taxonomy in tokens.css now
says the choice is the user's, as the region gap's already does.
…gion's gap out

Max picked 3px for every question on the design page, then asked for 6px
where the question has no frame round it and the ring on the frame where
it has one, if that was easy to encode. It is: the joined option group
draws its own edge, so it joins that kind (on its edge, at 0) by stating
--lf-ring-at in the rule that draws its frame, and a named group draws
nothing, so it states a region's gap. The group has to state it, since
its role="group" matches the press list's [role] and would otherwise
take a control's gap.

Firefox stills against main: an option group asked alone in a thread
goes from 6px to 0 (plan-card-choice-keyboard, on-me-thread-choice), a
page question's group from 3px to 6px (ideas-ask), and a group asked in
a thread message from 3px to 6px (ship-card-ask-keyboard). The location
test now reads the choice's arrival ring at 0.
@max-sixty max-sixty changed the title Stand a question's ring at a control's gap, in a thread as on the page Stand a question's ring on its frame, or a region's gap out where it has none Nov 18, 2026
Max asked how Leaf identifies an option group and worried the frame rule
splits the contract between core and widgets. It doesn't identify one:
the widget's stylesheet states --lf-ring-at in the rule that draws its
frame, as every box does. The taxonomy in tokens.css, which is core, now
states the user's choice as the general rule for any box that draws a
frame round itself, rather than naming the option group.
leaf-agent pushed a commit that referenced this pull request Nov 18, 2026
…gional mirror too (#6430)

CI's setup step deleted only Azure's apt mirror from the runner's mirror
list. Since actions/runner-images#15335 (2026-11-17) some Ubuntu 24.04
images are built on AWS and list
`http://us-east-2.ec2.archive.ubuntu.com` first instead, and on those
runners `playwright install --with-deps` fetched its 126 MB at 62–69
kB/s: 30–34 minutes on the three `test` jobs on image 20261111.127.1
today that finished, and two more cancelled after 12 and 25 minutes,
against 4–36 s from `archive.ubuntu.com` on images 20261111.370.1 and
20261116.376.1. The rule now deletes any regional host under
`archive.ubuntu.com`, which leaves those images the same 93-byte list
(`archive.ubuntu.com`, then `security.ubuntu.com`) the fast images
already had.

The rule moves into its own action, `.github/actions/ubuntu-archive`,
which the setup action and publish-site's deploy job both use. The
deploy job installs Chromium's packages without the setup action, so it
kept every regional mirror: on AWS images today that install took 232 s
(20261116.133.1) and 479 s (20261111.127.1), against about 20 s on
20261111.370.1.

Max asked why #6408's CI hung. Checked: the rule against the list
`configure-apt-sources.sh` writes for each case (Azure, AWS, neither);
pre-commit, actionlint included, passes. Whether this run lands on an
AWS image is chance; its setup log's `Mirrorlist [93 B]` line shows the
list either way. publish-site runs only on `main`, so its first run
after merge is the first to exercise the new step there.

> _This was written by Claude Code on behalf of max-sixty_
@max-sixty
max-sixty merged commit c61ba97 into main Nov 18, 2026
6 of 7 checks passed
@max-sixty
max-sixty deleted the focus-ring-gap branch November 18, 2026 22:47
max-sixty pushed a commit that referenced this pull request Nov 19, 2026
…and keep muted words AA on a picked option (#6455)

Two causes made
`test_an_acknowledgment_uses_status_until_an_active_claim_restores_a_disclosure`
fail on `main`. This PR fixes both, and the test now passes. Before the
change it failed at the offset, then at brackets, then at the axe check.

**Brackets on edge boxes.** A box whose marks stand on its own frame
declared `--lf-ring-at: 0`. The bracket clip in
`browser/styles/components/surfaces.css` adds that gap to the band width
inside a `calc`. Both properties are registered with `syntax: "*"`, so
the unitless `0` stays a number, and the polygon is invalid at
computed-value time. So the trace or the Alt aim on any such box drew a
whole ring instead of brackets. That covers fields, marks, reactions, a
diff's and a file editor's shadow boxes, and, since #6408, the joined
option group. `base.css` now registers `--lf-band-gap` as `<length>`
(initial `0px`). A box's `0` therefore computes to `0px` before the
`calc` reads it, and that holds for a package's boxes too, since
`package-themes.md` tells authors to write `0`. `--lf-ring-at` keeps
`"*"` and no initial value, so a box that states nothing still falls
back. Leaf's own edge declarations, and the three `outline-offset: 0`
declarations `test_every_ring_stands_at_a_kind_of_box` holds to the same
kinds, are respelled `0px`. That test names it as the kind's one
spelling. Positions don't change, because `0` and `0px` place an outline
the same. The only visible effect is that gestures on these boxes draw
brackets again.

**Contrast on a picked option.** #6424's picked ground mixes the card
18% toward the settled colour. On the reading theme's light paper, that
leaves `--lf-muted` words on a picked option at 4.39:1 (axe, on the
`.lf-ref` § reference). `tokens.css` promises that token 4.5:1 on every
surface the layer paints, and the option's own mark word is muted too.
The mix is now 15%, which measures about 4.6:1 in light and 5.2:1 in
dark. It is still a neutral grey and still deeper than the pointer's
wash, so #6424's reasons for the fill hold. The picked row is one step
lighter:

| | before | after |
|---|---|---|
| light |
![](https://github.com/user-attachments/assets/c953e9c5-dc63-4a34-b179-99ebd686ad56)
|
![](https://github.com/user-attachments/assets/be688fa6-4cf7-4de6-ad47-95fda2dc0224)
|
| dark |
![](https://github.com/user-attachments/assets/e2e538ab-385a-4da5-9dc6-864ada876584)
|
![](https://github.com/user-attachments/assets/cb6515e8-e616-41f9-aabc-495f3cfd78e5)
|

Captured with `leaf-dev stills --state ship-option-references` (and
`--scheme dark`). `plan-option-picked`, `plan-option-card-picked` and
`settled-option` show the same lighter pick and nothing else. Max chose
the depth of the grey, so whether 15% is the right step is his call. The
other route would be to darken `--lf-muted`, which would change every
page.

**Test.** The margin status test expected the trace at
`--lf-focus-region-gap`. Since #6408, a box that draws its own frame
stands its marks on that frame. The test now reads where the traced box
says its marks stand (`--lf-ring-at`) and expects 0 on the framed group.

Checks: the failing test and `tests/model/test_interact_layer.py` pass,
as do the ring, aim, trace, pick and contrast tests in
`tests/browser/controls/test_rings.py`, `test_render_aim.py` and
`test_render_options.py` (161 passed). With the hover change, the same
files gave 198 passed and one failure, the quoted-widget test's
chosen-card expectation, which now passes as updated. I also ran the
margin status test with the joined option group declaring `0`. It fails
without the `--lf-band-gap` registration and passes with it.

**Hover on a pick.** The aim wash deepened a picked option 8% toward the
ink, in a live joined cell (pointer or keyboard aim) and in an opened
settled group. On the 15% picked ground that left muted words at 3.98:1
in light and 4.15:1 in dark. A pick now keeps its picked ground under
the pointer and the keyboard aim: it already stands deeper than the
wash, and its settled ring and the pointer cursor still answer. An
unpicked option's wash is unchanged. A chosen settled card no longer
washes under the pointer, so
`test_a_quoted_widget_exhibits_without_taking_input` now expects a
chosen card, live or quoted, to keep its ground.
`test_a_picked_options_muted_words_stay_aa_under_the_pointer` measures a
picked option's § reference under hover in both forms and both schemes
(3.98:1 and 4.15:1 before, passing after). The new stills state
`ship-option-reference-hovered` shows the hovered pick:

| hovered pick | before | after |
|---|---|---|
| light |
![](https://github.com/user-attachments/assets/db5d85d8-9b7a-49d2-9107-cd68dcbb9b34)
|
![](https://github.com/user-attachments/assets/c1e6b0b2-1691-4c1e-8b82-fb2caa8b8155)
|
| dark |
![](https://github.com/user-attachments/assets/7caa01ee-ab68-4acc-9649-2b96bf1b5fbc)
|
![](https://github.com/user-attachments/assets/735b4e04-15e9-40ca-8b45-b4196ad52072)
|

The alternative kept a response under the pointer by mixing the pick
back toward the card. That reads as a pick fading out, so I didn't take
it; the grey's depth, at rest and under the pointer, is Max's call.

Closes #6452 — automated triage

---------

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 26, 2026
…bove it (#7256)

Where a deck fills a workspace, as catch-up's does since #7220, its bar
sticks over the cards with the page's background (#7192). The open card
is a named group, so its focus and location rings stood a region's gap
(8px) outside it: the bar, flush above the card, covered their top run,
and the workspace's scroller clipped their sides. The location ring that
`m` draws on arrival showed as only a line under the card. The card now
states its marks one band inside its edge, over the frame it draws, as
`tokens.css`'s "Where it stands" asks of a box with no room outside it.


`tests/journeys/test_render_controls.py::test_each_sampled_focus_ring_is_shown_whole_in_its_surface`
fails on main with the fault in #7246 and passes with this change (`uv
run pytest -n0 … -k
test_each_sampled_focus_ring_is_shown_whole_in_its_surface`, both run
locally in Chrome). `test_every_ring_stands_at_a_kind_of_box` passes.

**What changes on screen:** every deck card's rings, on a column page
too, move from 6px off the card's frame onto it. #6408 settled that a
framed box's ring lies on its frame; this card takes the inset rather
than `0px`, since at `0px` the 2px band still stands outside the border
and under the bar. The new `deck-card-keyboard` state captures catch-up
after `m` (`uv run leaf-dev stills --state deck-card-keyboard`), Chrome,
1440×900:

| main | this PR |
|---|---|
|
![before](https://github.com/user-attachments/assets/188144a2-6672-4091-b068-e6e3c8dffc17)
|
![after](https://github.com/user-attachments/assets/dd5a0d15-7ef8-4861-81d5-b52ae075c799)
|

Closes #7246 — 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