Skip to content

Commit fb3b427

Browse files
committed
Bugfix: Restore repo size in Total size card
- Main line now shows "LoC: {N}, commits: {N}" - Repo size secondary line restored
1 parent 32bb77b commit fb3b427

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

src/lib/components/ResultsSummary.svelte

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@
55
interface Props {
66
days: DayStats[]
77
detectedLanguages: string[]
8+
repoSizeBytes?: number | null
89
onHighlightDate?: (date: string | null) => void
910
}
1011
11-
let { days, onHighlightDate }: Props = $props()
12+
let { days, repoSizeBytes, onHighlightDate }: Props = $props()
13+
14+
const formattedRepoSize = $derived.by(() => {
15+
if (repoSizeBytes == null || repoSizeBytes <= 0) return null
16+
return `${(repoSizeBytes / (1024 * 1024)).toFixed(1)} MB`
17+
})
1218
1319
// --- Total size ---
1420
const totalLines = $derived(days.length > 0 ? days[days.length - 1].total : 0)
@@ -278,11 +284,17 @@
278284
class="mt-2 text-foreground"
279285
style="font-family: var(--font-mono); font-size: 1.125rem; font-weight: 500; letter-spacing: -0.01em;"
280286
>
281-
LoC: {formattedTotal}
282-
</p>
283-
<p class="mt-1 text-foreground-secondary" style="font-family: var(--font-mono); font-size: 0.75rem;">
284-
{totalCommits === 1 ? 'commit' : 'commits'}: {formattedCommits}
287+
LoC: {formattedTotal}, {totalCommits === 1 ? 'commit' : 'commits'}: {formattedCommits}
285288
</p>
289+
{#if formattedRepoSize}
290+
<p
291+
class="mt-1 text-foreground-secondary"
292+
style="font-family: var(--font-mono); font-size: 0.75rem;"
293+
title="It includes history"
294+
>
295+
Repo size: {formattedRepoSize}
296+
</p>
297+
{/if}
286298
</div>
287299

288300
<!-- Prod / test split -->

src/routes/+page.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,7 @@
759759
<ResultsSummary
760760
days={displayDays}
761761
detectedLanguages={displayLanguages}
762+
{repoSizeBytes}
762763
onHighlightDate={(d) => (chartHighlightDate = d)}
763764
/>
764765

0 commit comments

Comments
 (0)