Skip to content

Commit 52585ce

Browse files
committed
frontend(topics): split retention into Retention Time and Retention Size (UX-1310)
The topic quick-info bar joined retention.ms and retention.bytes with "or", producing ambiguous strings like "1 day or Infinite" when only one metric was set to -1. Splits the field into two clearly labelled columns ("Retention Time" / "Retention Size") that always render, so an Infinite value reads unambiguously.
1 parent 4a8e3db commit 52585ce

1 file changed

Lines changed: 19 additions & 18 deletions

File tree

frontend/src/components/pages/topics/quick-info.tsx

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,27 +119,28 @@ export const TopicQuickInfoStatistic = (p: { topic: Topic }) => {
119119
</>
120120
)}
121121

122-
{cleanupPolicy === 'delete' && (
122+
{cleanupPolicy === 'delete' && retentionMs && retentionBytes && (
123123
<>
124-
<Text as="dt" fontWeight="bold">
125-
Retention:
126-
</Text>
127-
{retentionMs && retentionBytes ? (
124+
<Flex gap={2}>
125+
<Text as="dt" fontWeight="bold">
126+
Retention Time:
127+
</Text>
128+
<Text as="dd">~{formatConfigValue(retentionMs.name, retentionMs.value, 'friendly')}</Text>
129+
</Flex>
130+
<Box>
131+
<Divider orientation="vertical" />
132+
</Box>
133+
<Flex gap={2}>
134+
<Text as="dt" fontWeight="bold">
135+
Retention Size:
136+
</Text>
128137
<Text as="dd">
129-
~
130-
{retentionMs.value === '-1' && retentionBytes.value === '-1' ? (
131-
'Unlimited'
132-
) : (
133-
<>
134-
{formatConfigValue(retentionMs.name, retentionMs.value, 'friendly')} or{' '}
135-
{formatConfigValue(retentionBytes.name, retentionBytes.value, 'friendly')}
136-
{Number.isFinite(Number(retentionBytes.value)) &&
137-
Number(retentionBytes.value) !== -1 &&
138-
' / partition'}
139-
</>
140-
)}
138+
~{formatConfigValue(retentionBytes.name, retentionBytes.value, 'friendly')}
139+
{Number.isFinite(Number(retentionBytes.value)) &&
140+
Number(retentionBytes.value) !== -1 &&
141+
' / partition'}
141142
</Text>
142-
) : null}
143+
</Flex>
143144
</>
144145
)}
145146
</Flex>

0 commit comments

Comments
 (0)