Skip to content

Refine Go-to hints and banner shortcuts - #388

Merged
max-sixty merged 20 commits into
mainfrom
codex/filter-go-to-targets
Sep 7, 2026
Merged

max-sixty merged 20 commits into
mainfrom
codex/filter-go-to-targets

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 7, 2026 •

Copy link
Copy Markdown
Owner

The Go-to overlay now leaves repeated chord context off generated target hints, so each page target shows only the suffix the reader still needs to press. Stable global destinations instead expose their complete g chords directly on the banner controls, and the chord disappears when character shortcuts are disabled.

Tests cover suffix-only hint rendering, banner chord projection—including folded controls—and shortcut preferences.

This was written by Codex on behalf of max-sixty

Show stable Go-to chords on banner controls, leave generated target hints focused on their remaining suffix, and preserve parent-page focus while gallery frames load.
# Conflicts:
#	skills/leaf/assets/runtime/interaction-gallery.js

@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.

Three things on this one, one of them with a one-click fix inline.

The gallery half is a second fix for the defect #383 is already fixing, and the weaker of the two. #383 stops a contained page from placing focus at all — containedPage gates letGo()/restoreArrangements() in leaf.js, so the frame never becomes activeElement — and wraps every call into a frame so the reader's own element comes back afterwards. keepReaderOutsideFrames instead watches on requestAnimationFrame and blurs after the fact, which leaves two gaps the comment's claim ("the reader's next page-level shortcut stays in the parent document throughout startup") doesn't hold across: a key pressed in the frame between the steal and the next animation frame still reaches the contained document, and active.blur() puts the reader on <body> rather than back on whatever they were standing on — so a reader who pressed a banner control while the frames were arriving still loses their place. The new assertion in test_the_feature_gallery_exercises_core_reader_workflows reads focus at a point in time, so it inherits that same window; per tests/CLAUDE.md under State races are arrangements, not probabilities, that is the shape that reddens main on a loaded runner. Both PRs edit interaction-gallery.js and will conflict — worth dropping the gallery half here and letting #383 carry it, or rebasing onto it.

A folded banner control silently loses its chord. chrome.js mounts the shelf as a sibling of the banner (chromeRoot.append(banner, overflowMenu, …)), so .lf-banner [data-lf-chord]::after stops matching the moment foldShelf moves an address into overflowMenu — the attribute is still there, the chord just isn't drawn. That contradicts what banner-shelf.js states about the fold: "a folded address keeps its accessible name, its state paint, its title, its press and its own page key: nothing about it changes except where it stands." Since data-lf-chord is only ever set on the five GO destinations, dropping .lf-banner from the selector (the @scope (.lf-chrome) root already bounds it) would keep the chord with the control wherever the fold puts it.

One note on the inline suggestion: it changes the computed content string, so the assertion at tests/test_render_navigation.py comparing getComputedStyle(el, '::after').content to "g M" needs to become "g M" / "" alongside it.

Comment thread skills/leaf/assets/runtime/chrome.css Resolved
Keep shortcut text visible when banner controls fold, hide it from accessible names, and leave interaction-gallery focus handling to the dedicated fix.

@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.

Both earlier points are addressed — the gallery half is gone and the folded control keeps its chord, with the alternative-text form keeping the accessible name. The two new tests that prove those (test_a_phone_banner_folds_its_addresses_into_one_menu, test_character_shortcuts_can_be_turned_off_without_losing_the_keyboard) both pass.

The chord is drawn in the row's flow, and the banner's width contract does not cover it. reserve() measures each banner control's widest possible label and pins that as min-width — a ::after is generated content, so the measured box does include the chord, but only when data-lf-chord is already on the element. reserveBannerControls() runs at chrome mount (chrome.js, the reserveBannerControls() call in the mount path) and thereafter only when the covering breakpoint flips (banner.js, if (reservedCovering !== covering().matches)); paintCoreControls() paints the attribute later. So every chord-bearing control ends up reserve + chord wide, its width moves whenever its label or the chord's liveness changes, and the reservation is history-dependent besides — cross 900px once and it is re-measured with the chord, so the same control reserves two different widths depending on where the reader has been.

