From 8886af66049c6cab9c1f02df1deadd4f5eb47335 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Mon, 4 May 2026 13:46:57 -0400 Subject: [PATCH 1/2] ref(button-variant): remove deprecated priority prop from Button Remove the `priority` prop, `ButtonPriority` type, and `DO_NOT_USE_resolveButtonVariant` resolver from the Button component. All callers should use `variant` instead. Blocked by the four codemod(button-variant) PRs landing first. Co-Authored-By: Claude Opus 4.6 --- .../components/core/button/button.figma.tsx | 6 ++-- .../core/button/button.snapshots.tsx | 18 ++++++------ static/app/components/core/button/styles.tsx | 5 ++-- static/app/components/core/button/types.tsx | 29 ------------------- .../core/button/useButtonFunctionality.tsx | 2 +- .../segmentedControl/segmentedControl.tsx | 2 +- .../app/components/core/trackingContext.tsx | 2 +- static/app/components/dropdownButton.tsx | 4 +-- 8 files changed, 18 insertions(+), 50 deletions(-) diff --git a/static/app/components/core/button/button.figma.tsx b/static/app/components/core/button/button.figma.tsx index 0621574f892096..dfac4e2f2339dd 100644 --- a/static/app/components/core/button/button.figma.tsx +++ b/static/app/components/core/button/button.figma.tsx @@ -14,8 +14,8 @@ figma.connect( 'https://www.figma.com/design/eTJz6aPgudMY9E6mzyZU0B/%F0%9F%90%A6-Components?node-id=384-2119&t=pFp9KphF6dQ7XjDm-0', { props: { - priority: figma.enum('priority', { - default: 'default', + variant: figma.enum('priority', { + default: 'secondary', primary: 'primary', danger: 'danger', warning: 'warning', @@ -34,7 +34,7 @@ figma.connect( children: figma.textContent('Children'), }, example: (props: ButtonProps) => ( - ), diff --git a/static/app/components/core/button/button.snapshots.tsx b/static/app/components/core/button/button.snapshots.tsx index 041d33cdcd445b..3166a36df39a50 100644 --- a/static/app/components/core/button/button.snapshots.tsx +++ b/static/app/components/core/button/button.snapshots.tsx @@ -8,8 +8,8 @@ import {darkTheme, lightTheme} from 'sentry/utils/theme/theme'; const themes = {light: lightTheme, dark: darkTheme}; -const allPriorities: Array = [ - 'default', +const allVariants: Array = [ + 'secondary', 'primary', 'danger', 'warning', @@ -32,20 +32,20 @@ describe('Button', () => { ); } - describe.each(allPriorities)('priority %s', priority => { + describe.each(allVariants)('variant %s', variant => { describe.each(allSizes)('size %s', size => { it.snapshot( 'without icon', () => ( - ), { group: `${themeName} – without icon`, - display_name: `${themeName} / ${priority} / ${size} / without icon`, + display_name: `${themeName} / ${variant} / ${size} / without icon`, } ); @@ -53,14 +53,14 @@ describe('Button', () => { 'with icon', () => ( - ), { group: `${themeName} – with icon`, - display_name: `${themeName} / ${priority} / ${size} / with icon`, + display_name: `${themeName} / ${variant} / ${size} / with icon`, } ); @@ -69,7 +69,7 @@ describe('Button', () => { () => ( @@ -54,7 +54,7 @@ export function CloseEventsDemo() {
No Auto-Close
This modal can only be closed via the button below.
-
@@ -100,8 +100,8 @@ export function SubComponentsDemo() { This is a standalone ModalBody — useful for previewing styles outside a modal. - - + + ); diff --git a/static/app/components/events/interfaces/crashContent/exception/androidNativeTombstonesBanner.tsx b/static/app/components/events/interfaces/crashContent/exception/androidNativeTombstonesBanner.tsx index f0bed93421e3eb..d88ebe093d5c86 100644 --- a/static/app/components/events/interfaces/crashContent/exception/androidNativeTombstonesBanner.tsx +++ b/static/app/components/events/interfaces/crashContent/exception/androidNativeTombstonesBanner.tsx @@ -190,7 +190,7 @@ export function AndroidNativeTombstonesBanner({event, projectId}: Props) { position="bottom-end" triggerProps={{ showChevron: false, - priority: 'transparent', + variant: 'transparent', icon: , }} size="xs" diff --git a/static/app/components/feedback/feedbackItem/feedbackShortId.tsx b/static/app/components/feedback/feedbackItem/feedbackShortId.tsx index 012a14a25bc7dc..960d2d0af46bbb 100644 --- a/static/app/components/feedback/feedbackItem/feedbackShortId.tsx +++ b/static/app/components/feedback/feedbackItem/feedbackShortId.tsx @@ -76,7 +76,7 @@ export function FeedbackShortId({className, feedbackItem, style}: Props) { 'aria-label': t('Short-ID copy actions'), icon: , size: 'zero', - priority: 'transparent', + variant: 'transparent', showChevron: false, }} position="bottom" diff --git a/static/app/stories/view/landing/index.tsx b/static/app/stories/view/landing/index.tsx index 3ecd5ddc6ad8f0..1e2f30d2266282 100644 --- a/static/app/stories/view/landing/index.tsx +++ b/static/app/stories/view/landing/index.tsx @@ -34,7 +34,7 @@ const frontmatter = { { children: 'Get Started', to: '/stories/principles/tokens/', - priority: 'primary', + variant: 'primary', }, { children: 'View on GitHub', diff --git a/static/app/views/dashboards/addWidget.tsx b/static/app/views/dashboards/addWidget.tsx index 265f7307583c95..a3fbe25a6122a5 100644 --- a/static/app/views/dashboards/addWidget.tsx +++ b/static/app/views/dashboards/addWidget.tsx @@ -77,7 +77,7 @@ export function AddWidget({onAddWidget}: Props) { size: 'md', showChevron: false, icon: , - priority: 'transparent', + variant: 'transparent', }} /> diff --git a/static/app/views/detectors/components/details/cron/index.tsx b/static/app/views/detectors/components/details/cron/index.tsx index b55b6d7dd25644..6b565143aa947f 100644 --- a/static/app/views/detectors/components/details/cron/index.tsx +++ b/static/app/views/detectors/components/details/cron/index.tsx @@ -282,7 +282,7 @@ export function CronDetectorDetails({detector, project}: CronDetectorDetailsProp text={dataSource.queryObj.slug} aria-label={t('Copy monitor slug to clipboard')} size="zero" - priority="transparent" + variant="transparent" /> } diff --git a/static/app/views/detectors/components/forms/cron/instrumentationGuide.tsx b/static/app/views/detectors/components/forms/cron/instrumentationGuide.tsx index 24bea2cb835771..3688e599df3b85 100644 --- a/static/app/views/detectors/components/forms/cron/instrumentationGuide.tsx +++ b/static/app/views/detectors/components/forms/cron/instrumentationGuide.tsx @@ -201,7 +201,7 @@ export function InstrumentationGuide() { trigger={triggerProps => ( )} diff --git a/static/app/views/detectors/components/forms/metric/metricDetectorChart.tsx b/static/app/views/detectors/components/forms/metric/metricDetectorChart.tsx index 7ebfe36cc6e469..c6d5b3bf460b8b 100644 --- a/static/app/views/detectors/components/forms/metric/metricDetectorChart.tsx +++ b/static/app/views/detectors/components/forms/metric/metricDetectorChart.tsx @@ -424,7 +424,7 @@ export function MetricDetectorChart({ trigger={triggerProps => ( )} diff --git a/static/app/views/explore/components/chartContextMenu.tsx b/static/app/views/explore/components/chartContextMenu.tsx index 932d123c28c9fc..a24aa63af12fb0 100644 --- a/static/app/views/explore/components/chartContextMenu.tsx +++ b/static/app/views/explore/components/chartContextMenu.tsx @@ -177,7 +177,7 @@ export function ChartContextMenu({ , }} diff --git a/static/app/views/explore/conversations/components/messagesPanel.tsx b/static/app/views/explore/conversations/components/messagesPanel.tsx index 014c923a1728c7..66ec349ff8d437 100644 --- a/static/app/views/explore/conversations/components/messagesPanel.tsx +++ b/static/app/views/explore/conversations/components/messagesPanel.tsx @@ -121,7 +121,7 @@ export function MessagesPanel({nodes, selectedNodeId, onSelectNode}: MessagesPan )} diff --git a/static/app/views/explore/errors/charts/chartContextMenu.tsx b/static/app/views/explore/errors/charts/chartContextMenu.tsx index 20ab3dd78fcd84..81407ca56d4833 100644 --- a/static/app/views/explore/errors/charts/chartContextMenu.tsx +++ b/static/app/views/explore/errors/charts/chartContextMenu.tsx @@ -76,7 +76,7 @@ export function ChartContextMenu({visible, setVisible}: ChartContextMenuProps) { , diff --git a/static/app/views/explore/logs/logsGraph.tsx b/static/app/views/explore/logs/logsGraph.tsx index 471da40c296664..c6513895d1a131 100644 --- a/static/app/views/explore/logs/logsGraph.tsx +++ b/static/app/views/explore/logs/logsGraph.tsx @@ -417,7 +417,7 @@ function ContextMenu({ , }} diff --git a/static/app/views/explore/multiQueryMode/queryVisualizations/chart.tsx b/static/app/views/explore/multiQueryMode/queryVisualizations/chart.tsx index 32a7379f6d53c4..17f299ee186b5e 100644 --- a/static/app/views/explore/multiQueryMode/queryVisualizations/chart.tsx +++ b/static/app/views/explore/multiQueryMode/queryVisualizations/chart.tsx @@ -207,7 +207,7 @@ export function MultiQueryModeChart({ key="contextMenu" triggerProps={{ size: 'xs', - priority: 'transparent', + variant: 'transparent', showChevron: false, icon: , }} diff --git a/static/app/views/insights/common/components/chartActionDropdown.tsx b/static/app/views/insights/common/components/chartActionDropdown.tsx index 1f022005cd8985..aba1fbb82f6b03 100644 --- a/static/app/views/insights/common/components/chartActionDropdown.tsx +++ b/static/app/views/insights/common/components/chartActionDropdown.tsx @@ -200,7 +200,7 @@ export function BaseChartActionDropdown({ triggerProps={{ 'aria-label': t('Widget actions'), size: 'xs', - priority: 'transparent', + variant: 'transparent', showChevron: false, icon: , }} diff --git a/static/app/views/issueDetails/streamline/sidebar/noteDropdown.tsx b/static/app/views/issueDetails/streamline/sidebar/noteDropdown.tsx index 4a5ce9f0b9d1c2..598552602a5e0d 100644 --- a/static/app/views/issueDetails/streamline/sidebar/noteDropdown.tsx +++ b/static/app/views/issueDetails/streamline/sidebar/noteDropdown.tsx @@ -31,7 +31,7 @@ function NoteDropdown({ triggerProps={{ size: 'zero', showChevron: false, - priority: 'transparent', + variant: 'transparent', icon: , 'aria-label': t('Comment Actions'), }} diff --git a/static/app/views/navigation/primary/components.tsx b/static/app/views/navigation/primary/components.tsx index 0f18b8aa837206..ba22ca8770e482 100644 --- a/static/app/views/navigation/primary/components.tsx +++ b/static/app/views/navigation/primary/components.tsx @@ -455,9 +455,9 @@ function NavigationButton(props: DistributedOmit) { {...props} {...(layout === 'mobile' ? hasPageFrame - ? {priority: 'default'} - : {size: 'zero' as const, priority: 'transparent'} - : {priority: props.priority})} + ? {variant: 'secondary'} + : {size: 'zero' as const, variant: 'transparent'} + : {variant: props.variant})} /> )} diff --git a/static/app/views/navigation/primary/userDropdown.tsx b/static/app/views/navigation/primary/userDropdown.tsx index ec9b5c0f1e652f..1b3710fcdceccc 100644 --- a/static/app/views/navigation/primary/userDropdown.tsx +++ b/static/app/views/navigation/primary/userDropdown.tsx @@ -82,7 +82,7 @@ export function UserDropdown() { analyticsKey="user-settings" label={t('User Settings')} buttonProps={{ - priority: 'transparent', + variant: 'transparent', onClick: e => { handleTriggerClick(); triggerProps.onClick?.(e); diff --git a/static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/aiInput.tsx b/static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/aiInput.tsx index bfaeb11cf10123..ce19571345e5fe 100644 --- a/static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/aiInput.tsx +++ b/static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/aiInput.tsx @@ -256,7 +256,7 @@ function MessagesArrayRenderer({ const renderSystemMessageContent = (message: AIMessage) => ( {renderMessageContent(message)} diff --git a/static/app/views/performance/newTraceDetails/traceDrawer/details/styles.tsx b/static/app/views/performance/newTraceDetails/traceDrawer/details/styles.tsx index 5ec00ad6bed7f0..e4f849691fa605 100644 --- a/static/app/views/performance/newTraceDetails/traceDrawer/details/styles.tsx +++ b/static/app/views/performance/newTraceDetails/traceDrawer/details/styles.tsx @@ -1208,7 +1208,7 @@ function MultilineText({ return ( - + {isHovered && ( diff --git a/static/app/views/performance/newTraceDetails/traceTypeWarnings/styles.tsx b/static/app/views/performance/newTraceDetails/traceTypeWarnings/styles.tsx index 938bd1ba4d1f2f..7530cf29cfeac0 100644 --- a/static/app/views/performance/newTraceDetails/traceTypeWarnings/styles.tsx +++ b/static/app/views/performance/newTraceDetails/traceTypeWarnings/styles.tsx @@ -69,7 +69,7 @@ function Banner(props: BannerProps) { position="bottom-end" triggerProps={{ showChevron: false, - priority: 'transparent', + variant: 'transparent', icon: , }} size="xs" diff --git a/static/app/views/performance/transactionSummary/transactionThresholdModal.tsx b/static/app/views/performance/transactionSummary/transactionThresholdModal.tsx index 2d44105ade9e61..4ca4b50f2168fb 100644 --- a/static/app/views/performance/transactionSummary/transactionThresholdModal.tsx +++ b/static/app/views/performance/transactionSummary/transactionThresholdModal.tsx @@ -239,7 +239,7 @@ function TransactionThresholdModal({