Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Dec 27, 2025

Summary

This PR attempts to address Issue #10350. When action buttons (like Approve/Reject, Save/Reject, Run/Reject) are visible, pressing Enter now triggers the primary button action (approval) instead of denial.

Changes

  • ChatTextArea.tsx: Added two new optional props enablePrimaryButton and onPrimaryButtonClick. Modified the Enter key handler to call onPrimaryButtonClick when the primary button is enabled.

  • ChatView.tsx: Pass enablePrimaryButton and onPrimaryButtonClick props to ChatTextArea component.

Behavior Change

Scenario Previous Behavior New Behavior
Enter with empty input + buttons visible Nothing happens Triggers primary button (Approve/Save/Run)
Enter with text + buttons visible Sends message as rejection Approves AND sends text as feedback
Enter with images + buttons visible Sends images as rejection Approves AND sends images as feedback
Enter with text+images + buttons visible Sends content as rejection Approves AND sends all content as feedback
Enter when no buttons visible Sends message normally Unchanged

Testing

  • All existing tests pass (70 tests in ChatTextArea.spec.tsx and ChatView.spec.tsx)
  • TypeScript type checking passes
  • ESLint passes with no warnings

Feedback and guidance are welcome!

…uttons are visible

When action buttons (Approve/Reject, Save/Reject, Run/Reject) are visible:
- Enter now triggers the primary button action (Approve/Save/Run)
- Any content (text and/or images) in the input is sent along with the approval

This aligns with common UX patterns where Enter confirms/accepts the current action.

Closes #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 correctly adds the new behavior where Enter key triggers the primary button action (approval) when action buttons are visible. The changes:

  • Add two new optional props (enablePrimaryButton and onPrimaryButtonClick) to ChatTextArea
  • Modify the Enter key handler to call the primary button callback when enabled
  • Pass the appropriate props from ChatView to ChatTextArea

The existing behavior is preserved when action buttons are not visible.

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.

3 participants