diff --git a/static/app/views/issueList/actions/sortOptions.tsx b/static/app/views/issueList/actions/sortOptions.tsx index d7cef57aa274..6961feefc26b 100644 --- a/static/app/views/issueList/actions/sortOptions.tsx +++ b/static/app/views/issueList/actions/sortOptions.tsx @@ -1,5 +1,8 @@ +import {FeatureBadge} from '@sentry/scraps/badge'; import {CompactSelect} from '@sentry/scraps/compactSelect'; +import {Flex} from '@sentry/scraps/layout'; import {OverlayTrigger} from '@sentry/scraps/overlayTrigger'; +import {Text} from '@sentry/scraps/text'; import type {DropdownButtonProps} from 'sentry/components/dropdownButton'; import {IconSort} from 'sentry/icons/iconSort'; @@ -99,7 +102,29 @@ export function IssueListSortOptions({ {...triggerProps} size={triggerSize} icon={showIcon && } - /> + > + {organization.features.includes('issue-stream-recommended-sort-default') && + sortKey === IssueSortOptions.RECOMMENDED ? ( + + {triggerProps.children} + + {t( + "Issues now default to the Recommended sort. Pick a different sort and we'll remember your choice." + )} + + ), + }} + /> + + ) : ( + triggerProps.children + )} + )} /> ); diff --git a/static/app/views/issueList/overview.spec.tsx b/static/app/views/issueList/overview.spec.tsx index 4b9dbbd03412..300b528801d4 100644 --- a/static/app/views/issueList/overview.spec.tsx +++ b/static/app/views/issueList/overview.spec.tsx @@ -373,11 +373,24 @@ describe('IssueList', () => { }); render(, {organization: featureOrg, initialRouterConfig}); - await userEvent.click(await screen.findByRole('button', {name: 'Recommended'})); + await userEvent.click(await screen.findByRole('button', {name: /Recommended/})); await userEvent.click(screen.getByRole('option', {name: 'Events'})); expect(getStoredIssueSort(featureOrg.slug)).toBe(IssueSortOptions.FREQ); }); + + it('shows the new-feature badge next to the sort dropdown with the recommended-sort-default feature', async () => { + const featureOrg = OrganizationFixture({ + ...organization, + features: ['issue-stream-recommended-sort-default'], + }); + render(, {organization: featureOrg, initialRouterConfig}); + + expect( + await screen.findByRole('button', {name: /Recommended/}) + ).toBeInTheDocument(); + expect(screen.getByLabelText('new')).toBeInTheDocument(); + }); }); describe('transitionTo', () => {