Skip to content

style(feedback): add gap back to mailbox #93761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 18, 2025
Merged
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
14 changes: 9 additions & 5 deletions static/app/components/feedback/list/mailboxPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import {useTheme} from '@emotion/react';

import {Badge} from 'sentry/components/core/badge';
import {Flex} from 'sentry/components/core/layout';
import {SegmentedControl} from 'sentry/components/core/segmentedControl';
import {Tooltip} from 'sentry/components/core/tooltip';
import type decodeMailbox from 'sentry/components/feedback/decodeMailbox';
import useMailboxCounts from 'sentry/components/feedback/list/useMailboxCounts';
import {t} from 'sentry/locale';
import {space} from 'sentry/styles/space';
import useOrganization from 'sentry/utils/useOrganization';

type Mailbox = ReturnType<typeof decodeMailbox>;
Expand All @@ -23,6 +26,7 @@ const MAILBOXES = [
export default function MailboxPicker({onChange, value}: Props) {
const organization = useOrganization();
const {data} = useMailboxCounts({organization});
const theme = useTheme();

const filteredMailboxes = MAILBOXES;

Expand All @@ -34,17 +38,17 @@ export default function MailboxPicker({onChange, value}: Props) {
value={value}
onChange={onChange}
>
{filteredMailboxes.map(c => {
{filteredMailboxes.map(mailbox => {
// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
const count = data?.[c.key];
const count = data?.[mailbox.key];
const display = count && count >= 100 ? '99+' : count;
const title =
count === 1 ? t('1 unassigned item') : t('%s unassigned items', display);
return (
<SegmentedControl.Item key={c.key} aria-label={c.label}>
<SegmentedControl.Item key={mailbox.key} aria-label={mailbox.label}>
<Tooltip disabled={!count} title={title}>
<Flex align="center">
{c.label}
<Flex align="center" gap={theme.isChonk ? space(0.75) : 0}>
{mailbox.label}
{display ? <Badge type="default">{display}</Badge> : null}
</Flex>
</Tooltip>
Expand Down
Loading