Skip to content

Conversation

@princeaden1
Copy link
Collaborator

@princeaden1 princeaden1 commented Nov 18, 2025

Edit Prompt and Copy Prompt functionality with full version tracking. When a user edits a message, a new version is created while the previous version is hidden. Users can navigate between versions using the version controls.

Key Changes

  • Added edit prompt flow with versioned message creation
  • Implemented copy prompt action
  • Ensured edited messages generate new version entries without modifying the original
  • Added UI logic for showing/hiding versions

Next Steps
Finalize E2E tests (to be completed in a follow-up PR)

Closes
(#1231) (#1636)

@princeaden1 princeaden1 marked this pull request as ready for review November 24, 2025 22:20
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.

2 issues found across 12 files

Prompt for AI agents (all 2 issues)

Understand the root cause of the following 2 issues and fix them.


<file name="src/components/chat/MessagesList.tsx">

<violation number="1" location="src/components/chat/MessagesList.tsx:92">
Guard the activeVersionsState entries (or reset them per chat) so that stale IDs from a different conversation cannot make visibleMessages empty when the selected message no longer exists.</violation>

<violation number="2" location="src/components/chat/MessagesList.tsx:165">
Use a stable identifier such as message.id as the key so React can correctly mount/unmount ChatMessage when the visible version changes.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

Copy link
Contributor

@wwwillchen wwwillchen left a comment

Choose a reason for hiding this comment

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

i think this is an interesting idea, but there's a lot of weird edge cases right now:

  • this PR breaks existing user chat messages - it doesn't render old user chat messages.
  • if you go to an earlier message, and then send a new message. the new message is added under the latest message, which is a confusing UX
  • if you edit a message, it doesn't undo the previous change.

if you look at what editors like Cursor do, I think their editing experience is more intuitive (and simpler).

  • if you edit, it effectively does a restore version to the state before that user message.
  • you can't cycle between the old and new versions.

i think chatgpt's UX makes sense b/c it's a pure chat environment but it gets very confusing once you deal with code.

wdyt?

@princeaden1
Copy link
Collaborator Author

@wwwillchen You're totally right, thanks for calling out those cases. I'm reworking the code now to align with your suggestion. I initially thought we could lean more toward the ChatGPT-style flow, but as you mentioned, that UX fits pure chat much better than an agentic/code-editing context.

I'll update the PR this week to reflect this direction.

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.

2 participants