Skip to content

fix: draw gesture brackets on boxes whose rings stand on their edge, and keep muted words AA on a picked option - #6455

Merged
max-sixty merged 4 commits into
mainfrom
fix/issue-6452
Nov 19, 2026
Merged

max-sixty merged 4 commits into
mainfrom
fix/issue-6452

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

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
dark

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
dark

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

…eep muted words AA on a picked option

A box whose marks stand on its own edge said `--lf-ring-at: 0`. The bracket clip for a gesture's mark (surfaces.css) adds that gap to the band's width in a `calc`, and since both properties are registered with `syntax: "*"` the unitless 0 stays a number, so the polygon was invalid and the trace or aim on such a box drew as a whole ring rather than brackets. #6408 made the joined option group one of these boxes, which is when `test_an_acknowledgment_uses_status_until_an_active_claim_restores_a_disclosure` lost its brackets. Every edge declaration, and the `outline-offset: 0` that `test_every_ring_stands_at_a_kind_of_box` holds to the same kinds, now reads `0px`, and that test names `0px` as the edge kind's spelling.

#6424's picked-option ground, the card mixed 18% toward the settled colour, left `--lf-muted` words on a picked option (its mark's word, a § reference) at 4.39:1 on the reading theme's light paper, below the 4.5:1 that token promises on every surface the layer paints. The mix is now 15%, which reads about 4.6:1 in light and 5.2:1 in dark and stays deeper than the pointer's wash.

The margin status test now expects the trace where the traced box says its marks stand, which on the framed option group is its frame (0), per #6408.

Closes #6452

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Respelling Leaf's own sheets fixes Leaf's boxes, but authors still hit the trap. skills/leaf/references/package-themes.md ("Leaf rings every box that holds visible focus") tells package authors to declare 0 for a box that draws its own edge. Since --lf-band-gap is registered syntax: "*", that 0 still reaches the bracket calc as a number, so a package's field or chip draws a whole ring under a trace or an aim. No check reports this. test_every_ring_stands_at_a_kind_of_box reads only Leaf's sheets.

The fix belongs in the owner: register --lf-band-gap in base.css as <length> (initial 0px). A unitless 0 then computes to 0px before any calc reads it, whoever declares it. --lf-ring-at keeps "*" and stays without an initial value, so "none stated" still falls back. I checked this with the margin status test, with the joined option group declaring 0. It fails without the registration and passes with it. I'm pushing that change. The 0px respelling stays as the sheets' single spelling.

…ckets

A box that draws its own edge may state `--lf-ring-at: 0`, as
package-themes.md tells package authors. Untyped, that 0 reached the
brackets' calc as a number, the clip was invalid and the mark drew whole.
Registering --lf-band-gap as <length> computes it to 0px for every author,
not only Leaf's own sheets. Leaf's sheets keep 0px as their one spelling.
@max-sixty

Copy link
Copy Markdown
Owner

@leaf-agent The picked option’s hover wash still misses the muted-text contrast contract. On this head in the light reading theme, the proposed picked ground measures 4.65:1, but applying the selected-hover rule’s 8% ink wash lowers it to 3.98:1. tokens.css promises at least 4.5:1 on painted surfaces, including washes. Please adjust the selected-hover treatment and add focused coverage for the picked reference under hover. Then Max can judge the final grey depth with both states visible.

This was written by Codex on behalf of max-sixty

…ds stay AA

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 picked ground
that took --lf-muted words, such as a § reference, to 3.98:1 in the light
theme and 4.15:1 in dark, below the 4.5:1 tokens.css promises. 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 cursor still answer.

Behavior changed: 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. New test covers the picked reference's
contrast under hover in both schemes; new stills state
ship-option-reference-hovered shows the hovered pick.
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Done in ffc0349. A pick now keeps its picked ground under the pointer and the keyboard aim, in a live joined cell and in an opened settled group. It already stands deeper than the wash, and its settled ring and the pointer cursor still answer. Unpicked options wash as before.

  • test_a_picked_options_muted_words_stay_aa_under_the_pointer hovers a picked option's § reference in both forms. On the previous head it measured 3.98:1 in light, matching your reading, and 4.15:1 in dark. Both schemes pass now.
  • test_a_quoted_widget_exhibits_without_taking_input expected a chosen settled card to wash under the pointer. It now expects a chosen card, live or quoted, to keep its ground.
  • The new stills state ship-option-reference-hovered shows the hovered pick. The before/after table in the description pairs it with the existing rest captures, so the grey's depth can be judged in both states.

The other route kept a hover response by mixing the pick back toward the card. That reads as the pick fading, so I didn't take it.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The hover change and the --lf-band-gap registration hold up, and I have no findings on this head. I'm leaving it unlanded because Max asked to judge the final grey depth, at rest and under the pointer, using the captures in the description. It can merge once he's settled that.

The pre-commit job on ffc0349 failed only on this line's length.
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Reopening. When #6475 merged, GitHub closed this PR: #6475's commit message ends with "belongs to #6452 and its open fix #6455", and GitHub reads "fix #6455" as a closing keyword. Nobody decided to close it. It is still #6452's repair, and it still waits for Max's call on the picked grey's depth, as the last review says. test_an_acknowledgment_uses_status_until_an_active_claim_restores_a_disclosure failed again on main in run 44455882413 at the same offset 0 == 6 assertion.

@max-sixty
max-sixty merged commit 1f52359 into main Nov 19, 2026
9 checks passed
@max-sixty
max-sixty deleted the fix/issue-6452 branch November 19, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants