Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Dec 27, 2025

Related GitHub Issue

Closes: #10350

Description

This PR attempts to address Issue #10350. Feedback and guidance are welcome.

Problem: When Roo shows action approval buttons (like Approve/Save/Run Command), pressing Enter with text would reject the action instead of approving it.

Solution: Added a new onAccept callback prop to ChatTextArea that gets triggered when action buttons are visible. When onAccept is provided, the Enter key handler uses it instead of onSend.

Behavior changes:

Scenario Before After
Empty input + action buttons visible Nothing happened Approves the action
Text input + action buttons visible Rejected the action Approves with text as feedback

Implementation details:

  • Added onAccept?: () => void prop to ChatTextArea interface
  • Modified handleKeyDown to use onAccept when provided (via nullish coalescing: const actionHandler = onAccept ?? onSend)
  • In ChatView, onAccept is conditionally set when enableButtons && primaryButtonText is truthy, calling handlePrimaryButtonClick with current input values

Test Procedure

  1. Manual testing:

    • Start a task that requires approval (e.g., file edit)
    • With empty input, press Enter - should approve
    • Type some feedback, press Enter - should approve with feedback
  2. Automated tests:

    • All existing tests pass:
      • ChatTextArea.spec.tsx: 47 tests passed
      • ChatView.spec.tsx: 23 tests passed
      • ChatView.keyboard-fix.spec.tsx: 4 tests passed
    • TypeScript compilation: No errors

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates

  • No documentation updates are required.

Additional Notes

This is a UX improvement that aligns Enter key behavior with common expectations - Enter confirms/approves the current action.

When action approval buttons are visible (like Approve/Save/Run Command):
- Empty input + Enter: now approves the action (previously did nothing)
- Text input + Enter: now approves with the text as feedback (previously rejected)

This change makes the Enter key behavior more intuitive:
- Enter always confirms/approves the current action
- Users can still provide optional feedback text before approving

Fixes #10350
@roomote
Copy link
Contributor Author

roomote bot commented Dec 27, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The implementation is clean and follows existing codebase patterns. The onAccept callback prop is properly added to ChatTextArea and conditionally provided from ChatView when action buttons are visible. The Enter key behavior now correctly approves actions instead of rejecting them, addressing the UX issue in #10350.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] The enter button should work as approval, not denial.

3 participants