- 
                Notifications
    
You must be signed in to change notification settings  - Fork 3.7k
 
Make it easy to edit messages in the CLI and to go back to an older message #8127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
          
 | 
    
| 
          
 ✅ Review Complete Code Review Summary | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 issues found across 11 files
Prompt for AI agents (all 3 issues)
Understand the root cause of the following 3 issues and fix them.
<file name="extensions/cli/src/ui/EditMessageSelector.test.tsx">
<violation number="1" location="extensions/cli/src/ui/EditMessageSelector.test.tsx:206">
This test does not exercise the cursor-positioning behavior—it only asserts a string literal’s length and will pass even if the bug regresses. Please remove or replace it with a real assertion on the TextBuffer/EditMessageSelector interaction.</violation>
</file>
<file name="extensions/cli/src/ui/hooks/useChat.edit.test.ts">
<violation number="1" location="extensions/cli/src/ui/hooks/useChat.edit.test.ts:37">
These tests reimplement handleEditMessage inline instead of invoking the real useChat logic, so they cannot catch regressions in the actual hook. Please drive the tests through the real implementation (e.g., render the hook or export a helper) rather than asserting against a local stub.</violation>
</file>
<file name="extensions/cli/src/ui/EditMessageSelector.tsx">
<violation number="1" location="extensions/cli/src/ui/EditMessageSelector.tsx:74">
Large edits that include a collapsed paste will submit the placeholder text because the edit path reads from textBuffer without first expanding paste placeholders. Please call textBuffer.expandAllPasteBlocks() before reading the buffer so the original content is restored before submission.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great! Only thing I noticed is that if you hold escape key it flashes in and out, but non blocking
| activePermissionRequest, | ||
| handleToolPermissionResponse, | ||
| handleUserMessage, | ||
| isWaitingForResponse, | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so many propssss
| 
           🎉 This PR is included in version 1.24.0 🎉 The release is available on: Your semantic-release bot 📦🚀  | 
    
| 
           🎉 This PR is included in version 1.28.0 🎉 The release is available on: Your semantic-release bot 📦🚀  | 
    
| 
           🎉 This PR is included in version 1.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀  | 
    
Description
Press Esc twice and go back in history to previous messages and edit them.
AI Code Review
@continue-reviewChecklist
Screen recording or screenshot
[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Summary by cubic
Adds a “Rewind and edit message” flow in the CLI chat. Open the edit selector with double Esc, pick a past user message, edit it, and the chat rewinds to that point and resubmits the change. Addresses Linear CON-4265 by improving message history UX.