Skip to content

Conversation

@tomasz-stefaniak
Copy link
Contributor

@tomasz-stefaniak tomasz-stefaniak commented Oct 7, 2025

Description

Press Esc twice and go back in history to previous messages and edit them.

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

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.

  • New Features
    • Edit Message Selector screen (“edit”): shows only user messages; navigate with ↑/↓ or j/k; Enter to edit; Esc to exit; Shift+Enter for newline.
    • Double Esc from the chat input opens the selector.
    • Rewind logic in useChat: truncate history to the selected message, clear queued messages and attachments, refresh static view, then resubmit edited content.
    • Wiring across TUIChat, ScreenContent, and UserInput to support the new flow.

@tomasz-stefaniak tomasz-stefaniak changed the title Tomasz/con 4265 Make it easy to edit messages in the CLI Oct 7, 2025
@tomasz-stefaniak tomasz-stefaniak changed the title Make it easy to edit messages in the CLI Make it easy to edit messages in the CLI and to go back to an older message Oct 7, 2025
@tomasz-stefaniak tomasz-stefaniak marked this pull request as ready for review October 7, 2025 23:07
@tomasz-stefaniak tomasz-stefaniak requested a review from a team as a code owner October 7, 2025 23:07
@tomasz-stefaniak tomasz-stefaniak requested review from RomneyDa and removed request for a team October 7, 2025 23:07
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Oct 7, 2025
@github-actions
Copy link

github-actions bot commented Oct 7, 2025

⚠️ PR Title Format

Your PR title doesn't follow the conventional commit format, but this won't block your PR from being merged. We recommend using this format for better project organization.

Expected Format:

<type>[optional scope]: <description>

Examples:

  • feat: add changelog generation support
  • fix: resolve login redirect issue
  • docs: update README with new instructions
  • chore: update dependencies

Valid Types:

feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

This helps with:

  • 📝 Automatic changelog generation
  • 🚀 Automated semantic versioning
  • 📊 Better project history tracking

This is a non-blocking warning - your PR can still be merged without fixing this.

@github-actions
Copy link

github-actions bot commented Oct 7, 2025

✅ Review Complete

Code Review Summary

⚠️ Continue configuration error. Please verify that the assistant exists in Continue Hub.


Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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.

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Oct 8, 2025
Copy link
Collaborator

@RomneyDa RomneyDa left a 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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so many propssss

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Oct 9, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 9, 2025
@tomasz-stefaniak tomasz-stefaniak merged commit 7318af4 into main Oct 9, 2025
67 of 70 checks passed
@tomasz-stefaniak tomasz-stefaniak deleted the tomasz/con-4265 branch October 9, 2025 19:25
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Oct 9, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2025
@sestinj
Copy link
Contributor

sestinj commented Oct 12, 2025

🎉 This PR is included in version 1.24.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor

sestinj commented Oct 14, 2025

🎉 This PR is included in version 1.28.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor

sestinj commented Oct 15, 2025

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm This PR has been approved by a maintainer released size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants