Repository navigation
Use rectangular faces for actions and chips - #389
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
The rename and the radius token read as complete and self-consistent: no lf-pill survives anywhere in the tree, the reserved-class list, AIM_SURFACES and the ring token all move together, and the two places that sit outside the theme's reach — scripts/mcp-app/page-app.css and its generated skills/leaf/mcp-app/page-app.html — correctly take the literal 3px rather than var(--chip-r). --chip-r lands on :root beside --r, so both the @scoped chrome rules and the lf-shadow copy of .lf-chip resolve it by inheritance. The gallery's .interaction-control giving up its own border, ground and hover accent for .lf-btn leaves nothing unpainted — [data-lf-offer] already carried the hand, the disabled treatment and the focus ring.
I'm holding the approval only because test is red. That check failed on one case, test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus, in the "Nightly cases this pull request touches" step; the everyday suite step passed. I reproduced that failure on the merge base 821e0d5b in a clean worktree — same pageSettled probe timeout, twice — so it is not this change, which corroborates what the description already says about it.
What I ran locally on the merged tree
tests/test_render_options.py— 46 passed, including the newborder-radius == 3pxassertion intest_one_chip_holds_every_short_fact.tests/test_render_controls.py— 81 passed, 1 failed (test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus). That single test then failed identically on821e0d5bin a separate worktree.tests/test_site.py— 30 passed.tests/test_render_startup.pyplus the coined-class and ring cases from the conversation and projection modules — 74 passed.tests/test_render_pages.py— 51 passed, 1 failed (test_a_shipped_log_opens_its_example_on_a_live_thread). Deterministic on the merged tree (3/3) and equally deterministic on821e0d5b(2/2), so also pre-existing and unrelated.scripts/vendor.py mcp-appandscripts/corpus.pyboth regenerate byte-identical output, so the committed MCP App resource and the derived corpus are in sync with their sources.
One thing I checked and decided not to raise as a finding, in case it is useful anyway: .lf-chip (the chrome class — bordered, --card ground, line-height: 1.7) and lf-chip (the default package's declared tag — no border, --chip ground, line-height: 1.6) are now two different faces under one name, where before the chrome half was spelled lf-pill. Nothing collides in the cascade, since one is a class and the other an element, and the reserved-class test keeps a page from coining either.
leaf-agent
left a comment
There was a problem hiding this comment.
ac01c696 clears the red I was holding the approval for: test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus --run-nightly passes on this merged tree, where the previous review reproduced its pageSettled timeout twice on the merge base. What I'd want a second look at is which layer cleared it, because two open PRs already carry the other half of this commit.
#394 fixes the same failure at the runtime. It traces that timeout to a cycle this commit does not touch — layoutMarginRows floats a docked cluster out of flow and docks it back, moveHost blurs and refocuses the held control across the move, and keyboard/dispatch.js answers both focusin and focusout with paintHere(), whose layout asks for the next placement. Neither living-margin.js nor keyboard/dispatch.js is in this diff, so that loop stands here as it does on main; what the new CSS rule removes is the loop's only observable. Detail inline on chrome.css. The rule reads well on its own terms — a keyboard destination saying its label at once is worth having, and the comment says why — and it is using it as the fix for the settle timeout that I'd separate from that. Order matters for #394 in particular: its body names that test as its only gate, so if this lands first #394 arrives with nothing holding it.
#383 makes the same HEARTBEAT_PAGES edit, on the same lines, for the same reading. Inline below. It also reaches examples/developer/feature-gallery.html and the same two corpus cost measurements: it waits for every [data-interaction-frame] to carry data-interaction-ready before opening the CDP session, because a frame still arriving lays itself out in the measured page's process. This commit's display: none defers that layout rather than removing it — a non-rendered frame runs no rendering steps, so the work lands in one piece when readiness flips the frame to display: block — and the two measurements here still open their session without that wait.
Neither is a request to change anything on this branch; both are calls about which PR carries which half.
leaf-agent
left a comment
There was a problem hiding this comment.
Two things the shape change leaves behind it, both outside the diff.
The response bar's own module still states the retired corner. Detail inline on the chrome.css comment this commit rewrote — its counterpart in composing/surface.js was not.
The landing page's screenshot shows the shapes this retires. docs/session-light.png hashes to 849ee440f3fa3b04, which is the <img src="/media/849ee440f3fa3b04.png"> inside <figure class="shot" id="session-shot"> on docs/index.html; session-dark.png is that picture's dark <source>. In that still the milestone's +1, the timeline's 14:02 and next, and the thread's … reaction trigger are all 999px capsules — the three faces this change moves to a 3px chip and a 6px rectangle. docs/demo.gif records the same scene. scripts/CLAUDE.md keeps record-demo.py for exactly this case ("Keep the latter while the product can make those frames stale"), and 3bbacba1 re-recorded the GIF and both stills in the commit that changed the surface, so the precedent is that a change of this reach carries them. The examples catalog is the same staleness a step further out, but it sits behind the leaf-assets pin, so it is wt refresh-previews rather than anything this branch can hold.
Neither is a change I'd make without you — say the word and I'll push the surface.js correction here.
leaf-agent
left a comment
There was a problem hiding this comment.
Approved above, and I am leaving that approval standing over the red test check rather than dismissing it, because the failure is main's and not this branch's. ci on main at b8d451cb is red on three nightly cases. This PR fixes two of them — test_render_anchors.py::test_the_floating_response_bar_has_one_compact_face (fixed by the merge's re-anchor onto .lf-response-more) and test_render_margin.py::test_reaction_choices_and_their_receipt_share_an_unided_selected_block (fixed by f8eb8d3e). Both pass here and fail on b8d451cb in a clean worktree running main's own sources. The third is what is holding the gate, and it is untouched by this diff.
test_render_controls.py::test_coarse_pointer_resize_reach_stays_reachable_without_trapping_scroll fails at standing_ring because the ✓ Sent just now receipt is still standing over the comments grip's focus ring when the reading is taken — ring 1,420,49,468 against receipt 24,465,367,493, a three-pixel overlap at the grip's bottom edge, identical in main's CI log and in every local run. I reproduced it on b8d451cb and on each of the eleven main commits back to 14c746ba, three runs each on the two I repeated, so it is long-standing rather than anything the last few merges introduced.
I have not re-run the job. It reproduces deterministically here, so a re-run would hide it rather than clear it — and by the shape in running-tend, this is a reading taken while the page is still passing through a state it leaves, which is the class a re-run is worst for. tend-ci-fix already has main's red; this PR is only carrying it, and landing it removes two thirds of it.
Runs behind this
All local runs use --run-nightly -p no:randomly against a clean git worktree per commit, with PYTHONPATH pointed at that worktree's skills/leaf/scripts so the checkout's own leaf.pth cannot serve the wrong sources.
| case | b8d451cb (main) |
f8eb8d3e (this head) |
|---|---|---|
test_the_floating_response_bar_has_one_compact_face |
fails — Locator.evaluate timeout on .lf-fab-bar .lf-react-trigger |
passes |
test_reaction_choices_…_unided_selected_block |
fails — Locator.click timeout on the same locator |
passes (renamed) |
test_coarse_pointer_resize_reach_… |
fails — covered ring | fails identically |
The first two are #395's fallout: fabBar.append(fab, fabMore, fabOptions) in composing/selection.js leaves no .lf-react-trigger under the bar. #395 updated the two test files it touched; these two cases sit in modules it did not, and both are nightly-only, so its gate never ran them.
On f8eb8d3e's rewrite of the margin case: :scope > .lf-response-options is a real child of fabBar and only visible under lf-response-open, and moving expect(bar).to_be_hidden() after the reaction press still asserts something the runtime reaches — reactHere calls showFab(null) once the send succeeds. The case keeps its subject, the receipt's coordinate assertion against the paragraph, unchanged. Module-level pytestmark = pytest.mark.nightly means the rename cannot change selection, and the old name is referenced nowhere.
The third failed once as a pass at 8cb5fb85 in my first sweep and then three times as a failure at the same commit, so that single green was the outlier, not the reds.
leaf-agent
left a comment
There was a problem hiding this comment.
The increment is #399's commit as it stands: tests/render_cases_layout.py and tests/CLAUDE.md are byte-identical to that branch, and the only differences in test_render_controls.py are this branch's own lf-pill → lf-chip rename around the new case. So #399 is not a sequencing call like #394 and #383 were — it has nothing left to land once this merges, and closing it is the tidy end.
The guard reads as a paint-order correction rather than another tolerance on the cover half: it ranks a holder that is already in the stepped-in stack, stops on any box that holds the control, and stops on a z-index named on the way up, so the only readings it removes are ones the page contradicts. Nothing else consumes the reading.
What I ran on the merged tree
tests/test_render_controls.pyandtests/test_render_conversations.py --run-nightly— 158 passed. Those two modules are the only consumers ofrings_drawn,ring_faultsandstanding_ring, and every existing population assertion for the reading passes beside the new one:..._still_sees_what_is_painted_over_a_ring,..._sees_a_neighbour_paint_over_a_ring_drawn_inside_its_box,..._names_every_way_a_box_can_draw_nothing_past_its_edge.- With
if (under) break;neutered, bothtest_the_ring_reading_passes_over_a_neighbour_the_control_paints_acrossandtest_coarse_pointer_resize_reach_stays_reachable_without_trapping_scrollgo red — the latter on exactly the cover the previous review measured,its bottom edge is under div.lf-receipt.lf-ui "✓ Sent just now" (ring 1,420,49,468 vs 24,466,367,494, sampled 25,467). So the guard is load-bearing, and the new case's first half is not passing on a reading gone quiet.
## Problem `ci` is red on `main` at bc373f0. The nightly suite's `tests/test_render_options_addition.py::test_the_add_field_previews_the_option_it_will_make` fails deterministically with `AssertionError: assert '6px' == '50%'` ([run 34121206216](https://github.com/max-sixty/leaf/actions/runs/34121206216), 1 failed / 2128 passed). #389 gave every ordinary action the shared 6px Button corner, and `.lf-compose-submit::before` moved from `border-radius: 50%` to `var(--r)` along with it. That PR updated the radius readings in the modules it touched — `test_render_anchors.py`, `test_render_conversations.py`, `test_render_reactions.py` — but this case lives in a nightly module the PR did not touch, so neither the everyday suite nor the PR's touched-module nightly run reached it. It first ran after main moved. ## Solution Read the add action's fill at the shared Button corner. The docstring's claim is that the action submits "rather than borrowing the selection mark's circle", so the fix also reads the single-choice group's mark — `#br-steel` in `#bracket`, which keeps its 50% circle under #389's rule that circles remain only where the geometry has its own meaning — pins it at `50%`, and asserts the action's corner differs from it. The claim is now pinned by the distinction it names rather than by a literal that goes stale the next time the shared token moves, and the docstring says which corner the action takes. The evaluate block's local name for the pseudo-element changes from `circle` to `fill`, since it is no longer a circle. The other `"50%"` readings in the suite are the margin Button family and circular status markers, which #389 deliberately kept round; they passed in the same run. ## Testing - `uv run pytest tests/test_render_options_addition.py -q -n0` — 5 passed (the failure reproduced on `main` first, at the same assertion). - `uv run pre-commit run --files tests/test_render_options_addition.py` — passed. --- Automated fix for [failed run](https://github.com/max-sixty/leaf/actions/runs/34121206216) --------- Co-authored-by: leaf-agent <[email protected]>
## Problem `ring_faults`'s cover half excuses a neighbour the control paints over by ranking the box that holds it: a box present at the stepped-in point and ranking below the control puts what it holds below the control too. That guard is already on `main` — this branch's first commit went in with #389's squash (`bc373f05:tests/render_cases_layout.py` is byte-identical to `0ff3041b`'s), so what is left here is the second commit alone. A holder's rank answers for what stays in its flow, and a positioned neighbour does not stay: it leaves its holder's place in the flow to paint in the positioned layer of the nearest ancestor stacking context. So a static holder ranking behind the control says nothing about the box it holds, and a `position: fixed` band inside one — topmost in the hit stack where the ring is sampled — is dropped without a word. `.lf-threads .lf-btn` computes `position: relative; z-index: auto`, so that is a cover the gate loses on a control the page draws. ## Solution Where the ranked holder is static, ask the control's own layer instead of the holder's position. A control that names a z-index above the layer a lifted neighbour paints in stands in front of it whatever holds it — the panel's edge grip is `position: absolute; z-index: 1`, so no `z-index: auto` neighbour reaches its ring. A control that names none shares the layer, and a neighbour lifted into it can stand over the ring, so the reading reports it. Where nothing was lifted, or the ranked holder is positioned too, the walk answers exactly as before. `test_the_ring_reading_sees_a_neighbour_lifted_out_of_the_flow_it_was_ranked_in` is the plant: a fixed band over the ring's top run of a thread card's button, held by a static box beside it. The grip's own plant gains the other side — the same band under a static holder reads as nothing, because the grip's `z-index: 1` stands over the layer it was lifted into. ## Testing - `test_the_ring_reading_sees_a_neighbour_lifted_out_of_the_flow_it_was_ranked_in` — red on `main`'s walk (`a band standing over the ring read as []`), green with this change. - The grip's third half — red if the condition reads the holder's `position` alone (`+ ['its left edge is under div "" ...']`), green with the control's layer in it. - `uv run pytest tests/test_render_controls.py tests/test_render_conversations.py --run-nightly` (159 passed): the two modules that read `rings_drawn` / `ring_faults`. - `uv run pytest tests` — 901 passed, 6 skipped. `uv run pre-commit run --files` on the three files. <details><summary>The paint orders this is written against</summary> `elementsFromPoint` at a point inside both the band and the control, front to back, with the band planted in each configuration the tests use: ``` grip (position: absolute; z-index: 1) band fixed, no z-index, in an absolute holder ['lf-ui lf-edge', 'probe-band', 'lf-under-plant', ...] grip in front band fixed, z-index: 2, in an absolute holder ['probe-band', 'lf-ui lf-edge', 'lf-under-plant', ...] band in front band fixed, no z-index, in a static box ['lf-ui lf-edge', 'probe-band', '', 'lf-under-plant'] grip in front .lf-threads .lf-btn (position: relative; z-index: auto) band fixed, no z-index, in an absolute holder ['probe-band', 'lf-under-plant', 'lf-btn ...', ...] band in front band fixed, no z-index, in a static box ['probe-band', '', 'lf-under-plant', 'lf-btn ...'] band in front ``` `wrap` changes which box the walk ranks; it does not change what the browser paints. The grip's z-index is what keeps every `z-index: auto` neighbour off its ring. </details> --- Automated fix for [failed run](https://github.com/max-sixty/leaf/actions/runs/34111296814) --------- Co-authored-by: leaf-agent <[email protected]>
Leaf had two competing shapes for ordinary controls: the shared rectangular Button face and page-local capsules. Compact status and metadata labels used the same capsule geometry, so shape did not reliably distinguish actions from state. This change gives every ordinary action the shared 6px Button corner, whether it uses text or only an icon. Send, Resolve, Close, reaction overflow, attachment removal, and the floating response field now belong to that rectangular family. Compact state, value, and reaction labels use filled 3px chips. Circles remain only where the geometry has its own meaning: the document-margin Button family and circular status or selection markers. The change also removes the `lf-pill` vocabulary throughout the runtime, packages, examples, tests, and generated MCP App. Keyboard focus reveals a margin Button's label immediately, avoiding a paint-only tooltip transition that could be restarted while the living margin settled. The interaction gallery keeps contained preview frames out of the rendered page until they are ready, so initialization cannot interrupt outer-page focus while the fixed stage preserves layout. The deeper runtime repaint repair in [#394](#394) and the contained-frame focus/export boundary in [#383](#383) have both landed and are merged into this branch. This PR owns the reader-facing presentation. The landing-page stills and GIF were re-recorded from the shipped runtime, and their content-addressed product-page references now point to those images. The branch also carries the paint-order correction from [#399](#399), so the nightly ring check distinguishes content underneath an outlined control from content covering that control. Local checks passed: pre-commit; 907 everyday tests; focused controls/margin, interaction-gallery, option/chip, conversation, and site modules; an eight-case pass covering the changed embedded action faces; the selected-reaction nightly; both coarse-pointer paint-order cases; the seven product-page tests; and the complete 35-page site build. > _This was written by Codex on behalf of max-sixty_ --------- Co-authored-by: leaf-agent <[email protected]>
## Problem `ci` is red on `main` at bc373f0. The nightly suite's `tests/test_render_options_addition.py::test_the_add_field_previews_the_option_it_will_make` fails deterministically with `AssertionError: assert '6px' == '50%'` ([run 34121206216](https://github.com/max-sixty/leaf/actions/runs/34121206216), 1 failed / 2128 passed). #389 gave every ordinary action the shared 6px Button corner, and `.lf-compose-submit::before` moved from `border-radius: 50%` to `var(--r)` along with it. That PR updated the radius readings in the modules it touched — `test_render_anchors.py`, `test_render_conversations.py`, `test_render_reactions.py` — but this case lives in a nightly module the PR did not touch, so neither the everyday suite nor the PR's touched-module nightly run reached it. It first ran after main moved. ## Solution Read the add action's fill at the shared Button corner. The docstring's claim is that the action submits "rather than borrowing the selection mark's circle", so the fix also reads the single-choice group's mark — `#br-steel` in `#bracket`, which keeps its 50% circle under #389's rule that circles remain only where the geometry has its own meaning — pins it at `50%`, and asserts the action's corner differs from it. The claim is now pinned by the distinction it names rather than by a literal that goes stale the next time the shared token moves, and the docstring says which corner the action takes. The evaluate block's local name for the pseudo-element changes from `circle` to `fill`, since it is no longer a circle. The other `"50%"` readings in the suite are the margin Button family and circular status markers, which #389 deliberately kept round; they passed in the same run. ## Testing - `uv run pytest tests/test_render_options_addition.py -q -n0` — 5 passed (the failure reproduced on `main` first, at the same assertion). - `uv run pre-commit run --files tests/test_render_options_addition.py` — passed. --- Automated fix for [failed run](https://github.com/max-sixty/leaf/actions/runs/34121206216) --------- Co-authored-by: leaf-agent <[email protected]>
## Problem `ring_faults`'s cover half excuses a neighbour the control paints over by ranking the box that holds it: a box present at the stepped-in point and ranking below the control puts what it holds below the control too. That guard is already on `main` — this branch's first commit went in with #389's squash (`bc373f05:tests/render_cases_layout.py` is byte-identical to `0ff3041b`'s), so what is left here is the second commit alone. A holder's rank answers for what stays in its flow, and a positioned neighbour does not stay: it leaves its holder's place in the flow to paint in the positioned layer of the nearest ancestor stacking context. So a static holder ranking behind the control says nothing about the box it holds, and a `position: fixed` band inside one — topmost in the hit stack where the ring is sampled — is dropped without a word. `.lf-threads .lf-btn` computes `position: relative; z-index: auto`, so that is a cover the gate loses on a control the page draws. ## Solution Where the ranked holder is static, ask the control's own layer instead of the holder's position. A control that names a z-index above the layer a lifted neighbour paints in stands in front of it whatever holds it — the panel's edge grip is `position: absolute; z-index: 1`, so no `z-index: auto` neighbour reaches its ring. A control that names none shares the layer, and a neighbour lifted into it can stand over the ring, so the reading reports it. Where nothing was lifted, or the ranked holder is positioned too, the walk answers exactly as before. `test_the_ring_reading_sees_a_neighbour_lifted_out_of_the_flow_it_was_ranked_in` is the plant: a fixed band over the ring's top run of a thread card's button, held by a static box beside it. The grip's own plant gains the other side — the same band under a static holder reads as nothing, because the grip's `z-index: 1` stands over the layer it was lifted into. ## Testing - `test_the_ring_reading_sees_a_neighbour_lifted_out_of_the_flow_it_was_ranked_in` — red on `main`'s walk (`a band standing over the ring read as []`), green with this change. - The grip's third half — red if the condition reads the holder's `position` alone (`+ ['its left edge is under div "" ...']`), green with the control's layer in it. - `uv run pytest tests/test_render_controls.py tests/test_render_conversations.py --run-nightly` (159 passed): the two modules that read `rings_drawn` / `ring_faults`. - `uv run pytest tests` — 901 passed, 6 skipped. `uv run pre-commit run --files` on the three files. <details><summary>The paint orders this is written against</summary> `elementsFromPoint` at a point inside both the band and the control, front to back, with the band planted in each configuration the tests use: ``` grip (position: absolute; z-index: 1) band fixed, no z-index, in an absolute holder ['lf-ui lf-edge', 'probe-band', 'lf-under-plant', ...] grip in front band fixed, z-index: 2, in an absolute holder ['probe-band', 'lf-ui lf-edge', 'lf-under-plant', ...] band in front band fixed, no z-index, in a static box ['lf-ui lf-edge', 'probe-band', '', 'lf-under-plant'] grip in front .lf-threads .lf-btn (position: relative; z-index: auto) band fixed, no z-index, in an absolute holder ['probe-band', 'lf-under-plant', 'lf-btn ...', ...] band in front band fixed, no z-index, in a static box ['probe-band', '', 'lf-under-plant', 'lf-btn ...'] band in front ``` `wrap` changes which box the walk ranks; it does not change what the browser paints. The grip's z-index is what keeps every `z-index: auto` neighbour off its ring. </details> --- Automated fix for [failed run](https://github.com/max-sixty/leaf/actions/runs/34111296814) --------- Co-authored-by: leaf-agent <[email protected]>
Leaf had two competing shapes for ordinary controls: the shared rectangular Button face and page-local capsules. Compact status and metadata labels used the same capsule geometry, so shape did not reliably distinguish actions from state.
This change gives every ordinary action the shared 6px Button corner, whether it uses text or only an icon. Send, Resolve, Close, reaction overflow, attachment removal, and the floating response field now belong to that rectangular family. Compact state, value, and reaction labels use filled 3px chips. Circles remain only where the geometry has its own meaning: the document-margin Button family and circular status or selection markers. The change also removes the
lf-pillvocabulary throughout the runtime, packages, examples, tests, and generated MCP App.Keyboard focus reveals a margin Button's label immediately, avoiding a paint-only tooltip transition that could be restarted while the living margin settled. The interaction gallery keeps contained preview frames out of the rendered page until they are ready, so initialization cannot interrupt outer-page focus while the fixed stage preserves layout. The deeper runtime repaint repair in #394 and the contained-frame focus/export boundary in #383 have both landed and are merged into this branch. This PR owns the reader-facing presentation.
The landing-page stills and GIF were re-recorded from the shipped runtime, and their content-addressed product-page references now point to those images.
The branch also carries the paint-order correction from #399, so the nightly ring check distinguishes content underneath an outlined control from content covering that control.
Local checks passed: pre-commit; 907 everyday tests; focused controls/margin, interaction-gallery, option/chip, conversation, and site modules; an eight-case pass covering the changed embedded action faces; the selected-reaction nightly; both coarse-pointer paint-order cases; the seven product-page tests; and the complete 35-page site build.