Repository navigation
Agent replies clamp from the tail: show the end, Show more at the top - #589
Merged
Merged
Conversation
A long assistant bubble now shows its LAST ~15 lines with the fade and "Show more" at its top; opening it grows the earlier text upward while the log's scroll follows the growth, so the end stays where it was on screen. The reader's own messages and kickoffs stay head-first; relayed plugin mail is a relay row (no bubble) as before. Both directions show about 15 lines (was 12). - chatBubbleOf declares the direction from the role (clampFrom: data-clamp-from="tail" for "assistant"), so the agent chat page, the chief panel and the mirrored Claude Code and opencode views all agree; the agent chat's live bubble() spells the same rule. Nothing reads the text to decide. - bubbleClampScript pins a closed tail bubble's own box to its end, puts its control before it (data-clamp-toggle="tail"), anchors the end while opening, and re-pins when a code block inside it is toggled. - The chief panel body now includes the clamp script (ahead of agentChatScript); its frame still does not. - Boundary, documented: a transcript that does not fill its log has nothing to scroll, so there the end moves down into the empty space (and stays on screen) before the log can follow. Tests: Go unit tests on every surface's rendered HTML; a new tail-clamp.spec.ts at 390x844 (touch) and 1280x800 covering the mirrored view, the agent chat page and the chief panel, stay-open across a refresh, the mid-log case, the fits-on-screen boundary and a layout-shift check; mirror-chat.spec.ts updated for 15 lines and the tail direction. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owner
Author
|
Round 0 (requirements & deletion) — |
Owner
Author
|
Round 1 (nine axes) at 431b4f8: 0 🔴, 2 🟡, 2 🟢 — the ladder ends here. Three mutations re-run independently (clampFrom never tail; chief panel without the script; script after agentChatScript): all killed; a fourth (tail() returns false, string kept) survived the Go tests (finding 4). Operator decision on finding 1: bottom-align short chats. All four fixed in a final commit (not re-audited). |
…comment and test fixes - Chat logs are bottom-aligned (operator decision): a transcript shorter than its log sits at its bottom, by the composer, on #mv-log and on #chat-log (agent chat page and chief panel). A zero-height ::before flex item takes the free space (margin-bottom:auto) and cancels the log's gap with its margin-top, so a full log is laid out exactly as before and the rule does not depend on what the first child is. With it a tail reply in a short transcript opens with its end in place too: the documented "short log" limit is gone, and its test is replaced by one that pins the end within 2px there (and the bottom alignment on both surfaces). TestTheChatLogsGapMatchesTheBottomAlignRule pins the gap coupling. - A code block opened in the MIDDLE of a closed tail reply no longer re-scrolls the bubble to its end: a tap on its summary marks the bubble off its end before it opens (the re-measure its new width triggers can run before 'toggle'), and a re-measure leaves a marked bubble's scroll alone. Only the LAST block re-pins, never past its own summary. New e2e: the tapped summary stays on screen and in place. - The Show less comment now says what happens: the control stays in place away from the log's end, and within stick-to-bottom's reach the end stays and the control moves down by what the bubble shrank. - TestTheClampScriptReadsTheServersDirection removed: it only spelled strings; the e2e cases are the guard for the direction. - mirror-chat's queued-message case now uses a transcript that really scrolls (its scrollTop = 200 was a no-op, which passed only because short logs were top-aligned). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s its box With chat logs bottom-aligned, a reply arriving in a log SHORTER than its box moves every earlier bubble up by its height (a messaging app's behaviour), which the Layout Instability API counts: CI measured 0.018 at 390px on this case's two-message fixture (e2e leg 2 on f10623e). The case guards the RESTORE, so it now appends a dozen short pairs first (control: the log scrolls); in a full log stuck to its end the reply that came meanwhile scrolls in, which is no shift. Green at 390px and 1280px locally. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ZacxDev
marked this pull request as ready for review
November 11, 2026 05:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Long agent replies are now clamped from the tail. The bubble shows its last ~15 lines, the fade is at the top, and Show more sits at the top of the bubble. Opening it reveals the earlier text above, and the end stays where it was on screen: the log's scroll follows the bubble's growth on every animation frame. Show less is also at the top. The user's own messages and kickoffs still clamp head-first, as before. Relayed plugin mail is still a relay row, not a bubble. Both directions now show about 15 lines (was 12).
The rules that already held still hold:
data-msg-id;How
chatBubbleOfaddsdata-clamp-from="tail"forassistant(clampFrom). Every surface draws through it: the agent chat page, the chief panel, and the mirrored Claude Code and opencode views (opencode becomes the same events). The agent chat's livebubble()follows the same rule in JS.bubbleClampScriptchanges:data-clamp-toggle="tail".<details>) inside it is toggled.to top) for[data-clamp-from="tail"][data-clamp="closed"].agentChatScript. Its frame, which every page loads, still does not.::beforeflex item takes the free space, so a full log is laid out exactly as before. Because of this, a reply in a short transcript also opens with its end in place.bfcache-restore"the Rendered view restored at 390px does not shift". That case guards the restore, so its fixture now fills the log first (with a check that the log scrolls). The bar is unchanged.docs/mirroring.mdnow describes the clamp.Tests
Go:
TestAnAgentReplyIsClampedFromItsTailOnEverySurfacechecks the rendered HTML of the agent chat page, the chief panel body, and the mirrored Claude Code and opencode views. Replies are tail-first; user messages and kickoffs are not; relay rows are not bubbles. It also checks the livebubble().TestTheChiefPanelBodyCarriesTheBubbleClampreplaces the old "no clamp" test.TestTheChatLogsGapMatchesTheBottomAlignRulepins the bottom-align rule's coupling to the logs'gap-3.e2e
tail-clamp.spec.ts(new, leg 2) runs at 390×844 with touch and at 1280×800, both set in the spec. On the mirrored view, the agent chat page and the chief panel:Other cases in the same spec:
#chat-logrefresh;mirror-chat.spec.tsis updated for 15 lines, for the tail control that now sits next to a short user bubble, and for the code-block fixture (the block moved to the end of the reply).Red/green
Round 1 (at
f10623ee): the new short-transcript, bottom-alignment and mid-reply code-block e2e cases (6, both widths) are red at431b4f8cand green at the head; so isTestTheChatLogsGapMatchesTheBottomAlignRule.TestTheClampScriptReadsTheServersDirectionwas removed: it only checked for strings.Round 0:
At
origin/main(2b469c0), with the new tests copied in:mirror-chat"a long bubble is clamped…" fails (15-line bound).At the head, all of them pass. The related specs were also run locally and are green:
mirror-chat,agent-chat-markdown,chief-fold-in,chief-thread-searchandattention-delivery.Mutations
Each mutant was applied at the head, the tests were run, and the file was restored (checked by sha256).
data-clamp-toggle="tail"on the preceding sibling), on all surfacesTestTheChiefPanelBodyCarriesTheBubbleClamp🤖 Generated with Claude Code