Open
Conversation
1b8743b to
e113b00
Compare
Comment on lines
+293
to
+295
| surface: theme.tokens.interactive.chonky.embossed.success.background, | ||
| background: theme.tokens.interactive.chonky.embossed.success.chonk, | ||
| color: theme.tokens.interactive.chonky.embossed.success.content, |
Contributor
There was a problem hiding this comment.
Bug: The getButtonTheme function incorrectly returns success theme colors for the danger case, causing buttons for destructive actions to appear green instead of red.
Severity: HIGH
Suggested Fix
In the case 'danger': block within the getButtonTheme function, change the theme token references from theme.tokens.interactive.chonky.embossed.success back to theme.tokens.interactive.chonky.embossed.danger for the surface, background, and color properties.
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#L293-L295
Potential issue: In the `getButtonTheme` function, the `case 'danger':` block has been
modified to return theme tokens associated with 'success' instead of 'danger'. This will
cause all buttons with `priority="danger"`, which are used for destructive actions like
deleting projects or revoking keys, to be rendered with green "success" colors instead
of the expected red "danger" colors. This affects over 170 instances in the codebase,
creating a significant user experience and safety issue by visually misrepresenting the
consequence of critical actions.
Did we get this right? 👍 / 👎 to inform future reviews.
e113b00 to
1b346eb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Forcing a snapshot diff, just as an example