Skip to content

Commit 1cf1f08

Browse files
JonasBaclaude
andauthored
ref(issue-list): Simplify monitors dropdown labels and item behavior (#112450)
Simplify the monitors dropdown in the issue list by updating item labels to a cleaner "View Cron/Uptime Monitors (N)" format indicating the link behavior. I initially thought that the arrows were indicating sub-menus, which was quite confusing given that they are links... Note for the design system here that we should probably not allow trailing items in dropdown menus - those should be reserved for the chevron sub-menu indicator and consumers should only use leading icons to indicate entries --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0cb5c5a commit 1cf1f08

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

static/app/views/issueList/monitorsDropdown.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ describe('MonitorsDropdown', () => {
2727
await userEvent.click(dropdown);
2828

2929
expect(
30-
await screen.findByRole('menuitemradio', {name: /2 Active Cron Monitors/})
30+
await screen.findByRole('menuitemradio', {name: /View Active Cron Monitors/})
3131
).toHaveAttribute('href', '/organizations/org-slug/insights/crons/');
3232
expect(
33-
await screen.findByRole('menuitemradio', {name: /1 Active Uptime Monitor/})
33+
await screen.findByRole('menuitemradio', {name: /View Active Uptime Monitors/})
3434
).toHaveAttribute('href', '/organizations/org-slug/insights/uptime/');
3535
});
3636
});

static/app/views/issueList/monitorsDropdown.tsx

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {DropdownButton} from 'sentry/components/dropdownButton';
22
import {DropdownMenu} from 'sentry/components/dropdownMenu';
3-
import {IconArrow} from 'sentry/icons';
4-
import {tn} from 'sentry/locale';
3+
import {t, tn} from 'sentry/locale';
54
import {getApiUrl} from 'sentry/utils/api/getApiUrl';
65
import {keepPreviousData, useApiQuery} from 'sentry/utils/queryClient';
76
import {useLocation} from 'sentry/utils/useLocation';
@@ -66,39 +65,29 @@ export function MonitorsDropdown() {
6665
items={[
6766
{
6867
key: 'crons',
69-
label: tn(
70-
'%s Active Cron Monitor',
71-
'%s Active Cron Monitors',
72-
cronsData?.counts.active
73-
),
68+
label: t('View Active Cron Monitors (%s)', cronsData.counts.active),
7469
to: `/organizations/${organization.slug}/insights/crons/`,
7570
details:
76-
cronsData?.counts.disabled > 0
71+
cronsData.counts.disabled > 0
7772
? tn(
7873
'%s disabled monitor',
7974
'%s disabled monitors',
80-
cronsData?.counts.disabled
75+
cronsData.counts.disabled
8176
)
8277
: undefined,
83-
trailingItems: <IconArrow direction="right" />,
8478
},
8579
{
8680
key: 'uptime',
87-
label: tn(
88-
'%s Active Uptime Monitor',
89-
'%s Active Uptime Monitors',
90-
uptimeData?.counts.active
91-
),
81+
label: t('View Active Uptime Monitors (%s)', uptimeData.counts.active),
9282
to: `/organizations/${organization.slug}/insights/uptime/`,
9383
details:
94-
uptimeData?.counts.disabled > 0
84+
uptimeData.counts.disabled > 0
9585
? tn(
9686
'%s disabled monitor',
9787
'%s disabled monitors',
98-
uptimeData?.counts.disabled
88+
uptimeData.counts.disabled
9989
)
10090
: undefined,
101-
trailingItems: <IconArrow direction="right" />,
10291
},
10392
]}
10493
trigger={(props, isOpen) => (

0 commit comments

Comments
 (0)