Skip to content

Fix the exported rail and the render coverage after the Button fold - #169

Merged
max-sixty merged 7 commits into
mainfrom
fix/ci-33364553456
Aug 31, 2026
Merged

max-sixty merged 7 commits into
mainfrom
fix/ci-33364553456

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Aug 31, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

bba885a ("Canonicalize target Buttons") landed the … fold without the nightly suite, and run 33364553456 came back 14 failed, 1558 passed. They are one change seen from several sides: a secondary contribution is now display: none in the rail and stands in the fold as a proxy, and the fold itself is a generated container that stands in every cluster. The same set has been red on every ci run of main since, most recently run 33434899458 on 627ea48.

627ea48 ("Route margin Escape through the keyboard register") has since landed the Escape half of this branch on main, as one registered margin.back row. That half is out of this PR now — see What main took over — and the twelve still red on 627ea48 are what is left here, plus the catalog preview digest, which CI is the wrong machine to refresh (Left alone).

Solution

Two of these are the layer's, not the tests':

  • A copy holds a rail open for nothing. bake takes .lf-margin-item:empty so a pending action's stripped shell does not reserve the live page's rail. The fold is a child of every item whether or not anything is folded into it, so once its proxies were stripped the item was no longer :empty and kept the rail on the strength of a shell. Take the emptied fold first, then ask the item. (test_a_copy_says_a_change_is_only_proposed counted 3 items where it wanted 0, and test_an_exported_example_stands_on_its_own[release-notes] read the empty right strip those shells left standing.)
  • The page-map sheet's focus ring is cut on both sides. A row fills the list to its own edge and the list is a scroller, so the outset ring was 3px outside the band on the left and the right. Inset, which is the layer's own rule for a box whose edge touches something that paints. Found by the ring walk once it could reach the sheet at all.

One behaviour change survives from the Escape work, because main has no equivalent: a reaction raise that unfolds a cluster to stand its choices in folds that cluster back when the choices are put away — that cluster only, and without claiming the focus. Without it, disarming a reaction on a reply strip took away a fold the reader had opened for themselves, and a fold-back that moved focus threw a reader standing on another cluster's … onto one they had left. unfoldedButtons() hands back the unfolded cluster rather than a flag so the raise can ask whose target it belongs to; each guard has a test that fails against the unguarded form.

The rest is test surface that still names a control the reader can no longer aim at:

  • unfolded_button(control) presses … and hands back the Button standing in for one folded contribution — the owner keeps the row's record and never comes out from behind the fold. Six presses of .lf-sug-reject go through it.
  • Two assertions had gone vacuous rather than red, and are restated so the fold alone cannot satisfy them: a refused decision is read where the reader would find it, and a settled pair is read as the computed visibility: hidden that says the decision was taken.
  • The margin-action archetype's target moves from the accept press, which has no visible control left to hold still, to …, whose neighbour is the primary and whose transition adds Buttons to the row it is made on.
  • The ring walk gains the two scopes a Tab walk of the page cannot open for itself — a Thread card and the compact Page-map sheet — since .lf-margin-preview-action, which used to light page-map-action, went with the card that now holds only threads.

Testing

Against dae00e6, main's head at the merge:

  • uv run pytest tests — the PR gate: 749 passed, 6 skipped.
  • The twelve this PR answers, plus every file the dropped half touched: test_render_controls.py, test_render_export.py, test_render_outbox.py, test_render_projection.py — 204 passed; test_render_widgets.py, test_render_navigation.py, test_render_margin.py, test_render_reactions.py, test_render_aim.py — 221 passed. Both under --run-nightly -n 2.
  • pre-commit on every changed file: pass.

The ring walk's own two halves are asserted before they are divided by, so the new scopes are evidence rather than coverage: a thread card and the page map sheet both open, both walk, and the walk reports the sheet's cut ring before the theme fix and nothing after it.

What main took over, and the one question it leaves open

627ea48 replaced the living margin's two local keydown listeners with keyboardRung() in living-margin.js, registered as PAGE_MAP's single margin.back row ahead of the reaction and navigation modes. That satisfies the register invariant on its own: test_the_register_is_the_only_way_a_key_enters_the_runtime and test_design_mode_comments_on_what_a_press_lands_on_and_nothing_else both passed on 627ea48 with none of this branch applied.

