Skip to content

Commit 0b427c3

Browse files
authored
feat(inbox): show issue short IDs in the inbox list (#132092)
Renders issue short IDs in the inbox list. We don't yet have investigation short IDs, so those are left without anything on their second line for now.
1 parent f64da3f commit 0b427c3

2 files changed

Lines changed: 19 additions & 11 deletions

File tree

‎static/app/views/inbox/inboxItemList.tsx‎

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {useId} from 'react';
1+
import {Fragment, useId} from 'react';
22
import styled from '@emotion/styled';
33
import {IconCheckmark} from '@sentry/icons/checkmark';
44
import {IconDelete} from '@sentry/icons/delete';
@@ -60,7 +60,7 @@ function InboxItemListItem({item, isSelected, filters}: InboxItemListItemProps)
6060
const organization = useOrganization();
6161
const checkboxState = useListItemCheckboxContext();
6262
const checkboxId = useId();
63-
const {type, title} = item.subject;
63+
const {type, title, metadata} = item.subject;
6464
const SubjectIcon = INBOX_SUBJECT_CONFIG[type].icon;
6565
const {pathname, search, hash} = new URL(item.url);
6666
const queryClient = useQueryClient();
@@ -84,7 +84,7 @@ function InboxItemListItem({item, isSelected, filters}: InboxItemListItemProps)
8484
{props => (
8585
<ItemRow {...props} data-inbox-item data-selected={isSelected}>
8686
<InteractionStateLayer />
87-
<Grid columns="max-content 8px minmax(0, 1fr)" gap="xs md" align="center">
87+
<Grid columns="max-content 8px minmax(0, 1fr)" gap="xs" align="center">
8888
<Container
8989
column="1 / 2"
9090
row="1 / span 2"
@@ -138,7 +138,7 @@ function InboxItemListItem({item, isSelected, filters}: InboxItemListItemProps)
138138
/>
139139
</Text>
140140
</Container>
141-
<Container column="1" row="1">
141+
<Flex column="1" row="1" height="0" align="center">
142142
{actionProps => (
143143
<ItemActions {...actionProps}>
144144
<DropdownMenu
@@ -190,14 +190,21 @@ function InboxItemListItem({item, isSelected, filters}: InboxItemListItemProps)
190190
/>
191191
</ItemActions>
192192
)}
193-
</Container>
193+
</Flex>
194194
</Grid>
195195
</Flex>
196-
<Container column="3" row="2" minWidth={0}>
197-
<Text size="sm" variant="muted" ellipsis>
196+
<Stack column="3" row="2" gap="xs" minWidth={0}>
197+
{type === 'issue' && (
198+
<Fragment>
199+
<Text size="sm" variant="muted" ellipsis>
200+
{metadata.shortId}
201+
</Text>
202+
</Fragment>
203+
)}
204+
<Text size="sm" ellipsis>
198205
{item.latestEvent.summary}
199206
</Text>
200-
</Container>
207+
</Stack>
201208
</Grid>
202209
</ItemRow>
203210
)}
@@ -209,7 +216,7 @@ const ItemRow = styled('li')`
209216
list-style: none;
210217
211218
&:hover,
212-
&:focus-within,
219+
&:has([aria-haspopup]:focus-visible),
213220
&:has([aria-expanded='true']) {
214221
[data-inbox-item-timestamp] {
215222
opacity: 0;
@@ -234,7 +241,7 @@ const ItemActions = styled('div')`
234241
pointer-events: none;
235242
236243
[data-inbox-item]:hover &,
237-
[data-inbox-item]:focus-within &,
244+
&:has(:focus-visible),
238245
&:has([aria-expanded='true']) {
239246
opacity: 1;
240247
pointer-events: auto;

‎static/app/views/inbox/index.spec.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,13 @@ describe('Inbox', () => {
163163
});
164164
});
165165

166-
it('shows subject titles and latest event summaries', async () => {
166+
it('shows subject titles and event summaries with short IDs for issues', async () => {
167167
render(<Inbox />, {organization, initialRouterConfig: INBOX_ROUTER_CONFIG});
168168

169169
expect(
170170
await screen.findByRole('link', {name: issueItem.subject.title})
171171
).toHaveAttribute('href', '/organizations/org-slug/inbox/issue/7656018581/');
172+
expect(screen.getByText('PROJECT-42')).toBeInTheDocument();
172173
expect(screen.getByText('Assigned to you')).toBeInTheDocument();
173174
expect(
174175
screen.getByRole('link', {name: notebookItem.subject.title})

0 commit comments

Comments
 (0)