Conversation
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.
| color: theme.tokens.interactive.chonky.embossed.danger.content, | ||
| surface: theme.tokens.interactive.chonky.embossed.success.background, | ||
| background: theme.tokens.interactive.chonky.embossed.success.chonk, | ||
| color: theme.tokens.interactive.chonky.embossed.success.content, |
There was a problem hiding this comment.
Danger button incorrectly uses success theme tokens
High Severity
The 'danger' case in getButtonTheme now references success tokens (theme.tokens.interactive.chonky.embossed.success.*) instead of danger tokens. This causes all danger buttons to render with success styling (likely green instead of red), completely inverting their visual meaning.
| return { | ||
| surface: theme.tokens.interactive.chonky.embossed.danger.background, | ||
| background: theme.tokens.interactive.chonky.embossed.danger.chonk, | ||
| color: theme.tokens.interactive.chonky.embossed.danger.content, | ||
| surface: theme.tokens.interactive.chonky.embossed.success.background, | ||
| background: theme.tokens.interactive.chonky.embossed.success.chonk, |
There was a problem hiding this comment.
Bug: Buttons with priority="danger" are incorrectly styled using success theme tokens, causing them to appear green instead of red.
Severity: HIGH
Suggested Fix
Revert the changes in static/app/components/core/button/styles.tsx. The danger case within the getButtonTheme function should use the theme.chonky.embossed.danger tokens for surface, background, and color properties to ensure buttons with priority="danger" are styled correctly.
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/core/button/styles.tsx#L284-L286
Potential issue: The code modification in `getButtonTheme` incorrectly maps the 'danger'
button type to use `chonky.embossed.success` theme tokens instead of the correct
`chonky.embossed.danger` tokens. This affects all buttons with `priority="danger"`,
which are used extensively throughout the application. As a result, buttons intended to
warn users about destructive actions will be rendered with green "success" styling,
completely inverting their semantic meaning and potentially misleading users into
performing irreversible actions.
Did we get this right? 👍 / 👎 to inform future reviews.


No description provided.