So this branch's own ladder comes out rather than standing behind main's: the unfolded branch in rung(), the popover toggle's focus return, and the two tests that read this branch's wording (fold, and the reply box as a rung of its own under the card). Kept, both implementations would be live at once with main's row in front — one act named two ways depending on where the reader is standing.

Two cases main's row does not carry, left as a question about main rather than a blocker here, since nothing red waits on either:

  • The fold with the reader standing nowhere. margin.back fires with atFocus true, so it needs focus inside the cluster; this branch's rung also folded for a reader holding nothing.
  • The reply box as its own rung under the card. This branch gave the box back on the first press and the card on the second; 627ea48 closes the card on the first press from inside the box, and main's own copy of test_a_new_anchored_comment_opens_its_inline_thread asserts that.
Left alone: the catalog preview digest

test_site.py::test_the_public_catalog_is_a_visual_index_of_full_page_routes fails on preview inputs changed — rerun scripts/example-previews.py, and this branch does not run it. #133 measured why: the runner has none of Charter, Iowan Old Style or Georgia, so a capture taken here falls the prose to a generic serif and clips the banner's sentence in every still — recapturing from CI would swap the public gallery's typography for the runner's. I ran the script here to confirm that is still true; all nine stills changed, including the six whose examples nothing had touched, which is the substitution's signature rather than a real recapture. The bytes are not in this branch.

It would also be moot: this branch edits leaf.js, chrome-style.js, living-margin.js and reactions.js, all hashed inputs, so the digest moves again when it lands. #168 is open to name this as its own red-suite class; the refresh belongs to the next wt merge from the authoring machine.

The twelve still red on 627ea48, and where each goes
test cause fix
test_render_widgets::test_a_copy_says_a_change_is_only_proposed emptied fold keeps the item non-:empty bake
test_render_export::test_an_exported_example_stands_on_its_own[release-notes] same bake
test_render_controls::test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus margin-target and page-map-action painted nowhere the walk reaches two walk scopes; inset ring
test_render_controls::test_each_control_archetype_holds_its_neighbours_still[margin-action] accept's only row-mate is folded away retarget to …
test_render_widgets::test_a_decision_the_server_never_took_never_shows_as_taken reject read in the rail unfolded_button
test_render_widgets::test_a_widget_naming_its_own_words_does_not_read_the_runtimes[reject-Rejected] reject pressed in the rail unfolded_button
test_render_widgets::test_a_second_press_inside_the_round_trip_adds_no_second_decision same unfolded_button
test_render_widgets::test_a_decision_travels_between_tabs_and_the_log_has_the_last_word same unfolded_button
test_render_projection::test_a_pending_suggestion_can_be_discussed_instead_of_decided same unfolded_button
test_render_projection::test_a_decision_that_empties_its_widget_detaches_the_element_anchor same unfolded_button
test_render_outbox::test_a_second_tab_takes_the_decision_back_too same unfolded_button
test_site::test_the_public_catalog_is_a_visual_index_of_full_page_routes stale digest left alone, above

The two Escape-ladder failures from the original fourteen — test_render_navigation::test_the_register_is_the_only_way_a_key_enters_the_runtime and test_render_aim::test_design_mode_comments_on_what_a_press_lands_on_and_nothing_else — are 627ea48's now and pass on main.


Automated fix for failed run

… change

`bba885a` landed the `…` fold without the nightly suite. A secondary contribution is
now folded out of the rail and stands in the fold as a proxy, and the fold itself is a
generated container in every cluster, so thirteen tests read a control the reader can no
longer aim at or a shell the reader cannot see.

Three of those are the layer's own. `bake` takes the emptied fold before it asks whether
a target item is `:empty`, so a copy stops holding a rail open for nothing. The two
`keydown` listeners the change added go through the register instead: the fold is a rung
of the page's Escape ladder, and the card is a popover the platform already dismisses, so
its `toggle` hands focus back only where that dismissal left it nowhere. The page-map
sheet's focus ring is drawn inset, because a row fills the scrolling list to its own edge
and an outset ring is cut on both sides.

