Skip to content

feat: make intercom messages collapsible via ctrl+o#32

Open
RyanKim17920 wants to merge 1 commit into
nicobailon:mainfrom
RyanKim17920:feat/collapsible-intercom-messages
Open

feat: make intercom messages collapsible via ctrl+o#32
RyanKim17920 wants to merge 1 commit into
nicobailon:mainfrom
RyanKim17920:feat/collapsible-intercom-messages

Conversation

@RyanKim17920

Copy link
Copy Markdown

Summary

Intercom messages can now be collapsed/expanded with ctrl+o, piggybacking on the existing tool output expand/collapse infrastructure.

How it works

The CustomMessageComponent wrapper (in pi-core) already has setExpanded() and calls rebuild() when the expand state changes. When ctrl+o triggers setToolsExpanded(), it iterates all chat children and calls setExpanded on expandable ones — including CustomMessageComponent. setExpandedrebuild() → our message renderer is called again with { expanded }.

The InlineMessageComponent accepts a collapsed parameter. When tool outputs are collapsed (default), intercom messages render as a one-line preview. When expanded via ctrl+o, they show the full message box.

Changes

  • ui/inline-message.ts: Added collapsed constructor parameter. When true, renders a single-line preview with sender name, truncated message, and a (ctrl+o) hint.
  • index.ts: Updated the message renderer to read options.expanded and pass !options.expanded as collapsed state.

Behavior

State Tool outputs Intercom messages
Default (no ctrl+o) Collapsed Collapsed (one-line)
After ctrl+o Expanded Expanded (full box)
ctrl+o again Collapsed Collapsed

@RyanKim17920 RyanKim17920 force-pushed the feat/collapsible-intercom-messages branch 2 times, most recently from 947e664 to 65f7dd7 Compare May 29, 2026 02:01
Intercom messages now respect the tool output expand/collapse state via
ctrl+o. The InlineMessageComponent accepts a 'collapsed' parameter; when
true it renders a one-line preview instead of the full message box.

This works through CustomMessageComponent's existing setExpanded/rebuild
mechanism — when ctrl+o toggles toolOutputExpanded, the message renderer
is called with { expanded }, and intercom messages collapse inversely.
@RyanKim17920 RyanKim17920 force-pushed the feat/collapsible-intercom-messages branch from 65f7dd7 to f3a8c64 Compare May 29, 2026 02:16
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.

1 participant