Make Ctrl+P toggle sent agent messages too - #1281
Open
snimu wants to merge 1 commit into
Open
Conversation
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 this does
Ctrl+Ptoggles agent-to-agent messages open and closed. Until now it only worked on messages the agent received — messages it sent stayed collapsed (they only opened together with the whole tool output viaCtrl+O). NowCtrl+Pexpands and collapses both sent and received messages together.Why
Sent and received messages are two halves of the same conversation. Having one key expand one half, and a different key (meant for tool output) expand the other, was confusing and inconsistent.
How it works
There was already a single "are agent messages expanded" switch behind
Ctrl+P. The sent-message display just wasn't connected to it — it was wired to the tool-output switch instead. The fix connects the sent-message display to the same switch the received messages use, and disconnects it from the tool-output one. So:Ctrl+Popens and closes all agent messages, sent and received.Ctrl+Ogoes back to meaning tool output only.Changes
Lines changed: source +32/−1, tests +47/−1, changelog +1/−0.
Checks
npm run checkclean.Note
Low Risk
UI-only expansion toggle fix with no auth, data, or protocol changes. Covered by updated unit and regression tests.
Overview
Ctrl+P now expands and collapses sent agent messages along with received ones. Previously, sent messages in IPython cells only opened with tool output via Ctrl+O.
Sent-message rendering in
IPythonCellComponentis switched from the tool-outputexpandedflag to a separateagentMessagesExpandedstate, and that state is threaded throughToolExecutionComponentand chat expansion so both message directions share the same toggle.Reviewed by Cursor Bugbot for commit 6046984. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Make Ctrl+P toggle expansion of sent agent messages independently of tool output
agentMessagesExpandedas an independent state flag inIPythonCellComponentso sent agent messages can expand/collapse separately from tool output expansion.ToolExecutionComponentgainssetAgentMessagesExpanded()to propagate the global agent message expansion state down to nested IPython cells.InteractiveMode.applyChatExpansionnow callssetAgentMessagesExpanded()on all supporting children when Ctrl+P is pressed, using a newhasAgentMessagesExpansiontype guard.agentMessagesExpandedsetting at construction time.Macroscope summarized 6046984.