diff --git a/frontend-modern/src/components/Workloads/GuestDrawerHistory.tsx b/frontend-modern/src/components/Workloads/GuestDrawerHistory.tsx index 807aa0577..c88851e13 100644 --- a/frontend-modern/src/components/Workloads/GuestDrawerHistory.tsx +++ b/frontend-modern/src/components/Workloads/GuestDrawerHistory.tsx @@ -74,6 +74,12 @@ const EMPTY_HISTORY_RESPONSE: AllMetricsHistoryResponse = { const formatRangeLabel = (range: HistoryTimeRange): string => { switch (range) { + case '1h': + return '1 hour'; + case '6h': + return '6 hours'; + case '12h': + return '12 hours'; case '24h': return '24 hours'; case '7d': diff --git a/frontend-modern/src/components/shared/__tests__/HistoryChart.test.tsx b/frontend-modern/src/components/shared/__tests__/HistoryChart.test.tsx index 0e031c8f5..ee4a76560 100644 --- a/frontend-modern/src/components/shared/__tests__/HistoryChart.test.tsx +++ b/frontend-modern/src/components/shared/__tests__/HistoryChart.test.tsx @@ -118,8 +118,8 @@ describe('HistoryChart', () => { expect(screen.getByText('History')).toBeInTheDocument(); }); - it('exposes the Relay history range as a first-class chart option', () => { - expect(HISTORY_CHART_RANGES).toEqual(['24h', '7d', '14d', '30d', '90d']); + it('exposes the sub-day and Relay history ranges as first-class chart options', () => { + expect(HISTORY_CHART_RANGES).toEqual(['1h', '6h', '12h', '24h', '7d', '14d', '30d', '90d']); }); it('positions the tooltip beside the hovered point when there is chart space', () => { diff --git a/frontend-modern/src/components/shared/historyChartModel.ts b/frontend-modern/src/components/shared/historyChartModel.ts index 683021896..66154aab6 100644 --- a/frontend-modern/src/components/shared/historyChartModel.ts +++ b/frontend-modern/src/components/shared/historyChartModel.ts @@ -31,7 +31,16 @@ export interface HistoryChartTooltipLayout { height: number; } -export const HISTORY_CHART_RANGES: HistoryTimeRange[] = ['24h', '7d', '14d', '30d', '90d']; +export const HISTORY_CHART_RANGES: HistoryTimeRange[] = [ + '1h', + '6h', + '12h', + '24h', + '7d', + '14d', + '30d', + '90d', +]; export function formatHistoryChartTooltipValue(value: number, unit?: string): string { if (unit === '%') return `${value.toFixed(1)}%`;