Skip to content

feat: submit on CMD/CTRL+Enter from the overall feedback textarea #113

Closed

Description

@blimmer

What's the problem?

The overall feedback textarea (GlobalCommentComposer) in the plan review UI does not respond to keyboard shortcuts. To submit the review, users have to take their hands off the keyboard, mouse to the submit button below the textarea, and click it. That break feels heavy for a tool whose workflow is "type a thought, send it," especially since per-annotation popovers (AnnotationPopover) already support CMD/CTRL+Enter to save via the useSubmitOnCmdEnter hook — so the inconsistency is felt every time a reviewer adds an inline comment, then drops to the bottom box and reaches for the mouse.

Proposed solution

When the overall feedback textarea (packages/annotation/src/GlobalCommentComposer.tsx) has focus, CMD+Enter (macOS) / CTRL+Enter (Linux/Windows) should trigger the same submit action as clicking the submit button — i.e. invoke whatever the submit button would do in its current state (the label and behavior already track state per plan-review-design.md's "one contextual button" rule: it accepts when there is no feedback, requests changes when there is).

Implementation sketch:

  • Reuse the existing useSubmitOnCmdEnter hook from packages/annotation/src/useSubmitOnCmdEnter.ts — same pattern used by AnnotationPopover.tsx:43.
  • Wire submission.submit (the same callback used by SubmitBar's onClick) into the textarea's onKeyDown.
  • Respect the existing disabled state — do not fire when submission.submitted or submission.submitting is true (matches the submit button's disabled logic in SubmitBar.tsx:62).
  • Add a vitest browser-mode test alongside useSubmitOnCmdEnter.test.ts / the existing App tests covering: (a) CMD+Enter submits when textarea is focused, (b) CTRL+Enter submits when textarea is focused, (c) no submit while submitting/submitted, (d) plain Enter still inserts a newline.

The shortcut should only fire while the textarea is focused (per the user's request) — no global document-level listener.

Alternatives you considered

  • Global hotkey that submits regardless of focus. Rejected: surprises users who are typing inside an inline annotation popover, where CMD+Enter already means "save this annotation."
  • Plain Enter to submit (Slack/iMessage style). Rejected: the textarea explicitly supports multi-line feedback and the placeholder ("Add overall feedback…") invites prose — stealing Enter for submit breaks paragraph entry.

Additional context

Today's CMD+Enter wiring for reference:

  • Hook: packages/annotation/src/useSubmitOnCmdEnter.ts
  • Existing consumer: packages/annotation/src/AnnotationPopover.tsx:43,108
  • Target component: packages/annotation/src/GlobalCommentComposer.tsx
  • Submit pipeline (the callback to invoke): SubmissionState.submit in packages/annotation/src/SubmitBar.tsx:12

Activity

  1. added
    enhancement
    on May 14, 2026
  2. added a commit that references this issue on May 14, 2026
    21b14a1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions