Skip to content

Open the thread card on its latest message under its writer's name - #1763

Merged
max-sixty merged 4 commits into
mainfrom
thread-walk-latest-message
Oct 5, 2026
Merged

max-sixty merged 4 commits into
mainfrom
thread-walk-latest-message

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

The margin thread card (the floating card t/T and a margin marker open while the Threads panel is closed) pinned its first message's author row beside Resolve and Close, outside the scrolling transcript. Scrolled to the newest turn, that row put "You" over an agent's words, so the card always opened at the top with the newest turn out of view. #1715 made the Threads panel land a walked-to thread on its latest message; this gives the card the same landing.

In the card, each message's head is now position: sticky at the top of the transcript, and the controls (thread nav, news, Resolve, Close) stand over the transcript's top-right in .lf-margin-thread-controls. The top row therefore always names whoever wrote the words under it, and as one message scrolls out the next one's head pushes it off. A head's centring lead comes out of the gap before its message, so nothing grows: at rest on desktop the card's geometry matches main to 0.1px. Under a finger it is 25px shorter, since agent heads no longer reserve room for a reaction trigger the card never draws. A sizeObserver publishes the controls' width as --lf-margin-controls-width, which caps each head as a percentage so long metadata ellipsizes before the controls without widening the card. The words under a head take its height as --lf-top and scroll-margin (the partial-cover rule at --lf-top in theme.css), so focus and reveals land them clear of it and the runtime's reading counts covered words as hidden. The Threads panel and inline page threads keep the hoisted root row.

The card opens on its latest turn with showLatestTurn in reply-landing.js. latestTurn is now the one home for "the turn a user comes back to", shared with the panel's threadLandingStart. The arrival cue's background now settles on the message's own ground instead of transparent, so the card's opaque heads don't go see-through mid-cue. The name size moved to --lf-msg-name-size in shadow.css, so the head's lead and the name share one value.

Known edge: a card opened at the very bottom of its transcript can show a sliver of the previous message at the top (its head mid push-off, or a cut line), because the scroll is capped at the end. Fixing it means trimming the card to a message boundary; left for now.

Tests:

  • New: test_the_thread_card_opens_on_its_latest_message_under_its_own_name.
  • Card tests that read .lf-thread-root-meta now read the controls row and the message heads.
  • open_long_thread scrolls back up from the latest message.
  • test_a_sent_margin_reply_shows_its_words_while_delivery_is_pending expects the card to open on its latest message instead of at scrollTop 0.
  • The thread snapshots are re-accepted for both profiles. In the margin cases only the newest message's name row redraws, in the same place. On Linux the composer drafts in the general, panel and margin cases also wrap one word earlier on this tree, while macOS matches main's pin there. Geometry readings are unchanged.

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

