From ad8295455d77b0dca5c88945a858e464fb9aa099 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Tue, 24 Nov 2026 01:27:22 +0000 Subject: [PATCH] fix(ui): clearer hold reasons, aligned details and chart states Render the hold reason as a sentence, pluralise counts, give the details grid a fixed rhythm, use distinct registry colours, label the plotted series, and show a note for a single day of history. --- frontend/src/components/Insights.spec.ts | 8 ++++ frontend/src/components/Insights.vue | 36 +++++++++++---- frontend/src/components/PackageDetails.vue | 46 ++++++++++--------- frontend/src/components/PackageList.vue | 3 +- frontend/src/components/Security.vue | 3 +- frontend/src/components/SeveritySummary.vue | 3 +- frontend/src/components/System.vue | 4 +- frontend/src/components/TrendChart.spec.ts | 14 ++++++ frontend/src/components/TrendChart.vue | 16 ++++++- .../src/components/parts/CacheCapacity.vue | 7 ++- .../src/components/parts/PackageQuickView.vue | 3 +- .../src/components/parts/ScannerHealth.vue | 8 ++-- frontend/src/components/views.smoke.spec.ts | 6 +-- frontend/src/lib/reason.spec.ts | 33 +++++++++++++ frontend/src/lib/reason.ts | 33 +++++++++++++ frontend/src/lib/system.spec.ts | 11 ++++- frontend/src/lib/system.ts | 10 ++++ frontend/src/lib/verdictBanner.spec.ts | 3 +- frontend/src/lib/verdictBanner.ts | 7 +-- 19 files changed, 203 insertions(+), 51 deletions(-) create mode 100644 frontend/src/lib/reason.spec.ts create mode 100644 frontend/src/lib/reason.ts diff --git a/frontend/src/components/Insights.spec.ts b/frontend/src/components/Insights.spec.ts index 140042d..6f0fd7d 100644 --- a/frontend/src/components/Insights.spec.ts +++ b/frontend/src/components/Insights.spec.ts @@ -56,6 +56,14 @@ describe('Insights', () => { expect(wrapper.get('[data-testid="daily-downloads"]').find('[role="img"]').exists()).toBe(true) }) + it('summarises the heatmap period next to the grid', async () => { + const { wrapper } = await open() + const summary = wrapper.get('[data-testid="heatmap-summary"]').text() + expect(summary).toContain('Total') + expect(summary).toContain(`of ${TIMESERIES.data_points.length}`) + expect(summary).toContain('Busiest day') + }) + it('does not draw an empty heatmap for a month with no downloads', async () => { const quiet = { ...TIMESERIES, data_points: TIMESERIES.data_points.map((p) => ({ ...p, value: 0 })) } const { wrapper } = await open(STATS, quiet) diff --git a/frontend/src/components/Insights.vue b/frontend/src/components/Insights.vue index fc193fd..72cb88e 100644 --- a/frontend/src/components/Insights.vue +++ b/frontend/src/components/Insights.vue @@ -64,21 +64,26 @@ Daily downloads - The last 30 days. A darker square is a busier day. + The last 30 days. A stronger colour is a busier day. - +
+ + + {{ formatNumber(heatSummary.total) }} + {{ heatSummary.activeDays }} of {{ heatData.length }} + {{ heatSummary.busiest }} + +
@@ -95,6 +100,8 @@ import { BarChart, Button, CalendarHeatmap, + DescriptionItem, + DescriptionList, Callout, Card, CardContent, @@ -170,6 +177,15 @@ const heatError = ref(null) const heatData = computed(() => heatPoints.value.some((p) => p.value > 0) ? heatPoints.value.map((p) => ({ date: isoDay(p.timestamp), value: p.value })) : [], ) +const heatSummary = computed(() => { + const days = heatData.value + const busiest = days.reduce((max, d) => (d.value > max.value ? d : max), days[0] ?? { date: '', value: 0 }) + return { + total: days.reduce((sum, d) => sum + d.value, 0), + activeDays: days.filter((d) => d.value > 0).length, + busiest: busiest.value > 0 ? `${busiest.date}, ${formatNumber(busiest.value)}` : 'None', + } +}) const heatStart = computed(() => heatData.value[0]?.date ?? '') const heatEnd = computed(() => heatData.value[heatData.value.length - 1]?.date ?? '') diff --git a/frontend/src/components/PackageDetails.vue b/frontend/src/components/PackageDetails.vue index 5d1df6f..27d927a 100644 --- a/frontend/src/components/PackageDetails.vue +++ b/frontend/src/components/PackageDetails.vue @@ -28,27 +28,31 @@ Details - - {{ row ? formatBytes(row.size) : 'Unknown' }} - {{ row ? formatNumber(row.download_count) : 'Unknown' }} - - {{ row?.checksum_sha256 || 'Not recorded' }} - - {{ upstream }} - - - - - - - - - {{ expiry }} - - - - - +
+ + {{ row ? formatBytes(row.size) : 'Unknown' }} + {{ row ? formatNumber(row.download_count) : 'Unknown' }} + {{ upstream }} + + + + + + + + + + + + + + + + {{ row?.checksum_sha256 || 'Not recorded' }} + + {{ expiry }} + +
diff --git a/frontend/src/components/PackageList.vue b/frontend/src/components/PackageList.vue index 2d5fa9d..13d0491 100644 --- a/frontend/src/components/PackageList.vue +++ b/frontend/src/components/PackageList.vue @@ -31,7 +31,7 @@ />