Skip to content

fix: Show inline error on Commit input for empty messages - #179

Merged
Ziinc merged 5 commits into
mainfrom
cursor/commit-empty-message-error-ecd3
Aug 7, 2026
Merged

fix: Show inline error on Commit input for empty messages#179
Ziinc merged 5 commits into
mainfrom
cursor/commit-empty-message-error-ecd3

Conversation

@Ziinc

@Ziinc Ziinc commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Empty commit messages previously only showed a toast, which was easy to miss.
  • CommitInput now validates before dispatching: empty/whitespace messages show an inline destructive alert under the textarea (aria-invalid + red border), focus the field, and do not call the commit handlers.
  • The error clears as soon as the user starts typing.

Screenshots

Before (empty Message, no error):
Commit input before empty-message error
After clicking Commit with empty message:
Commit input showing inline empty-message error

Test plan

  • Unit tests in CommitInput.test.tsx cover empty, whitespace, clear-on-type, successful trim, and commit-and-push empty path
  • Screenshot QA (commit-empty-message.spec.tsx) confirms red border + “Enter a commit message.” under Message
  • Click Commit with empty message in Review tab — see inline error under the Message field
  • Type a message — error clears; Commit succeeds
  • Empty Commit and push from the split-button menu shows the same inline error
    To show artifacts inline, enable in settings.
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 6, 2026 22:09
Toast-only feedback was easy to miss. Validate in CommitInput before
dispatching, surface a destructive inline alert on the textarea, and
clear it as soon as the user starts typing.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Captures before/after Review sidebar state when Commit is clicked
with an empty Message field to verify the inline destructive feedback.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
@cursor

cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

Why the change lives in CommitInput

Validation is in the input component (not only performCommit) so empty Commit / Commit and push / Cmd+Enter share one path and the error sits on the field. Toast-only feedback was easy to miss next to the Message box; aria-invalid + destructive border + role="alert" text under the textarea match the dialog error pattern elsewhere. performCommit still toasts as a safety net for non-UI callers.

Screenshot QA: commit-empty-message-01-before / 02-error confirm the red border and “Enter a commit message.” appear under Message after clicking Commit empty.

@Ziinc
Ziinc marked this pull request as ready for review August 7, 2026 13:42
@Ziinc Ziinc changed the title Show inline error on Commit input for empty messages fix: Show inline error on Commit input for empty messages Aug 7, 2026
cursoragent and others added 2 commits August 7, 2026 17:39
tsc (noUnusedLocals) failed CI because the test file imported React
without using it under the automatic JSX runtime.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
@Ziinc
Ziinc merged commit 0911f15 into main Aug 7, 2026
7 checks passed
@Ziinc
Ziinc deleted the cursor/commit-empty-message-error-ecd3 branch August 7, 2026 18:22
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