The rest is test surface. `unfolded_button` presses `…` and hands back the Button
standing in for one folded contribution; two assertions that the fold alone had made true
are restated; the `margin-action` archetype moves to the press that still has a
neighbour; and the ring walk gains the Thread card and the compact Page-map sheet, which
a Tab walk of the page cannot open for itself.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Two findings, and they are the same root twice: expandedOptionsKey is durable page-global state — nothing folds it when the reader walks away — and both new consumers read it without asking where the reader is standing. Both are verified in a browser here, not inferred; the repro for each is in its comment.

The rest of the change reads well. bake's ordering is right and matches the sweep it sits in — .lf-margin-options is built with el, not offer, so the emptied-box walk above it stops at the fold; outline-offset: calc(-1 * var(--here-ring-w)) is the layer's own idiom for this; and unfolded_button names the fold rather than a control, which is the division the layer actually makes.

Not approving because GitHub rejects a self-approval, not as a verdict on the rest.

Comment thread skills/leaf/assets/leaf.js Resolved
Comment thread skills/leaf/assets/runtime/reactions.js Resolved
The Escape rung the fold added read `expandedOptionsKey` off the page, so a
reader who unfolded a cluster and then walked into a tray or the thread panel
pressed Escape and folded the cluster behind them — keeping the layer they were
in and throwing their focus back out onto `…`. The ladder's own rule, stated a
few lines above it, is that it unwinds from where the reader is standing. The
rung now fires from inside the cluster or with nothing held, asked of the
cluster's own element so the clusters that dock in the chrome keep it too.

`lowerMarginSurface` had the same shape: it folded on every disarm, including
one whose surface was a reply strip and which never raised the margin at all,
and one over a fold the reader had opened themselves — where
`openButtonOptions` is a no-op, so "as the press found it" was a fold the press
never opened. The raise records whether it did the unfolding and only that
raise puts it back.

`buttonsUnfolded()` becomes `unfoldedButtons()`, handing back the cluster
rather than a flag, which is what both callers need to ask their question of.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

One finding on 24b79df, and it is the fold-back's focus rather than its guard: marginUnfolded now decides whether to fold correctly, but foldButtonOptions() still folds with returnFocus: true, and the put-down runs from wherever the reader happens to be standing. The Escape rung earns that focus move — the reader is in the cluster by construction now — while a disarm does not, so every disarm that folds a cluster also throws the reader onto that cluster's …. Detail and the repro are in the inline comment; it is verified in a browser here on both paths, against 24b79df and against the merge base.

The unfoldedButtons() half reads right. hosts.get(expandedOptionsKey) is the same key the pruning at if (expandedOptionsKey && !live.has(expandedOptionsKey)) keeps live, expandedOptionsKey ? … matches the truthiness the rest of the file already asks of that key, and unfolded.contains(active) is a document-tree question on both sides — externalPerch climbs out of every shadow root until main.contains(perch), so a host is never staged inside one, and documentFocused retargets the reading to the outermost host. Asking the cluster rather than the chrome does keep the toolbar-docked half, as the comment says.

Not approving because GitHub rejects a self-approval, not as a verdict on the rest.

Comment thread skills/leaf/assets/runtime/reactions.js Resolved
`lowerMarginSurface`'s put-back called `foldButtonOptions()`, which folds with
`returnFocus: true`. That focus move is the Escape rung's: the rung only fires
from inside the cluster now, so putting the reader on the `…` they opened it
with is the whole of what the press promises. The put-down has no such standing
— it runs on every disarm, from wherever the reader happens to be — so a disarm
that folded a cluster back also dragged the reader out onto that cluster's `…`,
and a press already on its way landed on a Button they were not standing on:
Enter on another cluster's `…` disarmed, was moved, and reopened the cluster the
disarm had just closed.

