Skip to content

Commit a14cf3c

Browse files
authored
fix(metric): use tooltip to improve reliability of rendering (#2477)
Signed-off-by: Adam Setch <[email protected]>
1 parent f5e8b0c commit a14cf3c

File tree

7 files changed

+4671
-2993
lines changed

7 files changed

+4671
-2993
lines changed

src/renderer/components/metrics/MetricGroup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const MetricGroup: FC<MetricGroupProps> = ({
2828

2929
const labelsPillDescription = notification.subject.labels
3030
?.map((label) => `🏷️ ${label}`)
31-
.join('\n');
31+
.join(', ');
3232

3333
const linkedIssuesPillDescription = `Linked to ${
3434
notification.subject.linkedIssues?.length > 1 ? 'issues' : 'issue'
Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { FC } from 'react';
22

33
import type { Icon } from '@primer/octicons-react';
4-
import { Label, Stack, Text } from '@primer/react';
4+
import { Label, Stack, Text, Tooltip } from '@primer/react';
55

66
import { type IconColor, Size } from '../../types';
77

@@ -16,18 +16,22 @@ export const MetricPill: FC<MetricPillProps> = (props: MetricPillProps) => {
1616
const Icon = props.icon;
1717

1818
return (
19-
<Label
20-
className="hover:bg-gitify-notification-pill-hover"
21-
size="small"
22-
title={props.title}
23-
variant="secondary"
24-
>
25-
<Stack align="center" direction="horizontal" gap="none">
26-
<Icon className={props.color} size={Size.XSMALL} />
27-
{props.metric ? (
28-
<Text className="text-xxs px-1">{props.metric}</Text>
29-
) : null}
30-
</Stack>
31-
</Label>
19+
<Tooltip direction="s" text={props.title}>
20+
<button type="button">
21+
<Label
22+
className="hover:bg-gitify-notification-pill-hover"
23+
size="small"
24+
tabIndex={0}
25+
variant="secondary"
26+
>
27+
<Stack align="center" direction="horizontal" gap="none">
28+
<Icon className={props.color} size={Size.XSMALL} />
29+
{props.metric ? (
30+
<Text className="text-xxs px-1">{props.metric}</Text>
31+
) : null}
32+
</Stack>
33+
</Label>
34+
</button>
35+
</Tooltip>
3236
);
3337
};

0 commit comments

Comments
 (0)