Skip to content

Show a reply the user waits for at once in the floating panel's thread - #2892

Merged
max-sixty merged 4 commits into
mainfrom
floating-answer-at-once
Oct 14, 2026
Merged

max-sixty merged 4 commits into
mainfrom
floating-answer-at-once

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

When the agent answered in a thread open in the floating panel, its reply waited behind a small grey "1 new reply" in the head row of the user's own message (the held-news rule: news in an open thread moves nothing at its head). The user chose to have a reply they are waiting for show at once (proposal "A reply you're waiting for shows at once"), which reverses that call; the panel's header records the decision.

What counts as the answer. difference() in thread/held-news.js now says whether news answers the user: everything it joins or changes lies after the user's last turn as drawn (the reply, the work under way on it, and that work's fold), with no edit, reaction, settlement, summary or turn of the user's own among it. A primary reader created with answersAtOnce (thread/mirrors.js, passed through registerChromeThreadPresentation) hands such news to its presentation instead of holding it. Only the floating panel sets it. Other news in an open thread is still held: an edit to an earlier message, a reply after the agent's own turn, a reaction.

How the panel shows it without moving the head. Growing the view to show the reply would carry its head and every message up without a gesture, which the Stability rule forbids and the shift watch fails. So while the user's own turn ends the thread, the view holds the height it stands at (fitAnswer, read in a ResizeObserver after layout and before the frame is shown):

  • Where the answer fits in that height and the user stood at the view's end, the end follows it into sight, the earlier words scrolling up, as a card's transcript follows a turn joining its end. A streaming answer is read the same way on each growth.
  • Otherwise it waits below the fold, and a New reply press stands at the view's foot, where the answer begins. A press grows the view (up to its cap), brings the answer's start into sight and leaves the user standing on the thread; scrolling there takes the press away.

A view holding one short comment is about 90px tall, less than any agent message with its head row, so there the answer always waits behind New reply. Showing it at once there needs the view to grow without a gesture, which only an exception to the Stability rule allows.

Tests: test_an_answer_the_user_waits_for_shows_at_once_where_it_fits, test_a_streaming_answer_follows_into_sight_until_it_outgrows_the_view and test_new_reply_leads_to_the_reply_once_one_follows_the_work (new; each fails without the change) cover both cases, a streaming answer and its completion, work under way followed by the reply, that nothing at the head moves, and that a reply after the agent's own turn is still held. test_the_thread_walk_stands_on_each_thread_it_opens now shows its long answer through New reply. test_a_thread_s_view_is_as_tall_as_its_messages drops the held-reply step, which no longer happens there.

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

The agent's answer to the user's own last turn waited behind a small grey
"1 new reply" in the head row of the user's own message. The user chose to
have it show at once (2026-10-14), reversing that hold; the panel's header
and held-news.js record the decision.