`foldButtonOptions` now takes the caller's answer, defaulting to the rung's
`returnFocus: true`; the put-down passes `false` and folds silently.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The put-down's focus is fixed, and it verifies out here rather than on the commit's word. foldButtonOptions({ returnFocus: false }) on the disarm path, with ({ returnFocus = true } = {}) as the signature's default, keeps the two callers apart: the Escape rung in leaf.js still calls livingMargin.foldButtonOptions() bare, so it keeps the put-back it earns by only firing from inside the cluster, while the put-down folds from wherever the reader is standing and moves no one.

Checked independently: restoring if (marginUnfolded) foldButtonOptions(); in skills/leaf/assets/runtime/reactions.js fails the new case at expect(thistle_more).to_be_focused() with Actual value: inactive, so test_the_fold_a_put_down_takes_back_does_not_take_the_readers_focus holds the behaviour rather than the current code. tests/test_render_reactions.py, tests/test_render_navigation.py and tests/test_render_margin.py are green here (--run-nightly, 121 passed), and ci / lint and ci / test are green on 8c5bda0.

8c5bda0 itself is only the formatter putting the new signature on one line. Both earlier findings are closed; I have resolved the remaining thread.

Not approving because GitHub rejects a self-approval, not as a verdict on the rest.

@leaf-agent

Copy link
Copy Markdown
Collaborator Author

The same fourteen came back on run 33425764621 (28b0e2b, the workflow-regeneration merge) — an exact match for this PR's table, nothing added and nothing dropped. ci on main has been red on them since bba885a and is still red four commits later.

This branch still answers them on today's main. I rebased 8c5bda0 onto fe4161e in a scratch worktree — clean, no conflicts across the four commits — and ran the files it touches under the nightly gate. Thirteen of the fourteen pass; the site digest wasn't run, per Left alone.

One failure survives the rebase and it is main's, not this branch's: test_render_widgets.py::test_suggestion_controls_stay_out_of_the_column fails identically on plain fe4161e (assert 536.28125 >= 558.53125, same two numbers CI printed on afd65dd). It first appeared on run 33425820038 and passes at -n0 on both trees, so merging this PR will leave main red on that one test until it is fixed separately.

What I ran

Both trees, uv run pytest --run-nightly -q -p no:randomly under the default xdist fan-out, on the ubuntu-24.04 runner with the sandbox's headless shell.

tree selection result
8c5bda0 rebased onto fe4161e test_render_aim::test_design_mode_comments…, test_render_controls::test_each_control_archetype_holds_its_neighbours_still, test_render_controls::test_every_ring…, test_render_export.py, test_render_navigation.py, test_render_outbox.py 130 passed
same test_render_projection.py, test_render_widgets.py, test_render_margin.py, test_render_reactions.py 1 failed, 203 passed
fe4161e (main) same four files 8 failed, 194 passed

The eight on main are the seven this PR fixes in those files plus test_suggestion_controls_stay_out_of_the_column; the rebased tree's one failure is that same test. On main at -n0, test_render_widgets.py alone gives the five this PR fixes and test_suggestion_controls_stay_out_of_the_column passes — it needs the parallel run to surface.

I did not push the rebase: GitHub already reports the branch MERGEABLE, so a force-push would only cost a review round.

@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Run 33428793106 (fe4161e) is red on thirteen — this PR's table minus test_render_aim::test_design_mode_comments…, which passed here. Nothing added. That is the same tree the rebase above was verified against, so CI now says on its own what the scratch worktree said.

One correction to my previous comment, which claimed merging this would leave main red on test_render_widgets::test_suggestion_controls_stay_out_of_the_column. It is intermittent in CI, not standing: across the last four ci runs on main it fails on two and passes on two, alternating, on four different commits.

run commit test_suggestion_controls_stay_out_of_the_column
33425764621 18:34Z 28b0e2b passed
33425820038 18:35Z afd65dd failed
33427491952 18:53Z 7d711e5 failed
33428793106 19:07Z fe4161e passed

It passes at -n0 on both trees and needs the parallel run to surface, so by running-tend's Reading a red suite it is a read that ran before the page said it was ready, not a regression this PR is waiting on. It wants a stated ordering in its own change; it should not hold this one.