That is what CI is red on. Five banner-geometry tests that pass on main fail here, and each names the invariant the chord broke rather than a flake:

  • test_the_banner_opens_a_panel_of_the_machines_leaves — 'All leaves (999)' grew the button 141px -> 159px: its reserve list no longer names the widest label renderOthers writes. 18px is margin-inline-start: 7px plus g L.
  • test_the_poll_leaves_the_banner_where_it_was — Threads (9) grew 9px on the tenth comment and slid five neighbours left by 9, which is exactly the thing that test's docstring says the reservation exists to prevent.
  • test_the_banner_uses_the_page_mark_and_puts_each_edge_by_its_panel — .lf-banner-actions > .lf-others resolves to 0 elements; the extra width pushed it behind the fold at a width that held it on main.
  • test_workspaces_replace_each_other_and_name_the_open_one[500] — .lf-asks is in the row but not visible, same cause at 500px.
  • test_the_responsive_action_row_keeps_primary_actions_in_reach — wide=[130, 161], phone=[141, 153].

The everyday suite is green, so wt merge would land this: only CI's "Nightly cases this pull request touches" step reaches these. The seam is that the row's contract is one reservation per control, from the widest label it can ever say, and a chord is neither a label nor stable — it appears and disappears with live(row) && bindings(row).length. Either it joins the reservation (measured with the attribute present, renewed wherever liveness adds or removes it) or it stays out of the row's flow and is drawn only where nothing is reserved, which the folded menu and the key line already are.

The two other failures in that run, neither attributable here
  • test_the_feature_gallery_exercises_core_reader_workflows — passed on main, fails here at expect(approve).to_have_text("Approve version") after z, but the test is byte-identical to main's (this branch reverted its own edit to it). The shape matches the frame stealing the page's keyboard focus, which is #383's defect rather than this one's.
  • test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus — pageSettled timeout; also failed on main's run, so pre-existing.

Compared against main's most recent completed ci run at the time of writing, 14c746ba, where all five banner tests above passed.

max-sixty and others added 5 commits September 7, 2026 01:53
Target tracing paints in a page-level overlay, while transient margin
labels were trapped inside the rail's lower stacking context. Raise only
the hovered or keyboard-focused margin item above page paint, leaving
the rest of the toolbar at its normal layer.

Add a browser regression that compares the label with and without the
crossing trace, so any overlay pixels painted through its opaque center
fail the test.

Tested with `uv run pytest tests -q` (907 passed).

> _This was written by Codex on behalf of @max-sixty_
@leaf-agent

Copy link
Copy Markdown
Collaborator

The approval stands. This is a follow-up on the red test check at the approved head, which is not this PR's — and on a gap in what that check actually covered.

The one failure is pre-existing on main. test_the_feature_gallery_exercises_core_reader_workflows fails here at tests/test_render_navigation.py:237 — expect(approve).to_have_text("Approve version") after z — and fails identically on main at e6adf0b2: same line, same assertion, same ✓ Version approved. The test is byte-identical to main's; this branch does not touch it. It passed on main at 14c746ba and fails at e6adf0b2, so it entered somewhere in that window, where 821e0d5b ("Fix interaction gallery startup", #378) is the commit that changes when a contained gallery page becomes ready. That also corrects my earlier note on this PR, which said the test passed on main — true against 14c746ba when I wrote it, not true now, so #383 is the wrong place to look for it.

CI stopped covering the regressions I flagged last time. The nightly step runs the cases in the test modules the PR touches. At 0159ddf this branch touched tests/test_render_controls.py and tests/test_render_aim.py, so that step ran them and caught the five banner-geometry failures. At df2eb80 it touches only tests/test_render_navigation.py, so both modules dropped out of the set and those five tests were never re-run — the green-but-one result at this head does not by itself show them fixed.

They are fixed. I ran them on the merged tree: the five banner-geometry tests pass, and so do all nightly cases in both dropped modules (133 passed). Absolutely positioning the chord in chrome.css takes the generated content out of the row's flow, so the inline width reserve() measured is unchanged — the second of the two routes I named last time, and it holds.

The part worth keeping is the gate shape rather than this outcome: a change to banner control geometry escapes the banner-geometry nightly cases whenever it stops editing that module, which is the combination that put five failures on the previous head. A nightly case in test_render_controls.py asserting the chord leaves a control's reserved width alone would pin the fix and keep the module in the touched set.

Evidence

Failure on main, run 34099278011 at e6adf0b2:

>       expect(approve).to_have_text("Approve version")
E       AssertionError: Locator expected to have text 'Approve version'
E       Actual value: ✓ Version approved
/home/runner/work/leaf/leaf/tests/test_render_navigation.py:237: AssertionError

