feat: make intercom messages collapsible via ctrl+o#32
Open
RyanKim17920 wants to merge 1 commit into
Open
Conversation
947e664 to
65f7dd7
Compare
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.
65f7dd7 to
f3a8c64
Compare
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.
Summary
Intercom messages can now be collapsed/expanded with
ctrl+o, piggybacking on the existing tool output expand/collapse infrastructure.How it works
The
CustomMessageComponentwrapper (in pi-core) already hassetExpanded()and callsrebuild()when the expand state changes. Whenctrl+otriggerssetToolsExpanded(), it iterates all chat children and callssetExpandedon expandable ones — includingCustomMessageComponent.setExpanded→rebuild()→ our message renderer is called again with{ expanded }.The
InlineMessageComponentaccepts acollapsedparameter. When tool outputs are collapsed (default), intercom messages render as a one-line preview. When expanded viactrl+o, they show the full message box.Changes
ui/inline-message.ts: Addedcollapsedconstructor parameter. Whentrue, renders a single-line preview with sender name, truncated message, and a(ctrl+o)hint.index.ts: Updated the message renderer to readoptions.expandedand pass!options.expandedas collapsed state.Behavior