Skip to content

fix(notices): render multi-line notices (e.g. /acp panel) without truncating - #593

Closed
ranxianglei wants to merge 1 commit into
agegr:mainfrom
ranxianglei:fix/multiline-notice-rendering
Closed

fix(notices): render multi-line notices (e.g. /acp panel) without truncating#593
ranxianglei wants to merge 1 commit into
agegr:mainfrom
ranxianglei:fix/multiline-notice-rendering

Conversation

@ranxianglei

Copy link
Copy Markdown

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 /acp status 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 fixed height: 60 box with whiteSpace: "nowrap" + textOverflow: "ellipsis". Any message containing newlines was collapsed onto one line and clipped. Notices also auto-dismiss after NOTICE_VISIBLE_MS (5s) — too short to read a multi-line panel even if it weren't clipped.

The server side (lib/rpc-manager.ts notify) and the event wiring (hooks/useAgentSession.ts case "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 with whiteSpace: "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 optional visibleMs to NoticeItem; 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's visibleMs.
  • components/ChatWindow.notices.test.mjs — add a regression test for the multi-line rendering path.

Verification

  • tsc --noEmit — clean
  • npm run lint — clean
  • npm test — 588 pass, 0 fail

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

agegr commented Aug 25, 2026

Copy link
Copy Markdown
Owner

#558 supersede

@agegr agegr closed this Aug 25, 2026
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