Same test PASSED in run 34094193440 at 14c746ba. Commits in between: 821e0d5b, c4f1b481, f873d5aa, 8cb5fb85, e6adf0b2.

Touched test modules by head, against base 8de0b9ac:

0159ddf  tests/test_render_aim.py  tests/test_render_controls.py  tests/test_render_navigation.py
df2eb80  tests/test_render_navigation.py

This PR's run 34104969380 nightly step collected only tests/test_render_navigation.py (1 failed, 89 passed).

Run locally on the refs/pull/388/merge tree:

pytest tests/test_render_controls.py -m nightly -k "<the five>"   ->  6 passed
pytest tests/test_render_controls.py tests/test_render_aim.py -m nightly  ->  133 passed

leaf-agent and others added 8 commits September 7, 2026 08:49
…frame (#394)

## Problem

`ci` on main failed on [run
34084018735](https://github.com/max-sixty/leaf/actions/runs/34084018735)
with 19 nightly failures. Most of them are the interaction gallery's
contained frames taking the page's focus, which #383 fixes, and the
reaction readings #371 retired, which landed as #385. Two survive on
today's main (`e6adf0b2`) and neither is covered by either.


`test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus`
times out waiting for `pageSettled`, because the corpus never settles
once the ring walk stands on a control in a docked margin cluster:
`layoutMarginRows` floats that cluster out of static flow to read where
it can hang and docks it back, a document tree has one focus, so the
move blurs the control and the restore focuses it again — and
`keyboard/dispatch.js` answers that pair by painting the standing
chrome. That paint's layout asks for the next placement, so the page
laid its margin out, rebuilt its whole key line and refolded its banner
row on every frame for as long as the reader stood there. This is the
second time this cycle has closed on a different edge; #298 cut the
`dockSeats` one.

#373 cuts the other edge of this same loop, and has the same ring test
green: it keeps a docked row docked while the room it answered about
holds, so `moveHost` is never reached in the case that loops. The two
compose rather than compete — that one removes a caller's reason to move
the host, this one stops any placement move from painting the standing
chrome, so it also holds for the callers it does not touch (`float`, the
inline `target.after`, and both branches of the Page-map render). Either
can land alone and fixes the failing run; landing both is deliberate
belt-and-braces, and neither is based on the other.

`test_a_reload_mid_flight_never_wedges_round_trip` waits the corpus's
whole answer-all cascade out inside one 30-second budget, and the corpus
gained an ask in #354. The fact under test — that a ledger carried
across a navigation does not wedge the new document — has already
settled on that document's first trip.

## Solution

`runtime.placingChrome` says a chrome placement is in flight, `moveHost`
raises it around the move and the focus it hands straight back, and the
focus painters skip while it stands. `moveHost` asks for the paint
itself in the one case the placement really did move the reader: the
control they were standing on did not survive it. The flag lives in
`context.js` rather than beside `living-margin.js`'s existing
`settlingOptionsFocus` because what has to know is every reader of where
the reader stands, not just the options state machine.

The gate test now waits for the new document's first trip rather than
for its whole cascade, so the reading stops tracking how many asks the
corpus happens to carry. It waits on the press's own attempt leaving the
outbox's `pending`, which is delivery with retries folded in: `acked` is
counted in a `finally` around the fetch, so a post that throws counts
one and is retried, and an empty `pending` is only the momentary gap
between the cascade's trips.

## Testing

-
`test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus`:
red on `e6adf0b2`, green with this change. It is the gate — I could not
reduce the cycle to a small fixture, and dropped a candidate regression
test that passed with the change reverted rather than land coverage that
says nothing.
- `test_a_reload_mid_flight_never_wedges_round_trip`: red under `-n4` on
`e6adf0b2`, green with this change. Its new reading still fails on a
wedged first trip: with `/api/event` aborted on the reloaded document it
gives up on `sends=16 acked=16 pending=1`, the shape `acked > 0` would
have gone green on.
- `uv run pre-commit run --all-files`.
- The full `--run-nightly` run promised when this opened never got
posted — that session ended before it finished. CI runs the nightly
cases of `tests/test_render_gate.py` on this PR, the module it touches;
the rest of the nightly suite the runtime change drives runs after main
moves.

<details><summary>How the cycle was found</summary>

At the failing wait, `moving()` reported three running transitions on
one `.lf-margin-button-label`, restarting continuously. A document-wide
`MutationObserver` over one second on that page showed the whole chrome
rebuilding at frame rate with nothing dispatched: 125 `lf-key` inserts
and 125 removals, 52 `.lf-btn.lf-others` moves between
`lf-banner-actions` and `lf-banner-menu`, 50 same-value `style` writes
on `nav.lf-living-margin`, and 25 moves of one
`.lf-margin-item.lf-docked` between `MAIN` and its `SECTION`.

A stack captured inside a `focusout` listener named the mover:

```
at /runtime/living-margin.js:2073 | at moveHost (/runtime/living-margin.js:2379)
  | at moveExternalHost (/runtime/living-margin.js:2073) | at Object.float (/runtime/living-margin.js:1644)
```

with a second identical one from `Object.dock`, 50 focusouts per second
between them, and `requestAnimationFrame` stacks from `paintHere` and
from `layoutMarginRows`'s dispatch at 25 per second each.

</details>

---
Automated fix for [failed
run](https://github.com/max-sixty/leaf/actions/runs/34084018735)

---------

Co-authored-by: leaf-agent <[email protected]>
…us and its exported copy (#383)

## Problem

The nightly leg of [`ci` on
`edd1c5a`](https://github.com/max-sixty/leaf/actions/runs/34083084673)
went red on 17 readings. All but two came from one cause, and every one
of them reproduces deterministically on that commit and on today's
`main`.

#354 gave the interaction gallery three contained frames, and each of
them runs a whole second Leaf page. A Leaf page arrives:
`restoreArrangements()` puts back the workspace this reader last had
open, and `letGo()` puts them on the page's own body. Both run inside
the frame, and a document has one focus — so `document.activeElement`
out on the gallery became the `<iframe>`, and whatever the reader was
holding was let go of. That is what closed the crowded margin cluster
mid-test, dropped every `.lf-target-hint` on the corpus, and took
`#bg-choice-ask` off its focus.

The export half is separate and had been masked by the reading in front
of it: the frame's `srcdoc` names the runtime, the theme, and the
gallery adapter on a server a standalone file has not got, so an
exported copy opened with four CORS failures. Its `<kbd>` chord caption
was authored hidden, so the copy also held words with no script left to
reveal them.

## Solution

`data-lf-contained` marks both sides of the boundary — the frame element
out in the gallery and the body of the page inside it. A contained page
arrives restoring no arrangement and placing no focus, and the bake
drops a contained frame with the scripts. The chord caption now lives
with its own visibility rather than in authored markup. On a page that
is not contained nothing changes: every guard reads a constant that is
false there.

Arrival is only half of it. The framed chrome still places focus once a
replay runs it — a shown `<dialog>` runs the browser's focusing steps
whatever the page around it wants. So the frame's body is written
`inert` beside the mark: an inert subject ends those steps before they
reach anything, so the focus never crosses the boundary and there is
nothing to hand back. The replays are unaffected, because they drive
that chrome through the adapter rather than by pointing at it. Measured
on the `Open and close Threads` tab: without the line the reader loses
the tab they just pressed the moment the framed panel opens, and `g T`
and `w` then reach a document they cannot see.

`inert` is the same one-line fix #393 carries, arrived at from the other
side. The two conflict textually — both write it into
`loadFrameDocument` on the line this branch marks the body on — and
resolving either way is taking one copy of the line.

`test_a_contained_replay_leaves_the_page_around_it_standing` pins both
halves: it fails on `main` with `assert 'IFRAME' != 'IFRAME'` at
arrival, and on the arrival fix alone at the replay, where the reader is
no longer standing on the tab they pressed.

Two readings are restated rather than repaired, because the gallery
really did change: its swipe specimen sits in an unselected tab, so one
margin row is withheld and the posture clear runs for it. (The Ask count
13 → 14 landed separately in #376.)

<details><summary>The 17 readings, and what each was</summary>

Focus taken by a frame — 14:
`test_the_feature_gallery_keeps_its_real_actions_reachable[1440/1200/700/390]`,
`test_ask_addresses_follow_the_feature_gallery_s_visible_margin_controls[1200/390]`,
`test_margin_target_hover_requires_pointer_movement`,
`test_a_workspace_lands_one_responsive_layout_and_carries_the_column_to_it[1440/1600]`,
`test_selection_hints_do_not_name_page_content_behind_a_covering_panel`,
`test_a_shipped_log_opens_its_example_on_a_live_thread`,
`test_other_responses_can_turn_the_compact_field_into_a_suggestion`, and
both `test_an_exported_page_fixture_stands_on_its_own` cases, which
failed on the caption before they could reach the CORS errors.

Restated:
`test_an_unchanged_heartbeat_restates_no_margin_name[gallery]`,
`test_the_feature_gallery_exercises_the_injected_core_surfaces`.

**Not this branch's**:
`test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus`
fails the same way on `06daeef3`, one commit before #354 — `pageSettled`
never becomes true in the response bar of `ship-review`. It took [run
34079766897](https://github.com/max-sixty/leaf/actions/runs/34079766897)
down too, so it is a red `main` of its own and I am carrying it
separately.

</details>

## Testing

`uv run pytest tests` (899 passed), and the complete nightly modules the
change reaches: `test_render_margin.py`, `test_render_navigation.py`,
`test_render_export.py`, `test_render_semantic_selection.py`,
`test_render_pages.py`, `test_render_widgets.py`, `test_site.py` — all
green. The new test was checked against a tree with the two runtime
guards reverted, where it fails.

For the focus half added since: `test_site.py` (31 passed), and every
gallery, contained-frame, export, standalone, accessibility and drawing
reading in the suite (130 passed), plus `test_render_margin.py` whole
and the two readings elsewhere this branch clears (83 passed). With the
`inert` line alone removed, the contained-replay reading fails on the
tab losing focus.

## One flake carried too

`test_unchanged_margin_refresh_cost_is_bounded_by_refresh_count` took
this branch's first CI run down at `LayoutCount: 29` against a bound of
20, and it does the same on `6b77b0a9` with none of this branch on it —
once in six runs there, once in seven here. The corpus carries the
gallery's contained frames, and a frame still arriving lays itself out
in the measured page's own process, which counted against five
dispatches that touch nothing reads as the heartbeat forcing layout.
Both corpus cost measurements — that one and
`test_margin_layout_batches_the_composed_page_without_refolding_controls`,
which measures the same page the same way — now wait for the frames to
be ready before opening the CDP session: fourteen runs green after,
where it failed twice in thirteen before.

## What this does not clear

One reading on `main` is still red and is not this branch's:
`test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus`,
which I re-ran on this tree after #385 landed. It is tracked in #396,
where the two possible repairs are written out — both are a product
decision rather than a mechanical one.

<details><summary>What it looks like</summary>

The walk hangs on `pageSettled` in the response bar of `ship-review`:
three transitions on one reaction chip's `.lf-margin-button-label` —
opacity, transform, visibility, the label reveal — restart before they
finish, indefinitely. `startTime` moves forward and `currentTime` goes
back to 0 between two samples a second apart. Last green on
[`934bfc4c`](https://github.com/max-sixty/leaf/actions/runs/34077249270);
red from `06daeef3` (#365), which is what made a reaction a margin
button with a label.

The other readings that were red beside it have since been repaired on
`main` and pass here: the three `test_render_reactions.py` cases went
with #385, and
`test_render_gate.py::test_a_reload_mid_flight_never_wedges_round_trip`
passes on this tree.

</details>

## Rebuilt on #378

#378 landed while this was open and rebuilt the contained page without
`srcdoc`. The mark and the `inert` write both go on the document
`loadFrameDocument` writes, and the frame element carries the mark
beside it. `main` is merged in and the branch is green: `uv run pytest
tests` (901 passed), and `test_site.py` and `test_render_margin.py`
complete under `--run-nightly` (112 passed).

---
Automated fix for [failed
run](https://github.com/max-sixty/leaf/actions/runs/34083084673)

---------

Co-authored-by: leaf-agent <[email protected]>
## Summary

- keep the anchored Comment field mounted while More reveals Suggest and
the declared reactions
- preserve the field's draft, focus path, and horizontal position while
actions expand inline or wrap below, then re-anchor safely if the
viewport changes
- keep item and message reaction surfaces independent, with keyboard
access for the local response group and native digit entry in its field

## Testing

- `uv run pytest tests` (907 passed)
- `uv run pre-commit run --all-files`
- `./bin/leaf version check .tmp/previews/review --render`
- focused browser journeys at 390px and 1280px, including field digit
entry and a live resize to 500px, plus a composed light/dark UI sweep

> _This was written by Codex on behalf of max-sixty_
## Problem

[`ci` on
main](https://github.com/max-sixty/leaf/actions/runs/34104687695) failed
on `6d4860a3` with 13 nightly failures. Twelve of them are the
interaction gallery's contained frames taking the page's focus and its
exported copy, which #383 fixed; that landed as `6b07467f` after this
run started, and all twelve pass there unchanged. The thirteenth
survives, on `6b07467f` and on today's `51f286ae` alike.


`test_render_conversations.py::test_a_coined_class_cannot_reach_the_chromes_rules`
fails deterministically, with `lf-living-margin` extra in the pinned
authored-theme ledger. #390 (`5b503dd7`) added `.lf-living-margin {
z-index: auto; }` inside `chrome.css`'s `@scope (.lf-chrome)` block, so
the class became one the runtime sheet names *and* the authored theme
dresses at document level — the test's `themed` category, whose ledger
did not yet name it. That PR touched `chrome.css` and
`test_render_aim.py`, so its own nightly leg ran `test_render_aim.py`'s
cases rather than this module, and its run on main was cancelled by the
next push, which is why the reading first surfaced a commit later.

## Solution

Widen the ledger, which is what the assertion asks for by name.
`lf-living-margin` belongs in it by the category's own rule: the rail is
chrome, the authored theme owns its whole document face — placement, the
hidden state, and the container widths that fold it away — and the
runtime sheet names it only to say which plane it stands on. So the
movement its document-level rule would cause on the probe element is
that deliberate face rather than a leaked scoped rule, which is exactly
what the exception exists to hold out of the collision probe.

Nothing in the product is wrong here: the adopted chrome sheet's
`z-index: auto` is the plane rule #390 wanted, and it still reaches the
rail.

## Testing

- `test_a_coined_class_cannot_reach_the_chromes_rules`: red on
`6b07467f` and on `51f286ae`, green with this change.
- The run's other twelve failures: all green on `6b07467f` with no
change, confirming they were #383's.
- `uv run pytest tests/test_render_conversations.py` on `51f286ae` — 75
passed.
- `uv run pytest tests` on `51f286ae` — 901 passed, 6 skipped.
- `uv run pre-commit run --files tests/test_render_conversations.py`.

<details><summary>The failing reading</summary>

```
FAILED tests/test_render_conversations.py::test_a_coined_class_cannot_reach_the_chromes_rules
  - AssertionError: the authored-theme class surface changed: widen the exception on purpose
  Extra items in the left set:
  'lf-living-margin'
```

`themed` is the set of classes the runtime sheet names inside its
`@scope` block that no document-level rule of *its own* names, but that
some other sheet dresses at document level. Before `5b503dd7` the rail's
class was only ever theme.css's, so it was never scoped and never
reached this set.

</details>

---
Automated fix for [failed
run](https://github.com/max-sixty/leaf/actions/runs/34104687695)

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]>
@max-sixty
max-sixty merged commit 2ab2515 into main Sep 7, 2026
4 checks passed
@max-sixty
max-sixty deleted the codex/filter-go-to-targets branch September 7, 2026 16:20
max-sixty added a commit that referenced this pull request Sep 7, 2026
The Go-to overlay now leaves repeated chord context off generated target
hints, so each page target shows only the suffix the reader still needs
to press. Stable global destinations instead expose their complete `g`
chords directly on the banner controls, and the chord disappears when
character shortcuts are disabled.

Tests cover suffix-only hint rendering, banner chord
projection—including folded controls—and shortcut preferences.

> _This was written by Codex on behalf of max-sixty_

---------

Co-authored-by: leaf-agent <[email protected]>
Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Sep 7, 2026
Two conflicts, both import lists, and one thing worth recording.

`composing/selection.js`: main's #395 added `keeps`; this branch had extended
the module's docstring for the kept-draft address. Both.

`keyboard/page.js`: main's #388 added five response-option imports and kept
`pendingDrawing`; this branch had replaced `pendingDrawing` with `composerHolds`,
the single reading of whether the box holds anything a reader would miss. The
union, less `pendingDrawing`, which no longer has a use in the file.

Main's #399 ("Report a ring cover from a neighbour that left its holder's flow")
lands in the same ring reading this branch changed, and the two compose rather
than duplicate: theirs answers a neighbour out of its holder's flow, this one
answers a control painting in front of the box reported over its ring. Both
excuse only what they demonstrate.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
max-sixty pushed a commit that referenced this pull request Sep 7, 2026
… the heartbeat (#407)

Four nightly cases in `tests/test_render_margin.py` have been red on
`main` since [#388](#388) landed,
first reported by the nightly leg of [run
34143535066](https://github.com/max-sixty/leaf/actions/runs/34143535066)
and still failing at `main`'s head. Both failures come from the banner
chord that PR added: it gave the Page-map, Threads, Asks and version
controls a `control` row, and `paintCoreControls` began writing a
`title` and a `data-lf-chord` on each of them.

**The chord's band does not fit a touch aim.**
[`[data-lf-chord]`](https://github.com/max-sixty/leaf/blob/7592d9f5bc15b5e7c269f18a8d4025c17fe9dab6/skills/leaf/assets/runtime/chrome.css#L983)
reserves its second line as `padding-block: 3px 14px`. On the wide row
that band is the button's own height and every control on the row
carries a chord, so the row still reads level. On the compact shelf the
controls sit at a `min-height` of forty pixels and the band comes out of
that aim: at 390px the words of `Map (3)`, `Threads (1)` and `v1 ▾` sat
6.5px from the top of their box and 17.5px from the bottom, while the
`⋯` door beside them stayed centred — the row 2659732 centred and
pinned. The compact block now states the row's whole box, both axes, so
the shared Button's band is what every control keeps, and drops the hint
there. The destination is still reachable by its chord, which the key
line, the `?` reference and the control's title all go on saying, and a
control the shelf folds away still carries its second line into the
menu, where a full-width row has the height for it.

**A paint bound to the heartbeat has to say nothing when nothing
changed.** `paintCoreControls` wrote `control.title` and
`control.dataset.lfChord` unconditionally, and it runs inside the
standing-chrome frame the `lf-actions` heartbeat asks for every two
seconds. On a page nobody has touched that restated the Page-map
button's title and chord every pass — the mutation stream a screen
reader rebuilds its buffer from, which is exactly what
`test_an_unchanged_heartbeat_restates_no_margin_name` watches for. The
pass now writes through `widget-elements.js`'s `keeps`, whose own
comment states this rule, so the fix covers every control the pass
reaches rather than the one the test happened to see; the same guard
goes on `helpClose` and the latest-version chip, which restated on the
same schedule out of the margin's watch.

## Verification

Run against this branch on Linux with the repository's browser setup:

- the four reported cases pass:
`test_an_unchanged_heartbeat_restates_no_margin_name[corpus,gallery]`
and
`test_the_small_screen_map_is_a_complete_accessible_sheet[keyboard,pointer]`;
- `tests/test_render_margin.py`, `tests/test_render_navigation.py`
(which owns #388's chord-projection cases, including the folded control)
and `tests/test_render_controls.py` under `--run-nightly`, and the
everyday `uv run pytest tests` — all green apart from the pre-existing
case named below;
- measured at 390px after the change, every visible control on the shelf
is centred (`⋯` 11.84/12.16, `Map (3)`, `v1 ▾` and `Threads (1)` 12/12),
and at 1440px the three banner controls keep their chord line (`g A`, `g
V`, `g T`) — as does a control folded into the compact menu.


`test_the_margin_groups_meanings_at_one_destination_without_moving_the_page`
is red at `main`'s head for a separate cause and is untouched here: it
fails identically (`1349 == 1353 ± 1`) in a worktree at 3e92434, the
merge base of the run this PR answers, so it is not this branch's.

<details><summary>Failure as reported</summary>

```
FAILED tests/test_render_margin.py::test_the_small_screen_map_is_a_complete_accessible_sheet[pointer]
AssertionError: Map (3) is not vertically centred in the compact banner: {'label': 'Map (3)', 'above': 6.5, 'below': 17.5}

FAILED tests/test_render_margin.py::test_an_unchanged_heartbeat_restates_no_margin_name[corpus]
AssertionError: [{'on': 'lf-btn lf-page-map-toggle', 'wrote': 'title', 'said': 'Open the page map (g M)', 'probe': None},
                 {'on': 'lf-btn lf-page-map-toggle', 'wrote': 'data-lf-chord', 'said': 'g M', 'probe': None}, ...]
```

Both are nightly cases in a module #388 did not touch, so the
pull-request leg never ran them and the failure first appeared in the
nightly run after `main` moved.

</details>

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Sep 7, 2026
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]>
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