Skip to content

Commit d518e9c

Browse files
authored
feat: Make retries more visible (#1255)
### Summary Retries discoverability was low and many users wasn't noticing that activity is currently retrying. This changes increases visibility of the retries badge by changing it color to a color that brings attention (warning) and changing the icon to `Retries` ### Testing Tested on grouped list <img width="2082" height="698" alt="Screenshot 2026-04-23 at 11 49 30" src="https://github.com/user-attachments/assets/0d607c40-d21d-4836-8860-509305945b8b" /> Tested on ungrouped list <img width="1745" height="1197" alt="Screenshot 2026-04-23 at 11 52 16" src="https://github.com/user-attachments/assets/7e482325-2de0-44be-9e84-9b5899b40b6e" /> Test old history unchanged <img width="1721" height="870" alt="Screenshot 2026-04-22 at 22 03 12" src="https://github.com/user-attachments/assets/5713d4bb-96bc-408b-8ca7-cf976d15dbf6" />
1 parent 52adda7 commit d518e9c

6 files changed

Lines changed: 67 additions & 20 deletions

File tree

src/views/workflow-history-v2/config/workflow-history-details-row-parsers.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ const workflowHistoryDetailsRowParsersConfig: Array<DetailsRowItemParser> = [
3737
matcher: (name) => name === 'attempt',
3838
hide: (_, value) => typeof value === 'number' && value <= 0,
3939
icon: MdReplay,
40-
customTooltipContent: () => 'retries',
40+
customRenderValue: ({ value }) =>
41+
value === 1 ? '1 Retry' : `${value} Retries`,
42+
// TODO: Provide more flexible render methods to avoid adding new props for each customization
43+
badgeColor: 'warning',
4144
},
4245
{
4346
name: 'Workflow links as having clickable content',

src/views/workflow-history-v2/workflow-history-details-row/helpers/__tests__/get-parsed-details-row-items.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jest.mock('../../../config/workflow-history-details-row-parsers.config', () => {
4343
icon: mockIcon,
4444
customTooltipContent: jest.fn(() => 'retries'),
4545
omitWrapping: true,
46+
badgeColor: 'warning',
4647
},
4748
] satisfies Array<DetailsRowItemParser>,
4849
};
@@ -353,4 +354,24 @@ describe(getParsedDetailsRowItems.name, () => {
353354
expect(result).toHaveLength(1);
354355
expect(result[0].omitWrapping).toBe(true);
355356
});
357+
358+
it('should include badgeColor from parser config when available', () => {
359+
const detailsEntries: EventDetailsEntries = [
360+
{
361+
key: 'attempt',
362+
path: 'attempt',
363+
value: 2,
364+
renderConfig: {
365+
name: 'Test Config',
366+
key: 'test',
367+
},
368+
isGroup: false,
369+
},
370+
];
371+
372+
const result = getParsedDetailsRowItems(detailsEntries);
373+
374+
expect(result).toHaveLength(1);
375+
expect(result[0].badgeColor).toBe('warning');
376+
});
356377
});

src/views/workflow-history-v2/workflow-history-details-row/helpers/get-parsed-details-row-items.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export default function getParsedDetailsRowItems(
5252
invertTooltipColors: parserConfig?.invertTooltipColors,
5353
omitWrapping: parserConfig?.omitWrapping,
5454
hasClickableContent: parserConfig?.hasClickableContent,
55+
badgeColor: parserConfig?.badgeColor,
5556
});
5657

5758
return acc;

src/views/workflow-history-v2/workflow-history-details-row/workflow-history-details-row.styles.ts

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,53 @@ export const styled = {
1212
})),
1313
DetailsFieldContainer: createStyled<
1414
'div',
15-
{ $isNegative: boolean; $omitWrapping: boolean }
15+
{
16+
$isNegative: boolean;
17+
$omitWrapping: boolean;
18+
$badgeColor?: 'warning';
19+
}
1620
>(
1721
'div',
1822
({
1923
$theme,
2024
$isNegative,
2125
$omitWrapping,
26+
$badgeColor,
2227
}: {
2328
$theme: Theme;
2429
$isNegative: boolean;
2530
$omitWrapping: boolean;
26-
}) => ({
27-
display: 'flex',
28-
alignItems: 'center',
29-
gap: $theme.sizing.scale100,
30-
color: $isNegative
31-
? $theme.colors.contentNegative
32-
: $theme.colors.contentPrimary,
33-
height: $theme.sizing.scale700,
34-
...($omitWrapping
35-
? {}
36-
: {
37-
padding: `${$theme.sizing.scale0} ${$theme.sizing.scale100}`,
38-
backgroundColor: $isNegative
39-
? $theme.colors.backgroundNegativeLight
40-
: $theme.colors.backgroundSecondary,
41-
borderRadius: $theme.borders.radius200,
42-
}),
43-
})
31+
$badgeColor?: 'warning';
32+
}) => {
33+
let color: string;
34+
let backgroundColorWhenWrapped: string;
35+
36+
if ($isNegative) {
37+
color = $theme.colors.contentNegative;
38+
backgroundColorWhenWrapped = $theme.colors.backgroundNegativeLight;
39+
} else if ($badgeColor === 'warning') {
40+
color = $theme.colors.warning700;
41+
backgroundColorWhenWrapped = $theme.colors.backgroundWarningLight;
42+
} else {
43+
color = $theme.colors.contentPrimary;
44+
backgroundColorWhenWrapped = $theme.colors.backgroundSecondary;
45+
}
46+
47+
return {
48+
display: 'flex',
49+
alignItems: 'center',
50+
gap: $theme.sizing.scale100,
51+
color,
52+
height: $theme.sizing.scale700,
53+
...($omitWrapping
54+
? {}
55+
: {
56+
padding: `${$theme.sizing.scale0} ${$theme.sizing.scale100}`,
57+
backgroundColor: backgroundColorWhenWrapped,
58+
borderRadius: $theme.borders.radius200,
59+
}),
60+
};
61+
}
4462
),
4563
};
4664

src/views/workflow-history-v2/workflow-history-details-row/workflow-history-details-row.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export default function WorkflowHistoryDetailsRow({
5858
<styled.DetailsFieldContainer
5959
$isNegative={isNegative}
6060
$omitWrapping={item.omitWrapping ?? false}
61+
$badgeColor={item.badgeColor}
6162
{...(item.hasClickableContent
6263
? {
6364
onClick: (e: React.MouseEvent<HTMLDivElement>) =>

src/views/workflow-history-v2/workflow-history-details-row/workflow-history-details-row.types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ export type DetailsRowItemParser = {
5353
omitWrapping?: boolean;
5454
/** Optional flag to stop click event propagation if the item has clickable content */
5555
hasClickableContent?: boolean;
56+
/** Optional semantic badge color for the field pill (e.g. retries / attempt count) */
57+
badgeColor?: 'warning';
5658
};
5759

5860
export type DetailsRowItem = {
@@ -68,6 +70,7 @@ export type DetailsRowItem = {
6870
invertTooltipColors?: boolean;
6971
omitWrapping?: boolean;
7072
hasClickableContent?: boolean;
73+
badgeColor?: 'warning';
7174
};
7275

7376
export type Props = {

0 commit comments

Comments
 (0)