Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Aug 25, 2025

Description

This PR fixes an issue where user messages were disappearing when selecting follow-up choices at choice prompts.

Problem

When users typed a message at a choice prompt and then selected a follow-up suggestion, their typed message was being cleared and lost. The message was not visible in the chat history and was not available in the up-key message history.

Solution

The fix preserves the user's input value in the text area after sending the follow-up choice message. This ensures that what the user typed remains visible and accessible.

Changes

  • Modified the handleFollowUpClick function in ChatView.tsx to preserve the input value when sending follow-up choices
  • Added inputValue to the dependency array of the handleFollowUpClick callback

Testing

  • Tested that user input is preserved when selecting follow-up choices
  • Verified that the message history works correctly
  • Confirmed that the fix doesn't affect other chat functionality

Fixes #7316

When users typed a message at a choice prompt and selected a follow-up suggestion,
their typed message was being cleared and lost. This fix preserves the user's input
value after sending the follow-up choice message, ensuring the text area retains
what the user typed.

Fixes #7316
@daniel-lxs daniel-lxs requested review from cte, jr and mrubens as code owners August 25, 2025 18:06
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Aug 25, 2025
Copy link
Contributor

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! I've reviewed the changes and found some critical issues that need to be addressed before this can be merged.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 25, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Aug 25, 2025
@hannesrudolph hannesrudolph added PR - Needs Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Aug 25, 2025
- Use inputValueRef to capture current input value instead of including it in the dependency array
- This prevents unnecessary re-creation of the handleSuggestionClickInRow callback on every keystroke
- Maintains the same functionality while improving performance
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 25, 2025
@mrubens mrubens merged commit 91f3dd9 into main Aug 25, 2025
13 checks passed
@mrubens mrubens deleted the fix/7316-preserve-message-at-choice-prompt branch August 25, 2025 21:18
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Aug 25, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer PR - Needs Review size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Messages at choices disappear.

4 participants