@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Run 33430170849 (7a6a9d8, #170) is red on the same thirteen as the run above — nothing added, so I'm not repeating the table. The new fact is that this branch still holds three commits further on: 8c5bda0 rebases cleanly onto 027bdb1, main's current head, and the twelve tests it claims all pass there.

Rebase and run

8c5bda0 was last verified against fe4161e. Since then d215239 (#171), 7a6a9d8 (#170) and 027bdb1 have landed, two of them in the keyboard-hint and margin surfaces this branch also edits. git rebase 027bdb1 replayed all four commits with no conflict.

On that rebased tree, uv run pytest --run-nightly -n0 over the twelve tests in the table, run in two batches:

17 passed in 94.02s   # test_render_controls (both), test_render_export, test_render_navigation
10 passed in 36.07s   # test_render_outbox, test_render_projection (both), test_render_widgets (four),
                      # test_render_aim

test_render_aim::test_design_mode_comments_on_what_a_press_lands_on_and_nothing_else is in the second batch and passes; it also passed unfixed on 7a6a9d8, so it stays the one entry on the table CI is no longer red on.

The thirteenth, test_site::test_the_public_catalog_is_a_visual_index_of_full_page_routes, is unchanged — still the preview digest this branch leaves alone, still #168's.

# Conflicts:
#	skills/leaf/assets/runtime/living-margin.js
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

The merge at 7c308c3 is right, and the merged tree holds under the nightly gate — which the PR's own test check does not cover, since a pull request runs the everyday suite and the thirteen only surface under --run-nightly.

I merged origin/main (ed6508b) into 8c5bda0 independently before seeing that push. One conflict, in skills/leaf/assets/runtime/living-margin.js: both sides append a member to the living margin's returned object — this branch's unfoldedButtons/foldButtonOptions and #172's activeInlineThread. They are independent (the first two are read by rung() for the Escape ladder, the third by commentDestination() for c), so both are kept. My resolution and 7c308c3 produce a byte-identical tree; git diff between them is empty.

Nothing to add on the failure set itself — run 33429695964 (d215239) is red on the same thirteen the comments above already tabled, and it predates the run reported at 19:57.

What I ran on the merged tree

uv run pytest --run-nightly -q under the default xdist fan-out, on the ubuntu-24.04 runner with the sandbox's headless shell. The tree is the merge described above, byte-identical to 7c308c3.

selection result
the twelve tests in the PR's table (26 nodes with parametrizations) 26 passed in 1:29
test_render_margin.py, test_render_reactions.py, test_render_navigation.py 123 passed in 2:41
test_render_aim.py, test_render_controls.py, test_render_options.py, test_render_widgets.py 205 passed in 6:23

354 passing, 0 failing, over the four modules the merge touches on both sides plus every module the table names. This is the parallel run, not -n0, so it is the fan-out the earlier verification did not use.

test_render_widgets::test_suggestion_controls_stay_out_of_the_column — the intermittent one tabled at 19:46 — passed in the third batch, running the whole module in parallel. That is one more sample on the passing side, not a resolution; the 2-of-4 alternation across CI runs stands.

The thirteenth, test_site::test_the_public_catalog_is_a_visual_index_of_full_page_routes, is unchanged and unrun: still the preview digest this branch leaves alone, still #168's, still the wrong machine to recapture on.

@leaf-agent

Copy link
Copy Markdown
Collaborator Author

test_suggestion_controls_stay_out_of_the_column — the one tabled here as intermittent — is fixed in #173, and it is a layout bug rather than a flake. The alternation is machine load: it fails deterministically when the runner is busy and passes deterministically when it is not, so a busy CI run and an idle -n0 reproduction disagree by construction. Reproduced 12/12 with three spinners running beside it, 0/12 without, always the same assert 536.28125 >= 558.53125.

The reason load decides it: the test measures while the panel-close margin transition is still easing, and the transient narrower column happens to satisfy the assertion. A loaded machine reaches the settled layout first, where a docked .lf-margin-item — inline-flex, blockified only by the absolute position that docking removes — sits on the last line of the inline lf-suggestion it decides instead of under it. #173 gives the docked row display: flex and states the wait, so it reads the settled layout in both directions.

It is main's, not this branch's, and it predates #166: reverting all of skills/ to 28b0e2b reproduces it identically. Nothing here needs to change for it.

627ea48 landed the Escape ladder half of this branch as a registered
page-map scope, so that half comes out here: the rung inside `rung()`,
the popover toggle's focus return, and the two tests that read the
branch's own key-line words. What main does not carry stays — the bake
fold, the page-map ring inset, the reaction put-down, and the test
surface that reaches a folded Button.
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Run 33434899458 on 627ea48 is red on fourteen, and the split has moved: twelve are this PR's table, and the other two are #174's anchors pair. The two that left are the Escape-ladder pair — test_render_navigation::test_the_register_is_the_only_way_a_key_enters_the_runtime and test_render_aim::test_design_mode_comments_on_what_a_press_lands_on_and_nothing_else — both PASSED on 627ea48 with none of this branch applied.

So the blocked third and the red-fixing two-thirds are now disjoint: main's registered margin.back row satisfies the register invariant on its own, and every one of the twelve still red is answered by the rail/:empty bake fix and the render-coverage surface — the parts the 20:37 comment established merge cleanly. The design question above is still yours to answer, but nothing red is waiting on it.

The fourteen on this run

Twelve from this PR's table:

test_render_controls::test_each_control_archetype_holds_its_neighbours_still[margin-action]
test_render_controls::test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus
test_render_export::test_an_exported_example_stands_on_its_own[release-notes]
test_render_outbox::test_a_second_tab_takes_the_decision_back_too
test_render_projection::test_a_pending_suggestion_can_be_discussed_instead_of_decided
test_render_projection::test_a_decision_that_empties_its_widget_detaches_the_element_anchor
test_render_widgets::test_a_copy_says_a_change_is_only_proposed
test_render_widgets::test_a_decision_the_server_never_took_never_shows_as_taken
test_render_widgets::test_a_widget_naming_its_own_words_does_not_read_the_runtimes[reject-Rejected]
test_render_widgets::test_a_second_press_inside_the_round_trip_adds_no_second_decision
test_render_widgets::test_a_decision_travels_between_tabs_and_the_log_has_the_last_word
test_site::test_the_public_catalog_is_a_visual_index_of_full_page_routes

Two from #174: test_render_anchors::test_a_quote_finds_its_passage_whatever_its_whitespace and test_render_anchors::test_a_widgets_label_takes_a_comment_inside_the_control_it_labels.

Nothing new on this commit, and test_suggestion_controls_stay_out_of_the_column (#173) did not fail here — consistent with the load dependence #173 measured. No fix PR from this run; the whole set is carried by #169, #173, #174 and the digest in #168.

@leaf-agent leaf-agent changed the title Fix the exported rail, the Escape ladder, and the render coverage after the Button fold Fix the exported rail and the render coverage after the Button fold Aug 31, 2026
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Merged dae00e6 and took the first of the two options the 20:37 comment left you: main's registered margin.back row replaces this branch's ladder outright, rather than standing in front of it. The 20:57 comment is what decides it — the register invariant is already satisfied on 627ea48 with none of this branch applied, so the ladder here is no longer fixing anything, and keeping it would mean two live implementations of one act with main's in front. Unblocking the twelve that are still red seemed worth more than holding them behind a design question nothing red is waiting on.

Out: the unfolded branch in rung(), the popover toggle's focus return, and the two tests that read this branch's own wording. In, unchanged: the bake :empty fix, the page-map ring inset, the reaction put-down, and the test surface that reaches a folded Button. The two cases main's row does not carry — the fold with the reader standing nowhere, and the reply box as its own rung under the card — are named in the PR body as a question about main, not dropped silently; neither is red, so neither belongs in this PR.

Verified on the merged tree at f5c9e1a, against dae00e6: uv run pytest tests 749 passed, 6 skipped; test_render_controls / test_render_export / test_render_outbox / test_render_projection 204 passed; test_render_widgets / test_render_navigation / test_render_margin / test_render_reactions / test_render_aim 221 passed, both under --run-nightly -n 2. The reaction put-down's own two tests pass against main's scope order, which was the part that could have gone either way: PAGE_MAP stands ahead of REACT, and it declines every press these make because the reader is never standing in the cluster whose fold is open.

Title and description are updated to the narrowed scope. The catalog preview digest is still left alone (#168), and run 33433213755 on ed6508b was the same set again.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The merge is the right call and the resolution is faithful — main's registered margin.back row satisfies the register invariant on its own, so this branch's rung had nothing left to fix, and the three things that stay (the bake :empty fix, the ring inset, the reaction put-down) are exactly the parts nothing on main duplicates. The put-down's own two tests still hold against main's scope order.

One thing the resolution left behind: foldButtonOptions kept the two-caller signature after the merge deleted its second caller. keyboardRung() folds by calling setOptionsOpen(optionsHost.lfEntry, false, { returnFocus: true }) directly, never through this member, so the only call site left in the tree is reactions.js's disarm and it always passes returnFocus: false. The returnFocus = true default is unreachable, and the comment's last sentence names a rung that no longer routes here. setOptionsOpen's own returnFocus already defaults to false, so the option can go entirely.

@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Run 33435304606 on dae00e6 is red on the same fourteen — twelve here, two in #174 — so nothing has been added since the 20:59 verification. The new fact is about the pair rather than either PR: this branch and #174 are disjoint and together clear thirteen of main's fourteen.

f5c9e1a and #174's 6642f19 touch no file in common (this one is leaf.js, the three runtime modules, standalone.js and five test files; #174 is event_endpoint.py, mcp_app.py, two internals references and test_interact_server.py), and both merge onto dae00e6 with no conflict. On that combined tree the thirteen all pass under --run-nightly, and uv run pytest tests is 750 passed, 6 skipped.

The fourteenth stays red after both land, as this PR's body predicted: the digest moves again because this branch edits hashed runtime inputs. It wants scripts/example-previews.py from the authoring machine — the runner has none of Charter, Iowan Old Style or Georgia, so a capture here would swap the public gallery's typography for the runner's (#133, #168).

What was run

Scratch worktree at dae00e6, git merge origin/fix/ci-33364553456 then git merge 6642f194, both clean.

The thirteen, in three batches under --run-nightly -n 2: test_render_anchors (2) + test_render_controls (2) — 4 passed; test_render_export[release-notes] + test_render_outbox + test_render_projection (2) — 4 passed; test_render_widgets (5) — 5 passed. The reject parametrisation is [reject-Rejected-True] on this branch, not main's [reject-Rejected].

The fourteenth on the same tree: test_site::test_the_public_catalog_is_a_visual_index_of_full_page_routes still fails, and its expected digest has moved from main's 153b19d5 to 7f5a42ac while the computed one stays ff92edc6.

The merge with main deleted this member's second caller: keyboardRung()
folds through setOptionsOpen(optionsHost.lfEntry, false, { returnFocus:
true }) directly, so the Escape rung no longer routes here. The one call
site left is the reaction disarm, which always says returnFocus: false —
setOptionsOpen's own default — leaving the returnFocus = true default
unreachable and the comment naming a rung that does not call it.
@max-sixty
max-sixty merged commit c5198ef into main Aug 31, 2026
6 checks passed
@max-sixty
max-sixty deleted the fix/ci-33364553456 branch August 31, 2026 21:51
max-sixty pushed a commit that referenced this pull request Aug 31, 2026
…text (#173)

## Problem

The nightly `test` job on [run
33425820038](https://github.com/max-sixty/leaf/actions/runs/33425820038)
(afd65dd) came back `15 failed, 1561 passed`. Thirteen of the fifteen
are the failure shape that has been red on main since `bba885a`, and
#169 already fixes them; this PR is the fourteenth,
`test_render_widgets.py::test_suggestion_controls_stay_out_of_the_column`,
which is new on this run and is a real layout bug rather than the test's
timing.

A margin row that docks next to an inline perch lands **on** the line it
decides instead of under it. `.lf-margin-item` is `display:
inline-flex`, and it is `position: absolute` that blockifies it while it
hangs in the rail. Docking only swaps `position: static` back in, so the
row becomes inline-level again and joins whatever line box its perch
sits on. For a change inside a card the perch is the inline
`lf-suggestion` element itself — `externalPerch` takes `blockAt(target)
?? target`, and `TEXT_BLOCK` matches no ancestor inside `lf-card` — so
the ✓/✗ row is baseline-aligned onto the last line of the sentence it
decides.

<details><summary>Measured, at 820×900 with the panel closed</summary>

The row (`.lf-margin-item.lf-docked`, `display: inline-flex`, no
transform) and the two line boxes of the inline `#sug-in-card` it is a
sibling of:

| box | top | bottom |
| --- | --- | --- |
| `#sug-in-card` line 1 | 511.09 | 530.09 |
| **docked row** | **536.28** | **566.28** |
| `#sug-in-card` line 2 | 539.53 | 558.53 |

`#sug-in-card.contains(row)` is `false` and the row's parent is
`LF-CARD#card-heater`, so this is not overflow out of the widget — the
row is inline content sharing the widget's last line, extending above
and below the text because an inline-flex box 30px tall is
baseline-aligned against a 19px line.

</details>

## Why it went twelve commits without failing

The test read the layout while it was still moving. Closing the thread
panel gives the room back on an eased `margin-right`, and the column
re-wraps for the whole ~0.2s of it; the test clicked **Close threads**,
resized, waited for the docked class, and measured. On an unloaded
machine every read landed with body margin still at ~152px, where the
narrower column wrapped the card's sentence onto enough lines that the
row fell below it and the assertion held. A machine loaded enough to
reach the settled layout first reads the real one. The transient and
settled readings, same test, same commit:

| body margin at the read | row top | `#sug-in-card` bottom | verdict |
| --- | --- | --- | --- |
| 151.9px (transition running) | 563.47 | 557.28 | passes |
| 0px (settled) | 536.28 | 558.53 | fails |

So this is not a regression from #166, and reverting all of `skills/` to
`28b0e2b` — the commit before it — reproduces the identical `assert
536.28125 >= 558.53125`, 6/6. It is a bug the suite could not see. #167,
which adds a rendering turn to `resized()`, would have surfaced it the
same way.

## Solution

- `.lf-margin-item.lf-docked` states its own `display: flex`, so a
docked row is a line of its own wherever it comes to rest rather than
inheriting the inline level the absolute position was covering for.
`width: fit-content` keeps the box the width it had in the margin:
`.lf-margin-item` carries `pointer-events: auto`, and a block-level row
stretched to the column would take presses across a whole line the
reader may be selecting in.
- The test says the ordering it depends on: `panel_settled(page,
open=False)` before the resize, so it reads the layout the reader ends
up in. Without it the test proves the transient one, which is how it
stayed green.

Fixed in the theme rather than in `externalPerch`, because the perch is
the right one — the row belongs beside the change, not after the card —
and "docked is a line of its own" is the property every perch needs, not
just an inline one.

## Testing

- `test_suggestion_controls_stay_out_of_the_column`: 3/3 unloaded and
4/4 with the machine loaded, on the rebased head. Bug-back: with
`theme.css` alone reverted to `origin/main`, it fails on the first run,
unloaded — the ordering statement makes it deterministic in both
directions.
- Everyday suite: `740 passed, 6 skipped`.
- Complete nightly suite, run file by file: the only failures left are
the thirteen #169 covers (`test_render_controls` ×2,
`test_render_widgets` ×5, `test_render_export`,
`test_render_navigation`, `test_render_outbox`, `test_render_projection`
×2, `test_site`). No new ones, and `test_render_margin.py`,
`test_render_pages.py` and `test_render_aim.py` are green.
- `pre-commit` on both changed files: pass.

<details><summary>The fifteenth failure, left alone</summary>


`test_render_navigation.py::test_composer_marks_the_passage_instead_of_quoting_it`
failed once on this run (`assert 'specimen' in ''`) and I could not
reproduce it: 5 runs at `-n0`, 12 more with the machine loaded, and 3
whole-file runs at `-n 2`, all green, including on the rebased head. It
stays unclassified rather than fixed — a guess at a wait for a failure
that reproduces nowhere is how a test stops proving anything.

</details>

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

Co-authored-by: leaf-agent <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants