Skip to content

Fix the corpus render gate's header, thread-opening and held-scroller failures - #3305

Merged
max-sixty merged 9 commits into
mainfrom
agent-a75bade2beeec3726
Oct 20, 2026
Merged

max-sixty merged 9 commits into
mainfrom
agent-a75bade2beeec3726

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

test_page_fixture_renders failed on main for ten corpus pages with three kinds of finding. Each is fixed at its owner; all ten cases pass here, run one at a time.

  • Workspace header past the column (alert-review, data-explorer, rust-sort, wt-merge, at 360-680px). Under 720px wide or 480px tall the workspace header sticks at the window's top and covers the 12px gutters beside it (Close the tally's small gaps: a sticky phone header, named undos, m's scope, the open mark's words #3271). It covered them by widening its box with margin-inline: -12px and padding its content back in, so its box stood 12px past the column. Read the geometry that moves with the window as one reading, by width #3300's width sweep reported it. The header now paints its ground over the gutters as two shadows offset by the gutter's width, which the workspace names once as --lf-workspace-gutter for both its padding and the shadows. Screenshots of the stuck header at 360, 390, 540 and 680px in both schemes, at 800x400, and in Firefox at 390px are pixel-identical to main. A tap in a gutter beside the stuck header now lands on the workspace's own padding rather than the header, and neither does anything.
  • A thread opening that never answered (feature-gallery, and the corpus page that embeds it: 120 s, then a failure). The render gate opens each thread whose messages carry markup with travel: false. The gallery's workshop thread has its passage in the Threads tab, which the page doesn't open on. The floating panel declines a thread about a passage, so the margin card took it, and the card's placement waited for a margin row the closed tab hid. travel: false promises to keep the page where it is while revealing the destination; the card path was the one path that skipped the reveal (thread/destination.js). It now reveals a hidden passage first, unless the caller passes scroll: false, since switching tabs scrolls the strip to the new tab's name. Where the passage stays hidden, by a closed tab under scroll: false or by the page itself (hidden, visibility: hidden), as the card reads it (visibleTargetParts), the card has nothing to stand beside, so the opening leaves the thread to the floating panel, as it does for any thread nothing on the page shows. Such an opening had waited forever. A passage already in view is not revealed, so an open tab's strip stays where the user scrolled it.
  • Held scrollers (code-comparison, root-parts, the feature gallery's page-of-parts sample). A page of parts' list sticks under the title at the window's height and scrolls its own names (Add a page of parts: lf-parts, each part laid out by its own Layout #3198), as a sticking block does, but didn't declare --lf-holds-height: 1. It now does. Nothing it draws changes.

Tests: the phone workspace test now asserts nothing stands past the column with the header stuck. test_opening_a_thread_reveals_its_closed_tab covers both opening routes, test_a_thread_whose_passage_stays_hidden_opens_in_the_panel the closed tab under scroll: false and a passage the page hides, and test_a_thread_in_view_opens_beside_it_and_leaves_the_tab_strip the strip. Each fails with its part of the fix removed. pnpm run test:runtime passes.

The card's placement itself still waits for a passage that is never drawn when it is opened outside openPageThread, as when a revision moves an open card's passage into a closed tab (margin-projection.js calls showPreview directly there). Letting the card answer "can't stand here" would end that wait at its owner, but a travelling opening opens the card before its trip reveals the passage, so "not drawn now" means "can't stand" only once the trip reveals first, which moves where it captures its return place. That reordering isn't part of this change.

review-queue's and rust-sort's resize journeys each failed once under load with a keyboard stop 1px off after a resize, and passed on every other run (review-queue 4 of 5).

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 7 commits October 20, 2026 02:47
…in the column

Under 720px wide or 480px tall the workspace header sticks at the window's
top and covers the 12px gutters beside it, so content scrolling under it
doesn't show at its sides (#3271). It covered them by widening its box
with `margin-inline: -12px` and padding the content back in. That box
then stood 12px past the column, and the render gate's width sweep
(#3300) failed every workspace example at 360-680px: alert-review,
data-explorer, rust-sort and wt-merge.

The header now paints its ground over the gutters as two shadows offset
by the gutter's width. A shadow draws without moving the box, so the
header stays in the column and its words sit where they did. The
workspace names its gutter once, `--lf-workspace-gutter`, which both its
padding and the shadows read.

The phone workspace test now also asserts that nothing stands past the
column with the header stuck; it fails on the margin version.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… parts' list hold its height

Two failures `test_page_fixture_renders` reported on the corpus, besides the
workspace header's.

A thread opened with `travel: false` never answered when its passage sat in
a tab the page had not opened. The margin card stands beside the passage's
margin row, which the closed tab hides, so the card's placement waited for
room that never came. `travel: false` promises to keep the page where it is
while revealing the destination, and the card path was the one path that
skipped the reveal. It now reveals the passage first. The render gate opens
each thread whose messages carry markup this way, so the feature gallery's
workshop thread, whose passage is in its Threads tab, cost every corpus run
a 120 s wait and a failure. `test_a_thread_opened_where_the_user_stands_
reveals_its_closed_tab` fails without the reveal.

A page of parts' list sticks under the title at the window's height and
scrolls its own names (#3198), as a sticking block does, but did not declare
`--lf-holds-height: 1`, so the held-scroller reading named it on
code-comparison, root-parts and the feature gallery's page-of-parts sample.
It now declares it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…nds inside it

lf-tabs re-showed its open tab whenever it was activated again, which
scrolled the strip to the tab's name. That is the way back for a user who
presses or walks to the open tab after scrolling the row away, but a reveal
is travel to something inside the open view. Opening a thread with
`scroll: false`, which promises to leave every scroller where it stands,
moved a phone's tab strip once the thread's opening revealed its passage.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

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

Opening a thread in a closed tab still moves the tab strip when the caller sets scroll: false. The new reveal(place, intent) path activates the closed tab, and lf-tabs calls #showTab(button) for that switch. In a 390 px fixture with the target in the last tab, threadActions.open(..., {focus: false, travel: false, scroll: false}) opened the card but moved the strip from scrollLeft = 0 to 933. The new strip test covers an already-open tab only. Please carry the no-scroll request through the reveal so a closed tab can open without moving the strip.

…lowed

Review found that opening a thread in a closed tab with `scroll: false`
still scrolled the tab strip, since switching tabs shows the new tab's name.
A thread opened where the user stands now reveals its passage only where
it is hidden and the caller lets scrollers move. Where the passage stays
hidden, by a closed tab under `scroll: false` or by the page itself, the
card has no row to stand beside, so the opening leaves the thread to the
floating panel, as it does for any thread nothing on the page shows. Such
an opening had waited forever. A passage already in view is not revealed,
so the open tab's strip stays where the user scrolled it, which makes the
earlier lf-tabs change unnecessary; it is reverted.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

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

visibility: hidden still leaves a thread opening unanswered. With an authored passage hidden that way, place.checkVisibility() returns true in Chromium, so preview.open takes the thread; commentAttachment rejects the undrawn target, and the card's placement promise never settles. A browser probe of this head returned late after one second. The card's placement needs to answer when it cannot stand by its target so the opening can fall back to the panel. That also covers callers that open the card directly, outside openPageThread.

The destination asked `checkVisibility()`, which counts a passage under
`visibility: hidden` as shown, so the card still took such a thread and
never placed. It now reads `visibleTargetParts`, the reading
`commentAttachment` stands the card by, so a passage the card can't stand
beside leaves the thread to the floating panel.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty

Copy link
Copy Markdown
Owner Author

@leaf-agent Your run on 082c14b withheld approval because a card opened directly, outside openPageThread, can still wait indefinitely when its passage is no longer drawn (revision restoration's showPreview in margin-projection.js). That wait predates this PR: on main the card behaves the same on that route, and every route through openPageThread hung where this branch now opens the thread.

I've left the card's lifecycle out of this PR for one reason. A travelling opening calls preview.open before scrollToThread reveals the passage, so a card that answered "can't stand" whenever its passage isn't drawn would send every travelling opening into a closed tab to the floating panel, a route that works today. Fixing it at the card means revealing before the trip captures its return place, which prepareTrip currently does first on purpose. The PR description records the remaining case and this constraint as a follow-up for Max.

Is anything in this diff itself still wrong, or does the remaining concern belong to that follow-up?

This was written by Claude Code on behalf of max-sixty

@leaf-agent

Copy link
Copy Markdown
Collaborator

You're right: the direct restoreStanding → showPreview path and its placement wait are unchanged on this PR. The change to openPageThread handles the previously hanging openings through that route, including passages hidden by visibility: hidden; the focused browser cases pass (3 tests). I found no remaining issue in this diff. The direct card lifecycle belongs in the follow-up described in the PR body, and I'm withdrawing my earlier objection.

@max-sixty
max-sixty merged commit e78ef8b into main Oct 20, 2026
3 checks passed
@max-sixty
max-sixty deleted the agent-a75bade2beeec3726 branch October 20, 2026 11:26
max-sixty added a commit that referenced this pull request Oct 20, 2026
…inations (#3315)

When a revision moved an open margin card's passage into a closed tab,
or hid it, the thread the user was reading left the page. #3305 left
this case: it made `openPageThread` decide where every thread opens (the
card beside a drawn passage, else the floating panel), but a card
carried across a revision didn't go through it.

What happened before:

- **A revision installed in place** kept the card. A card Leaf opened
(`openPageThread`) stayed open and unseen, waiting for a passage nothing
would draw again. One opened from its margin marker was closed by the
next margin render, since its entry was no longer drawn.
- **A revision that loads a fresh document** reopened the card with
`showPreview` (`margin-projection.js`, `restoreStanding`). It never
placed, and the next margin render closed it.

Both installations now capture the margin's and the panel's standing
before the revision and restore it after (`version.js`; until now only
the fresh document did). The margin restores an open card by opening its
thread through `openPageThread` with `scroll: false`, so a revision the
user didn't ask for opens no tab or disclosure over the passage. A user
who stood in the card stands in the thread wherever it opens, and one on
its Close button returns to Close when it reopens in the card.

- A card the in-place revision kept, and that still has somewhere to
stand (`card.stands()`), stays as it was, with its reading.
- A card that accompanied the target the user stood on, with the user
outside the card, comes back only beside that target's marker
(`openInlineThread`, `unfold: false`), so it never takes the panel from
a thread the user is reading there.
- A reply the user is writing in the card is left to its editing
continuity, which reopens the thread itself (and, as before, reveals the
passage when the reply was in view).
- Focus on a margin entry comes back whether or not a card was open too.
- The panel's restore and the entry-focus restore change nothing where
the in-place revision already kept that view or focus.

A card whose passage is hidden by anything else, such as a narrower
window, still waits for it (#2650).

`test_a_card_open_across_a_revision_opens_where_its_passage_stands`
covers both installations with the passage drawn and moved into a closed
tab; the closed-tab cases fail without the change. Focused revision
tests in `test_revisions.py`, `test_render_anchors.py`,
`test_render_aim.py`, `test_round_trip.py` and two
`journeys/test_render_drafts.py` cases pass, as does `pnpm run
test:runtime`. Two independent Codex reviews found five issues in
earlier versions (a stray panel beside a reply's own restore, an
accompanying card taking the panel, focus lost to the body, focus in an
entered accompanying card, entry focus skipped beside an open card);
each is fixed here and confirmed by browser runs or a re-review.

> _This was written by Claude Code on behalf of max-sixty_

Co-authored-by: Claude Opus 5.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