Skip to content

Hold the version menu's nightly case on an open composer reached by keyboard - #996

Merged
max-sixty merged 2 commits into
mainfrom
fix/ci-35819929850
Sep 23, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/ci-35819929850

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

The nightly suite on 453e957e (run 35819929850) ended with three failures. Two of them were the banner's 320px row and are already fixed on main; the third is a race in test_a_stamped_live_draft_and_its_unstamped_view_keep_distinct_menu_rows that still reproduces, and this PR repairs it.

The case kept the page on revision 2 by filling the Threads panel's general box and leaving the caret in it. That is midComposition's focused-textarea reading, and it ends the moment focus leaves the box — which is exactly what the next line did: every secondary banner control stands behind More, so banner_control(page, ".lf-version") presses that door to reach the chooser. Whether the page still showed revision 2 when the menu opened then came down to whether the next state read landed inside that window. When the read won, the page followed to revision 3, and the menu — which deliberately freezes its rows while its popover stands — held three rows against the expected four.

skills/leaf/assets/CLAUDE.md already settles which hold outlasts a press: a hold defers a revision for a gesture that is not a value — an open composer, a drag, an unresolved delivery, an open menu — and the draft store, not a hold, is what carries a reader's words across an install. Getting there takes both halves of this diff. The case now holds the page with the selection composer, which does not end when focus moves; and it opens More and the chooser from the keyboard, because standDown runs on every document mousedown and stands the composer down for any target outside .lf-fab-bar, .lf-react-surface, .lf-composer — so a mouse press on More would have ended the hold on the very gesture that opens the menu. It also waits on the news the third revision lights (data-lf-news on .lf-version) rather than on to_have_title("Live second"), which the page already carried before the write and so stated no ordering at all.

How the three failures were separated

All three were reproduced on this runner against the exact SHAs, with -n0 and explicit node ids.

The two banner failures were real and are already fixed. On 453e957 they reproduce with CI's exact numbers:

tests/test_render_controls.py::test_the_responsive_action_row_keeps_primary_actions_in_reach
  AssertionError: .lf-threads-toggle is outside the first 320px view:
  {'left': 197, 'right': 321, 'width': 124, ...}
tests/test_render_controls.py::test_the_banner_uses_the_page_mark_and_puts_each_edge_by_its_panel
  AssertionError: assert 331 <= (320 + 1)

Both pass on afb21331 (#974), which took the unread marker off the Threads button's label and gave the 320px row its 1px back. That landed at 06:14, after this nightly started at 05:57, so the run could not see it. Both also fail on the preceding nightly's commit 54fc744 and pass on every commit from afb2133 onward, including current main.

The third failure is this PR's. It is not deterministic on a quiet machine — 1 failure in 13 local runs of the unmodified case — which is why it appeared in this run and not the one before. Forcing the condition makes it deterministic: inserting page.evaluate("() => document.activeElement.blur()") before the LIVE_V3 write fails the unmodified case on every run, on the merge base 878780ea, reporting the same 3 rows CI reported. The rows it holds name the third revision (Current · Draft after v2 at data-lf-revision="3"), confirming the page had followed rather than held.

The repaired case is green at this branch's head, and uv run pytest tests/test_render_projection.py --run-nightly was green (152 passed) on the first commit's arrangement.

This was written by Codex on behalf of max-sixty

…ed draft box

`test_a_stamped_live_draft_and_its_unstamped_view_keep_distinct_menu_rows`
kept the page on revision 2 by filling the Threads panel's general box and
leaving the caret in it. That hold is `midComposition`'s focused-textarea
reading, and it ends the moment focus leaves the box — which is what the very
next line does, since every secondary banner control stands behind More and
`banner_control` presses that door to reach the chooser. Whether the page was
still on revision 2 when the menu opened then came down to whether the next
state read landed inside that window, so the case read three rows instead of
four whenever the read won.

`skills/leaf/assets/CLAUDE.md` already settles which hold outlasts a press: a
hold defers a revision for a gesture that is not a value — an open composer, a
drag, an unresolved delivery, an open menu — and the draft store, not a hold,
is what carries words across an install. So the case now holds the page with
the selection composer, which stands on its own through any press, and waits on
the news the third revision lights rather than on a title the page already
carried before the write.
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

test is red on this branch for a reason the branch did not cause: the Measure the bundled release in Chrome step hit the ERR_NETWORK_CHANGED race tracked in #981, on /examples/triage-board/ — the same page as that issue's first row. Every other step in the job passed, including the everyday pytest gate, the browser framework check, the runtime folds and the Worker tests, and this PR changes one nightly test file that the failing step never reads. lint, the required check, is green. I've recorded the occurrence on #981, where it is the third in three days and the first to land on a pull request rather than on publish-site.

The case this PR repairs is nightly-only, so it does not run on a pull request. Its evidence is in the description: green under uv run pytest tests/test_render_projection.py --run-nightly, and green under the forced blur that fails the unmodified case every time on this branch's merge base.

@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 composer hold does not outlast the press that reaches the chooser, so the race this PR reports is still live. standDown in skills/leaf/assets/runtime/composing/surface.js runs on every document mousedown (document.addEventListener("mousedown", (ev) => { if (!drawModeActive()) standDown(ev.composedPath()[0]); })), and its guard exempts only the response bar's own layer — !target.closest?.(".lf-fab-bar, .lf-react-surface, .lf-composer") — before if (composerOpen) hideComposer(). The More door is none of those, so banner_control(page, ".lf-version").click() stands the composer down on its first press, exactly as it used to take focus out of the general box. Whether the page has followed by the time the menu opens still comes down to whether a state read lands between the two presses.

Measured on this runner by replaying the case's arrangement in the merged checkout: right after the More press .lf-composer[data-lf-open] is already gone, and holding a window open between the two presses reproduces the nightly's failure unchanged.

The composer is still the right hold — it is what survives focus moving to the door — but it needs a press that is not a mouse press. standDown is wired to mousedown only, so reaching the chooser by its keyboard route leaves the composer standing through both presses. I'm pushing that as a follow-up commit here.

The PR description's account of how the three nightly failures were separated stands; it is the repair that doesn't hold. Worth correcting there too, since the description is main's commit message for this change.

Probe output

The PR's arrangement, with a 1.5s window forced between the More press and the chooser press:

PROBE after told, composer open: True
PROBE after More press, composer open: False
PROBE title after More: Live second
PROBE title after 1.5s wait: Live third
PROBE rows: 3
PROBE title: Live third

The pre-PR arrangement under the same forced window, for comparison:

OLD: title after More: Live second
OLD: title after 1.5s: Live third
OLD: rows: 3

Three rows and Live third are what the nightly reported. With the keyboard route in place, the same forced window (1.2s at each press) leaves composer open: True, the title at Live second, and four rows.

The composer was the right hold and not enough on its own: standDown
hides it on any document mousedown outside the response bar's own layer,
and the More door is outside it, so pressing through to the chooser ended
the hold on the same gesture the focused draft box used to lose it on.
standDown is wired to mousedown only, so the case now presses Enter on
the More door and on the version control, and the composer stands through
both.
@leaf-agent leaf-agent changed the title Hold the version menu's nightly case on an open composer, not a focused draft box Hold the version menu's nightly case on an open composer reached by keyboard Sep 23, 2026
@max-sixty
max-sixty merged commit c838a4a into main Sep 23, 2026
4 checks passed
@max-sixty
max-sixty deleted the fix/ci-35819929850 branch September 23, 2026 09:48
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