Skip to content

Commit 98fd0b6

Browse files
authored
Format history size bytes to human-readable units (#3227)
* Add comma separators to history size bytes in workflow summary and details Fixes DT-3634 - historySizeBytes was displayed as a raw integer (e.g. 1234567) in the workflow summary accordion and lines-and-dots details panel. Now uses toLocaleString() to add comma separators (e.g. 1,234,567), making the byte count easier to read while preserving the exact value. * Remove unused workflow-summary.svelte component * Use formatBytes for history size display, remove '(Bytes)' from label Show history size as human-readable units (e.g. 1.18 MB) instead of raw byte count. Update label from 'History Size (Bytes)' to 'History Size' since the unit is now shown in the value. * Rename i18n key history-size-bytes to history-size
1 parent 7df7aae commit 98fd0b6

3 files changed

Lines changed: 10 additions & 105 deletions

File tree

src/lib/components/lines-and-dots/workflow-details.svelte

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
timestampFormat,
1414
} from '$lib/stores/time-format';
1515
import type { WorkflowExecution } from '$lib/types/workflows';
16+
import { formatBytes } from '$lib/utilities/format-bytes';
1617
import { formatDate } from '$lib/utilities/format-date';
1718
import {
1819
formatDistanceAbbreviated,
@@ -80,6 +81,12 @@
8081
'TemporalWorkflowVersioningBehavior'
8182
],
8283
);
84+
85+
const historySizeFormatted = $derived(
86+
workflow?.historySizeBytes
87+
? formatBytes(parseInt(workflow.historySizeBytes, 10))
88+
: '',
89+
);
8390
let totalActions = $derived(
8491
$fullEventHistory.reduce((acc, e) => e.billableActions + acc, 0).toString(),
8592
);
@@ -280,8 +287,8 @@
280287
</DetailListColumn>
281288

282289
<DetailListColumn>
283-
<DetailListLabel>{translate('common.history-size-bytes')}</DetailListLabel>
284-
<DetailListTextValue text={workflow?.historySizeBytes} />
290+
<DetailListLabel>{translate('common.history-size')}</DetailListLabel>
291+
<DetailListTextValue text={historySizeFormatted} />
285292

286293
{#if !$isCloud}
287294
<DetailListLabel

src/lib/components/workflow/workflow-summary.svelte

Lines changed: 0 additions & 102 deletions
This file was deleted.

src/lib/i18n/locales/en/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export const Strings = {
174174
'more-options': 'More options',
175175
download: 'Download',
176176
duration: 'Duration',
177-
'history-size-bytes': 'History Size (Bytes)',
177+
'history-size': 'History Size',
178178
'execution-details': 'Execution Details',
179179
day: 'Day',
180180
night: 'Night',

0 commit comments

Comments
 (0)