Repository navigation
Keep the wide banner shelf's height off its chords - #408
Conversation
Two things the UI sweep turned up in passing, neither of them in the sweep's own scope. `scripts/linux-suite.sh` could not run on this machine at all: without Rosetta, qemu kills Chromium's GPU process before the first context opens — on `about:blank` as readily as on a page — and it surfaces as `TargetClosedError`, which reads like a product failure rather than a broken runner. Two sessions independently built native arm64 images to get around it, and both of them reproduced CI's numbers to three digits, because text metrics belong to the font rather than to the CPU. So `LEAF_SUITE_NATIVE=1` builds and runs for the host's own architecture, keeping CI's fonts and dropping Google Chrome, which ships for amd64 only. It answers a question about how wide something is; the emulated image stays the one that answers everything else. A build arg rather than a second script, so there is one image to keep current. `lf-toc` watched each section at the destination its row links to. Since #372 that destination is the semantic section a heading titles, and where a heading titles no identified section it is a generated 1x0 span — a box whose size cannot change, so the observation could never fire again after its first delivery, and the map's markers would sit at positions the page had since moved past. The row still points at the destination; the observation moved to the heading, which is the box that reports a section growing. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…ontrols The banner control that opens a stable destination carries its chord on a quiet second line, and the room for that line was taken by the controls that happen to have one. The runtime writes `data-lf-chord` only while a binding is live and unshadowed, so it comes and goes as the reader moves: typing a letter inside the go-to prefix to filter targets takes every chord off the row, and 2.7px off each control and the row with them. A metric may not express state. The chordless More button was the other half: its label sat 5px below its neighbours' on the compact row, which is what `test_the_small_screen_map_is_a_complete_accessible_sheet` has been failing on since the second line landed. What a row of two-line controls owes the reader is one label offset rather than a label centred in each box, so the sheet test reads that instead, and `test_the_shelf_keeps_its_height_when_its_chords_are_shadowed` pins the height half against the gesture that takes the chords away. `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 a 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. CLAUDE.md's landing-past-a-red rule now names which mode of `scripts/linux-suite.sh` is the platform control, since the native build gives up Google Chrome. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Every state application runs the control projection, the two-second heartbeat among them, and an attribute set to the value it already holds is still a mutation. A control restating its own name and chord on a heartbeat nobody asked for is what test_an_unchanged_heartbeat_restates_no_margin_name reads. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/assets/runtime/keyboard/page.js
The card reserves symmetric resting room around its content and draws its focus edge inside that room, so the composer that spans it ends one padding short of the border box the assertion was reading. Measured against the content box the same claim holds, and a composer genuinely inset from the card still fails it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
Two of the three failures on this PR's own test run are test_an_unchanged_heartbeat_restates_no_margin_name[corpus, gallery] — the other half of #388's regression, where paintCoreControls writes title and data-lf-chord unconditionally inside the standing-chrome frame the two-second lf-actions heartbeat asks for. Nothing here touches keyboard/page.js, so this branch closes the shelf-height half and leaves that one red. (The third, test_the_margin_groups_meanings_at_one_destination_without_moving_the_page, reproduces at the merge base and is not this branch's.)
#407 is the open PR fixing that half, and it also edits chrome.css's chord layout — in the opposite direction for the compact shelf. It drops the hint there (.lf-banner-actions > [data-lf-chord]::after { content: none; }) and restates the row's box in both axes so every control stays centred, where this reserves the line at 390px too and rewrites test_the_small_screen_map_is_a_complete_accessible_sheet around a shared label offset instead. This is the deeper fix for the metric-expresses-state problem — #407 leaves the wide row's padding-block coming and going with the binding, since its content: none stands only inside the compact query — but the two cannot both describe the compact shelf, and closing #407 in favour of this would take the heartbeat fix with it. The decision worth making here is which compact-shelf design wins; #407's keyboard/page.js half is needed either way.
| -v "$ROOT:/repo" -v leaf-linux-suite-uv:/root/.cache/uv \ | ||
| -v leaf-linux-suite-playwright:/root/.cache/ms-playwright \ | ||
| leaf-linux-suite bash -c \ | ||
| exec docker run --rm "${run[@]}" --shm-size=2g \ |
There was a problem hiding this comment.
run is empty on exactly the native path, and bash before 4.4 treats "${run[@]}" on an empty array as unset under set -u. Stock macOS ships bash 3.2 at /bin/bash, which is what #!/usr/bin/env bash resolves to unless a newer bash sits ahead of it on PATH — so on an Apple silicon Mac without a Homebrew bash, LEAF_SUITE_NATIVE=1 dies with run[@]: unbound variable before Docker is reached, on the one platform the mode exists for. The emulated path is unaffected because its array is never empty.
| exec docker run --rm "${run[@]}" --shm-size=2g \ | |
| exec docker run --rm ${run[@]+"${run[@]}"} --shm-size=2g \ |
Moving --shm-size=2g into both arrays so neither is ever empty reads better if you prefer it to the guard.
| for (const { destination, heading } of this.#sections) { | ||
| const watched = heading ?? destination; | ||
| if (watched !== this.#main) this.#watching.observe(watched); | ||
| } |
There was a problem hiding this comment.
This replaces the destination rather than adding to it, and #destinationFor returns the enclosing section[id] whenever the heading titles one — the single destination kind whose box does report the section growing. A heading's own box does not change when an image lands or a fold opens below it, so the heading is the box that reports that in the comment above names the wrong box; what actually reports it is the observe(this.#main) a few lines up, since pageScroller is document.scrollingElement and main is in normal flow. The generated 1×0 target is a real gap, but closing it costs nothing on the section case:
| for (const { destination, heading } of this.#sections) { | |
| const watched = heading ?? destination; | |
| if (watched !== this.#main) this.#watching.observe(watched); | |
| } | |
| for (const { destination, heading } of this.#sections) | |
| for (const watched of [destination, heading]) | |
| if (watched && watched !== this.#main) this.#watching.observe(watched); |
The comment directly above needs its middle sentence rewritten with it.
leaf-agent
left a comment
There was a problem hiding this comment.
The base merge settled the compact-shelf question the last review raised, and it settled it in #407's favour: inside @media screen and (width <= 840px), .lf-banner-actions > .lf-btn { min-height: max(40px, var(--aim-floor)); padding: 4px 6px; } overrides this branch's padding-block: 3px 14px, and .lf-banner-actions > [data-lf-chord]::after { content: none; } takes the hint off that row entirely. The reserved line is now a wide-row property, which is where test_the_shelf_keeps_its_height_when_its_chords_are_shadowed drives it at 1200×900 — that half stands, and it is the half #407 does not reach.
What did not survive the merge is the rewrite of test_the_small_screen_map_is_a_complete_accessible_sheet. It replaces a per-control above ≈ below reading with max(above) - min(above) <= 1.5, on the stated ground that every control on the row reserves the chord's second line — and at 390px none of them do any more. I restored the original assertion on this head and ran both parametrizations: they pass, with every label measuring above: 12, below: 12. So the weaker reading buys nothing, and it goes green on a compact row whose labels all sit high in their 40px aim by an equal amount — which is the shape of #388's regression the sheet test was the one to catch.
The same fact is still carried in two places of prose: the new test's docstring says the compact row's misaligned More is "the reading the sheet test below takes", and the PR description says the shelf reserving the line for every control it draws is what repairs that row. Both now describe #407's content: none instead.
#407 landed the same two reds while this branch was open. Its heartbeat fix is the one in the tree: keeps() covers every control the pass reaches rather than the two the test saw. Its compact-shelf fix stands too — a forty-pixel aim has no second line to give, so the row states its whole box and drops the hint — and the sheet test goes back to reading each label centred in its own box. What it does not reach is the wide row, where the news chip carries no chord and the shelf still lost 2.7px a control when a go-to filter took the chords away. That half is here, with its own pin. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
#410 rewrites the same two hunks of The two layouts are compatible even though the two accounts are not. Under #410's reported geometry the thread keeps That is a design call about the margin seat rather than a correctness one, so it is yours to make. #410 is open and not blocking this; if this lands first, its test hunks need a rebase and its CSS stands or falls as a design change on its own. |
…ds (#411) `test_the_ring_says_where_the_reader_is_standing` was the last unclaimed failure in the nightly leg of [run 34149953389](https://github.com/max-sixty/leaf/actions/runs/34149953389); [#407](#407) took four of that run's six and [#408](#408) closed the fifth. It read the suggestion's ring as `['none', '3px', 'rgb(28, 27, 24)']` — the outline shorthand's initial values, which is what `outline: var(--here-ring)` computes to when nothing on the element is wearing `data-lf-ask` at all. **A control that forwards another control's press was standing nowhere.** When a hoisted control spills out of the margin's visible row into its More options group, `optionControlNode` builds a proxy button for it: same label, same tone, same owner, and an `onclick` that presses the original. It copied everything about that control except where the control stands. `askPlace` reads the ask a node points back at off the nearest `[data-lf-for]`/`[data-lf-at]` ancestor, and the suggestion's own `.lf-sug-actions` row carries `data-lf-for="sug-refill"` for exactly this reason — but the proxy is built into `.lf-margin-options`, which carries neither. So `standingIn()` answered `null` for it, and Tab from a suggestion's ✓ Accept to its own ✗ Reject took the "you are here" band off the change the reader was deciding, for as long as they held that control. The walk read the same nothing: stepping on from the proxy measured from the margin rather than from the suggestion. The repair is the identity the proxy already records in `lfForwardedControl`, said where the reading `askPlace` performs can find it — but said in an attribute of the stand-in's own, `data-lf-stands`. `data-lf-for` names one element per ask, the row `lf-suggestion` hangs in the margin, and the runtime's lookups, the theme and this suite all read `[data-lf-for="<id>"]` as that row; a proxy wearing it would be a second answer to every one of them for the same ask, whenever a suggestion has a secondary control — the options group is built on every margin render and merely hidden while closed. So `standsAt` is factored out of `askPlace` and reads the three attributes together, and `standsWith`, new in `asks/view.js` beside it, writes the third. It writes only where the value changes — `test_an_unchanged_heartbeat_restates_no_margin_name` catches the unguarded version, since a heartbeat re-presenting the same control must restate nothing. **How that reached CI as an intermittent red.** The paint is coalesced to an animation frame (`paintHere`), so the drop and the restore each land a frame after the focus move that caused them. The test tabs to the proxy and back before reading, and the read landed in the gap after the clearing frame and before the restoring one — about half the time here, which is why `main` reddened on this case only after the branch that added the case's margin fixture had been green for days. The test now names the defect directly: it reads the ring while the reader holds the proxy, after the frame that focus move's repaint is coalesced into, and asserts the band is the one the options row wore. It also pins the count that the collision above would have broken — the suggestion's margin row stays the one element `[data-lf-for='sug-refill']` names — and waits for the second ask's arrival mark the way the test already waits for the first, so the earlier read states an ordering rather than a timing. ## Verification Linux, with the repository's browser, at `f9fb71cd`: - with the runtime change stashed and the test kept, the new assertion fails deterministically at `['none', '3px', 'rgb(28, 27, 24)']` against `['solid', '2px', 'rgb(47, 84, 128)']` — so the case catches the behavior it is named for rather than the frame it used to catch; - `tests/test_render_projection.py` under `--run-nightly`: 102 passed; - `tests/test_render_margin.py` under `--run-nightly`: 82 passed; - the nine nightly cases that read `[data-lf-for]` as a single element, across `test_render_widgets.py`, `test_render_anchors.py` and `test_render_options.py`: 8 passed, 1 failed — `test_suggestion_controls_stay_out_of_the_column[no-preference]`, which fails identically at its `!lf-docked` wait on the merge base `2cdb4048` in this container and is not this branch's; - the everyday `uv run pytest tests`: 901 passed, 6 skipped; - pre-commit over the changed files. <details><summary>The failure, and the frame it fell in</summary> ``` FAILED tests/test_render_projection.py::test_the_ring_says_where_the_reader_is_standing AssertionError: a decision and an options row are drawn in two different bands for the one fact: ['none', '3px', 'rgb(28, 27, 24)'] against ['solid', '2px', 'rgb(47, 84, 128)'] ``` Reproduced 3 of 8 times on `main` before the change. A `MutationObserver` on `data-lf-ask` over one failing run, with `document.activeElement` at each write: | ms | what happened | activeElement | | --- | --- | --- | | 1250 | `focusin` after the `a` walk | `#sug-refill` | | 1276 | mark moves to `sug-refill` | `#sug-refill` | | 1285 | `focusin` on the hoisted ✓ Accept | `.lf-sug-accept` | | 1288 | `focusin` on the options proxy for ✗ Reject | `.lf-margin-option-proxy` | | 1305 | **mark removed from `sug-refill`** | `.lf-margin-option-proxy` | | 1310 | `focusin` back on ✓ Accept | `.lf-sug-accept` | | 1315 | the test reads the ring; nothing on the page is marked | — | The restoring paint would have landed around 1321. On the runs that passed, the same removal and restore happened either side of the read. </details> --------- Co-authored-by: leaf-agent <[email protected]> Co-authored-by: Maximilian Roos <[email protected]>
`shipped_payload()` asks git for `ls-files --cached --others --exclude-standard`, so the candidate payload is the tracked tree plus whatever is untracked and unignored. That is the point of it — a file a change has written but not yet added is payload a host would copy, which is what lets the install boundary exercise a change before it is staged. It also means a `--basetemp` inside the checkout turns every fixture page a run writes into candidate payload, so `install_payload()` copies a tree full of temporary pages and the boundary fails about the tree rather than about the flag that filled it. `pytest_configure` in `tests/interact_support.py` now refuses one up front, sitting directly above the function whose contract is its whole reason. An ignored path is allowed, because git's answer rather than the path's depth is what decides: `.tmp/basetemp` passes and `pkg-basetemp` does not. The flag was being reached for on the belief that a concurrent sibling suite can rotate a live run's basetemp away, and it cannot. `make_numbered_dir_with_cleanup` writes a `.lock` inside each numbered directory it creates, and `ensure_deletable` refuses any candidate whose lock is younger than `LOCK_TIMEOUT` — three days. Pruning is by count and by lock. Measured by holding one run open for forty seconds while five siblings started and finished, pushing the numbers well past the `keep=3` window: every live directory survived, and only the finished ones went. So the belief had cost a real failure — a startup-note test that read the checkout's path, repaired in #408 — and bought nothing. `test_a_run_keeps_its_temporary_tree_out_of_the_candidate_payload` collects one node id under a basetemp inside the checkout and one outside it. The refusal happens at configure time, so collection alone asks for it, and the outside path is the control saying what is refused is where the basetemp points rather than the flag itself. Put the bug back by taking the hook out of the way and it fails on the first of those. `tests/CLAUDE.md` gains the rule beside the `shipped_payload` paragraph that explains it. The repository's one other `--basetemp`, in `test_a_run_ends_only_the_servers_it_started`, is a nested run's, pointed under the outer test's `tmp_path` so the outer test can assert on what it left. It is outside the checkout and the guard passes it. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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 14pxon[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, andtest_the_shelf_keeps_its_height_when_its_chords_are_shadowedpins 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_pageasserted 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 - threadPadis 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.shcan 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, onabout:blankas readily as on a page, which surfaces asTargetClosedErrorand 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-tocobserved 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_leafread 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--basetempthere. Equality on the runtime line says what the absence was reaching for.A full local
--run-nightlyrun 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 withmain's ownchrome.cssin place and belongs to a module this PR does not touch.