- held-news.js: difference() says whether news answers the user (all of it
  after the user's last turn as drawn); a primary reader created with
  answersAtOnce (mirrors.js, through registerChromeThreadPresentation) hands
  it over instead of holding it. Only the floating panel asks. Other news in
  an open thread is still held.
- floating-panel.js: while the user's turn ends the thread the view holds its
  height, so the answer lands inside it and nothing at its head moves. Where
  it fits and the user stood at the end, the end follows it into sight;
  otherwise New reply stands at the view's foot, and a press grows the view
  and brings the answer's start into sight. Growing the view at once was
  rejected: it moves the head and every message without a gesture
  (Stability; the shift watch fails it).

Tests: test_an_answer_the_user_waits_for_shows_at_once_where_it_fits is new;
the thread walk now shows its long answer through New reply; the view-height
journey drops the held-reply step.

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.

A streaming answer can grow out of sight without a way to reveal it. In fitAnswer, fresh contains only new message keys. After a short provisional reply first appears, later stream updates keep that key, so this branch neither follows the growing answer nor adds “New reply” while rooms keeps the view fixed. I reproduced this in the floating panel: after the stream grew, the message ended at y=1546, the view ended at y=842, and there was no reveal button. Please apply the fit/reveal decision to growth of the answer already being drawn as well as to newly appended messages.

Review: an answer that first appeared short and then grew as it streamed kept
its key, so it was no new message, and grew out of sight under the held view
with no way to reveal it. fitAnswer now reads the answer as everything after
the user's last turn and decides on each growth of it.

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.

The fit/reveal decision still misses a stream’s final answer when it replaces the provisional message with longer text.

…the stream

Review: once the durable answer replaced the provisional message, it was no
longer provisional, so its longer words fell outside the fit decision. Whether
a message was still coming is now judged as it was drawn.

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.

The reveal control keeps pointing at progress after the answer arrives. I reproduced this by opening the thread on a user's turn, letting a long progress message create “New update,” then posting a long durable answer. The button still said “New update”; pressing it scrolled to the progress message while the answer began below the view. In fitAnswer, !waiting prevents the new answer from updating waiting.message and its label, and showAnswer later scrolls to that old key. Please retarget the pending reveal to the current answer as it changes so the press reaches the reply.

Review: work under way that did not fit set New update, and the reply that
followed left the press pointing at the work. The press now follows the
answer as it changes, and an answer folding its work into less room keeps the
view as it stands.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit b309b38 into main Oct 14, 2026
3 checks passed
@max-sixty
max-sixty deleted the floating-answer-at-once branch October 14, 2026 21:16
max-sixty added a commit that referenced this pull request Oct 14, 2026
#2889 merged after #2892 and its neighbors changed runtime modules, so
main's committed kernel no longer matches its modules: `pnpm run
check:browser` fails on main and installs fall back to source modules
until this lands. This is `pnpm run build:browser` on main, kernel files
only.

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

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 14, 2026
… floating panel (#2902)

In the floating panel, the line over the field (`.lf-fp-context`, #2885)
and New reply (#2892) both stood over an open view's foot with no room
of their own. The line reached 12px into the view, 6px past its padding,
so at a long thread's end its last line ran into "Claude replied". New
reply stuck over whatever the view ended with, so in a thread whose
answer waited below the fold it sat on the user's own last turn ("And
the weekend?").

- **One room at the view's foot.** The view's bottom padding is now the
room the line lies in (`--lf-fp-foot-room`: the line's 18px less the
row's 6px), kept whether or not the line shows. The line's coming still
moves nothing at the view's head, and the view's last words always
scroll clear of it. A view now keeps 12px rather than 6px under its last
words, well short of the blank line #2885 removed.
- **New reply on the panel's ground.** The press stands on a sticky
strip (`.lf-fp-foot`) that fades in above it and runs down through that
room, so the press and the line read as one foot, and text passing under
reads as under a layer. At the view's end the strip stands where it
stuck, in flow below the answer.
- **The user's last turn stays in sight.** Where the user stood at the
view's end when an answer arrives that doesn't fit, the view scrolls by
the room the strip takes (`fitAnswer`). That scroll is the panel's own,
so `sawAnswer` doesn't count it as the user reaching the answer, and New
reply stays.

Tests: `test_nothing_in_a_view_stands_under_the_line_or_new_reply` (new)
holds that the last words' text box clears the line's and the press's
boxes at the end of a long Threads list and a long thread the user types
in, and that the user's own turn clears both while an answer waits. It
fails without the change at the long thread's end, and at the held reply
without the scroll. The Threads and one-message height checks now
measure against a row's height and the foot room instead of fixed pixel
bounds the extra 6px crossed.

The kernel (#2889) is rebuilt for the runtime change.

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

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 15, 2026
…or (#2916)

Reverses #2892's hold. While the user's own turn ended a thread, its
view held the height it stood at, so the agent's answer landed inside
it; in a one-comment thread that view was one message tall, so the
answer waited behind New reply, the user's own message header scrolled
under the head, and a sliver of the answer showed under the press. The
user chose to let the view grow for this one case, an exception to the
stability rule and the shift watch, recorded where the rule lives.

- **The view grows for the answer.** The answer to the user's last turn,
work under way and a reply streaming included, grows the view up to its
cap (`--lf-fp-view-height`): the field stays put and the head rises.
Only past the cap does New reply appear. The thread view no longer holds
a room at all, so `fitAnswer` loses its hold and release branches.
- **What stands behind New reply looks intentional.** The user's turn
stays wholly in sight above the press, header first where it is taller
than the room. New reply's sticky strip now sticks at the view's edge
(`bottom: -6px`): a sticky box sticks at its scroller's content edge,
inside the padding, which let the answer show through below the press.
- **The exception is recorded and scoped.**
`skills/leaf/assets/AGENTS.md` ("Stability") names it. The shift watch
credits a scrollport that declares it stands on its foot
(`data-lf-rises`, only the panel's thread view) rising at its head with
its `append` region's growth, by no more than it, carrying what it holds
and what stands above it in the boxes that rise with it
(`appendGrowth`). The panel's outlet declares `append`, and the primary
reader marks a reply still streaming at the thread's end as its growing
tail, as thread cards do. A carried text may change its words as it goes
(a message's "Sent" becoming its next state), so its fragment's end edge
is no longer compared.

Tests: `test_an_answer_the_user_waits_for_grows_the_view_up_to_its_cap`
replaces `..._shows_at_once_where_it_fits`: the view grows with the head
rising by the same distance and the field still; past the cap the view
stands at its cap, the user's turn is wholly in sight above New reply,
and New reply's ground reaches the view's foot. The streaming test now
holds that each step grows the view with the head rising and the end in
sight. The thread-walk and New update tests use answers longer than the
cap. `test_append_growth_may_raise_a_port_standing_on_its_foot` covers
the credit and its limits: undeclared region or port, an extra move of
the head, a port rising past the growth, and a stand outside the runtime
all fail; a carried text changing its words passes. Each fails without
the change. The selection also ran with the watch's VERIFY = 1.

> _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