max-sixty and others added 2 commits October 4, 2026 14:38
The margin thread card pinned the root message's author row beside its
Resolve and Close controls, outside the scrolling transcript, so it had
to open at the top: scrolled to the newest turn, that row put "You" over
an agent's words. Walking to a long thread in the Threads panel already
lands on its latest message (#1715); the card now does too.

In the card each message's head sticks at the top of the transcript
while that message is read, and the controls stand over the
transcript's top-right, so the row always names who wrote the words
under it. A head's lead comes out of the gap before its message, so the
card is no taller (identical geometry at rest on desktop; 25px shorter
under a finger, where agent heads no longer keep room for reactions the
card never draws). The words under a head take its height as `--lf-top`
and `scroll-margin`, so a reveal lands them clear of it. The panel and
inline threads keep the hoisted root row.

`latestTurn` gives the panel's and the card's landings one home. The
arrival cue now settles on the message's own ground rather than
transparent, which the card's opaque heads need.

Tests: a new card test asserts the card opens on its latest message and
its top row names the message under it while reading back up. Card
tests that read `.lf-thread-root-meta` now read the controls row and
message heads; `open_long_thread` scrolls back up from the latest
message. The margin thread snapshots need re-accepting: only the newest
message's name row redraws, at the same position.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	skills/leaf/assets/runtime/thread/reply-landing.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.

The lint check fails because ruff format rewrites the new test function signature, so I’m withholding approval until that check passes.

Comment thread tests/test_render_threads.py Resolved
The margin cases' newest name row redraws as a sticky head in the same
place; the pin moves to the re-accepted profile.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Oct 4, 2026

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

The test job is red on this head, so I’m withdrawing the approval.

  • test_a_sent_margin_reply_shows_its_words_while_delivery_is_pending still asserts scrollTop == 0 immediately after opening a margin card. The new latest-turn landing scrolls it to 116–775px in three cases, so the test stops before checking that a pending reply stays visible. Update its opening-state setup or assertion to match the new landing, then retain the pending-word visibility check.
  • The pinned Linux thread snapshots differ in six delivery-journey cases (general, panel, margin, panel-dark, margin-dark, and panel-narrow). The new asset pin includes the macOS acceptance, but the Linux CI profile also needs reviewed captures for the changed appearance; the snapshot test reports mismatches starting at drafted.

@leaf-agent
leaf-agent dismissed their stale review October 4, 2026 22:59

CI failed on the approved head: stale opening-scroll assertion and Linux thread snapshots.

…ts latest message

The pending-reply smoke test asserted the margin card opened at scrollTop 0;
it now expects the latest message in view and keeps its pending-words check.
The Linux profile is re-accepted from CI run 37239923576: the margin cases
redraw the newest name row as a sticky head, and the composer drafts in the
general, panel and margin cases wrap one word earlier on this tree (macOS
matches main's pin there). Geometry readings are unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 33f8e41 into main Oct 5, 2026
4 of 5 checks passed
@max-sixty
max-sixty deleted the thread-walk-latest-message branch October 5, 2026 00:03
max-sixty added a commit that referenced this pull request Oct 11, 2026
In the floating thread card (the card `t` or a margin marker opens while
the Threads panel is closed), each message's head sticks to the top of
the transcript so the row always names who wrote the words under it
(#1763). Everything in that head stuck with it, so a long reply carrying
"Show 1 progress message" kept offering its earlier updates over every
line of the reply, and an edited or sending label did the same.

Now only the writer's name and the time stick. The head's annotations
(the progress disclosure, delivery receipt, failure, suggestion and
edited labels) scroll out with the reply's first line, as the words do.
A view timeline on each message cancels the sticky offset for them
during the first two head heights of its exit, which also clears a
disclosure that a narrow card wraps onto a second row; past that the
transcript clips them. The timeline has no inset, since the transcript's
scroll padding is ring room rather than where the head sticks; with the
default inset the annotations started moving 3px early. All of it is
CSS, in `annotation-chrome.css`, beside the sticky head rule.

- A wrapped disclosure rises under the name and the time rather than
over them: those two paint their message's ground above it, and the
name's ground spans the gap to the time.
- A keyboard-focused disclosure stays in the stuck row, so Tab still
reaches it while the head is stuck.
- The metadata clips only sideways while the mechanism is on, for its
ellipsis, so a label rises to the card's edge instead of vanishing at
the metadata's own top.
- The rules sit inside `@supports (animation-timeline: view())`. An
engine without view timelines would run the animation on the document
clock, whose filled end holds the annotations 56px above their row at
rest; Firefox 155 keeps today's behaviour instead. Chromium 153 and
WebKit 26.6 support it.

A narrow card's stuck head stays as tall as its wrapped two rows, now
with the second row empty; it was already that tall before this change,
holding the disclosure. Making only one row stick is a separate
restructure of the card head.

Tests: new
`test_a_stuck_card_head_keeps_the_name_and_lets_its_annotations_scroll_out`,
at desktop width and a 311px touch card. It scrolls a long edited reply
past the card's top in steps and asserts the name and time stay put and
stay on top (including the gap between them) while the disclosure and
the edited label move with the reply's opening and leave, and that a
focused disclosure stays in the row. It fails without the change,
without the z-order, and without the gap cover. The thread snapshots and
chrome contracts pass unchanged.

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

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 23, 2026
The ring room added above the margin transcript in #3722 moved its
readable content edge 6 px below its scroll clip. The continuation fade
still measured sticky author heads from the clip edge, so it painted at
the wrong y position during scroll handoffs. Measure from the content
edge instead. The author test also sampled a known end-of-scroll gap as
though it held message text; keep the writer check when words are under
the head and recognize the narrow gap before the next visible writer,
the edge documented in #1763.

`test_the_thread_card_opens_on_its_latest_message_under_its_own_name`
failed on current `main` after #3722 and passed with this change; it
also passed with #3722's CSS temporarily removed, confirming the new
ring room as the cause. Both cases of
`test_a_stuck_card_head_keeps_the_name_and_lets_its_annotations_scroll_out`
passed locally. The runtime suite passed (533), `pnpm run check` passed,
and the committed kernel was rebuilt. Refs [run
39930571983](https://github.com/max-sixty/leaf/actions/runs/39930571983).

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