feat(autofix): Disable rethink button when textarea empty and allow submit on Enter#112896
feat(autofix): Disable rethink button when textarea empty and allow submit on Enter#112896
Conversation
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>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
Sentry Snapshot Testing
|
|
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 "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
📊 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()} |
There was a problem hiding this comment.
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.

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