Skip to content

Commit e6e1722

Browse files
authored
frontend(topics): split retention into Retention Time and Retention Size (UX-1310) (#2471)
* 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. * fix(topics): drop tilde prefix when retention is infinite * style(topics): apply ultracite formatting
1 parent ee1784d commit e6e1722

1 file changed

Lines changed: 21 additions & 18 deletions

File tree

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

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,27 +119,30 @@ 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>
128128
<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-
)}
129+
{retentionMs.value !== '-1' && '~'}
130+
{formatConfigValue(retentionMs.name, retentionMs.value, 'friendly')}
141131
</Text>
142-
) : null}
132+
</Flex>
133+
<Box>
134+
<Divider orientation="vertical" />
135+
</Box>
136+
<Flex gap={2}>
137+
<Text as="dt" fontWeight="bold">
138+
Retention Size:
139+
</Text>
140+
<Text as="dd">
141+
{retentionBytes.value !== '-1' && '~'}
142+
{formatConfigValue(retentionBytes.name, retentionBytes.value, 'friendly')}
143+
{Number.isFinite(Number(retentionBytes.value)) && Number(retentionBytes.value) !== -1 && ' / partition'}
144+
</Text>
145+
</Flex>
143146
</>
144147
)}
145148
</Flex>

0 commit comments

Comments
 (0)