Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions static/app/components/core/button/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,9 @@ function getButtonTheme(type: ButtonType, theme: Theme) {
};
case 'danger':
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,
color: theme.tokens.interactive.chonky.embossed.success.content,
Comment on lines +285 to +287
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 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.

};
case 'transparent':
return {
Expand Down
Loading