fix(notices): render multi-line notices (e.g. /acp panel) without truncating - #593
Closed
ranxianglei wants to merge 1 commit into
Closed
fix(notices): render multi-line notices (e.g. /acp panel) without truncating#593ranxianglei wants to merge 1 commit into
ranxianglei wants to merge 1 commit into
Conversation
…ncating Extension ctx.ui.notify messages that span multiple lines (such as the billion-context-pi /acp status panel) were collapsed to a single line and truncated with an ellipsis because NoticeShelf rendered every notice in a fixed 60px, white-space:nowrap box. - Detect multi-line notices and render them with white-space:pre-wrap, a monospace font, auto height (scrollable, capped at 420px) so the full panel is readable. Single-line notices keep the existing toast styling. - Keep multi-line notices visible longer (30s vs 5s) so the panel can be read before it auto-dismisses.
Owner
|
#558 supersede |
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.
Problem
Extension
ctx.ui.notify(...)messages that span multiple lines are truncated to a single line in the notice shelf. The clearest example is the billion-context-pi/acpstatus panel (a ~15-line monospace block: context usage, sent-to-LLM, nudge state, blocks), which shows up as a one-line fragment ending in "…".Root cause
NoticeShelf(components/ChatWindow.tsx) rendered every notice in a fixedheight: 60box withwhiteSpace: "nowrap"+textOverflow: "ellipsis". Any message containing newlines was collapsed onto one line and clipped. Notices also auto-dismiss afterNOTICE_VISIBLE_MS(5s) — too short to read a multi-line panel even if it weren't clipped.The server side (
lib/rpc-manager.tsnotify) and the event wiring (hooks/useAgentSession.tscase "notify"→addNotice) were already correct — the panel reaches the browser; only the rendering clipped it.Fix
components/ChatWindow.tsx— detect multi-line notices (message.includes("\n")) and render them withwhiteSpace: "pre-wrap", a monospace font, auto height (scrollable, capped at 420px), and top alignment. Single-line notices keep the existing toast styling unchanged.hooks/useAgentSession.ts— add an optionalvisibleMstoNoticeItem; multi-line notices stay visible for 30s (MULTI_LINE_NOTICE_VISIBLE_MS) instead of 5s so the panel can be read. The dismiss timer now honors the oldest notice'svisibleMs.components/ChatWindow.notices.test.mjs— add a regression test for the multi-line rendering path.Verification
tsc --noEmit— cleannpm run lint— cleannpm test— 588 pass, 0 fail