Skip to content

feat(autofix): Disable rethink button when textarea empty and allow submit on Enter#112896

Open
aliu39 wants to merge 4 commits intomasterfrom
aliu39/feat/autofix-rethink-textarea-improvements
Open

feat(autofix): Disable rethink button when textarea empty and allow submit on Enter#112896
aliu39 wants to merge 4 commits intomasterfrom
aliu39/feat/autofix-rethink-textarea-improvements

Conversation

@aliu39
Copy link
Copy Markdown
Member

@aliu39 aliu39 commented Apr 14, 2026

Improves the rethink textarea UX in the autofix next-step flow:

  • The "Rethink" submit button is now disabled when the textarea is empty or whitespace-only, preventing no-op submissions.
  • Pressing Enter (without Shift) while the textarea is focused submits the rethink, matching chat-style submit conventions. Shift+Enter still inserts a newline.

Disable the rethink submit button when user context is blank/whitespace.
Also allow submitting by pressing Enter (without Shift) while the textarea
is focused, matching typical chat-style submit conventions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 14, 2026
@aliu39 aliu39 marked this pull request as ready for review April 14, 2026 06:10
@aliu39 aliu39 requested a review from a team as a code owner April 14, 2026 06:10
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b1c2adc. Configure here.

Comment thread static/app/components/events/autofix/v3/nextStep.tsx
@sentry
Copy link
Copy Markdown
Contributor

sentry Bot commented Apr 14, 2026

Sentry Snapshot Testing

Name Added Removed Modified Renamed Unchanged Status
sentry-frontend
sentry-frontend
0 0 0 0 204 ✅ Unchanged

@aliu39 aliu39 enabled auto-merge (squash) April 15, 2026 00:37
@aliu39 aliu39 disabled auto-merge April 15, 2026 00:37
@aliu39 aliu39 enabled auto-merge (squash) April 15, 2026 00:38
@aliu39 aliu39 changed the title feat(autofix): Disable rethink button when empty and submit on Enter feat(autofix): Disable rethink button when textarea empty and allow submit on Enter Apr 15, 2026
@aliu39 aliu39 disabled auto-merge April 29, 2026 03:37
@getsantry
Copy link
Copy Markdown
Contributor

getsantry Bot commented May 6, 2026

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.44%

size="xs"
icon={<IconRefresh size="xs" />}
aria-label={t('Re-run from here')}
disabled={!userContext.trim()}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The "Re-run from here" button in AutofixResetPrompt is disabled by default, preventing users from re-running a step without providing new context, which is a valid action.
Severity: MEDIUM

Suggested Fix

The "Re-run from here" button should be enabled even when the user context input is empty. Remove the disabled={!userContext.trim()} check from the button to allow re-running without providing additional context, which is consistent with the handleReset function's optional parameter.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: static/app/components/events/autofix/v3/autofixResetPrompt.tsx#L50

Potential issue: In `AutofixResetPrompt`, the `userContext` state is initialized as an
empty string. The "Re-run from here" button's `disabled` attribute is tied to
`!userContext.trim()`, which makes the button disabled by default when the prompt opens.
This prevents users from re-running an autofix step without providing additional
context, a use case that is supported by the `handleReset` function which accepts an
optional context. Once the reset prompt is open, the card-level refresh button is also
disabled, trapping the user in a state where they must either type something or close
the prompt to proceed.

Did we get this right? 👍 / 👎 to inform future reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant