Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Extract dashboard overview feature owners

rcourtman28977463c919
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index b65604d392..d5d8555d21 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -210,6 +210,14 @@ and path contract. The operations route must keep its navigation routed through
the shared `frontend-modern/src/components/shared/Subtabs.tsx` primitive rather
than rebuilding a bespoke page-local tab bar.
+The dashboard overview route now follows that same feature-owner pattern for
+its dashboard-specific summary surfaces. `frontend-modern/src/pages/Dashboard.tsx`
+stays the route shell, while `frontend-modern/src/features/dashboardOverview/`
+owns the dashboard-specific action, KPI, problem-resource, trend, and
+customization surfaces. Lane-owned widgets like recent alerts, storage,
+and recovery must continue to route through their own subsystem owners instead
+of drifting back into a page-local dashboard panel cluster.
+
The updates settings surface now follows the same presentation-owner rule.
`frontend-modern/src/components/Settings/UpdatesSettingsPanel.tsx` stays the
top-level settings shell, while
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index 4e4994c4e0..68eb50fc87 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -1902,6 +1902,12 @@
"frontend-modern/src/components/Settings/useSystemLogsPanelState.ts",
"frontend-modern/src/components/SetupWizard/SetupCompletionPreview.tsx",
"frontend-modern/src/components/SetupWizard/SetupWizard.tsx",
+ "frontend-modern/src/features/dashboardOverview/ActionRequiredPanel.tsx",
+ "frontend-modern/src/features/dashboardOverview/DashboardCustomizer.tsx",
+ "frontend-modern/src/features/dashboardOverview/index.ts",
+ "frontend-modern/src/features/dashboardOverview/KPIStrip.tsx",
+ "frontend-modern/src/features/dashboardOverview/ProblemResourcesTable.tsx",
+ "frontend-modern/src/features/dashboardOverview/TrendCharts.tsx",
"frontend-modern/src/features/operations/operationsPageModel.ts",
"frontend-modern/src/features/operations/OperationsPageSurface.tsx",
"frontend-modern/src/pages/Operations.tsx",
@@ -2027,6 +2033,29 @@
"frontend-modern/src/utils/__tests__/reportingPresentation.test.ts"
]
},
+ {
+ "id": "dashboard-overview-feature-surface",
+ "label": "dashboard overview feature proof",
+ "match_prefixes": [],
+ "match_files": [
+ "frontend-modern/src/features/dashboardOverview/ActionRequiredPanel.tsx",
+ "frontend-modern/src/features/dashboardOverview/DashboardCustomizer.tsx",
+ "frontend-modern/src/features/dashboardOverview/index.ts",
+ "frontend-modern/src/features/dashboardOverview/KPIStrip.tsx",
+ "frontend-modern/src/features/dashboardOverview/ProblemResourcesTable.tsx",
+ "frontend-modern/src/features/dashboardOverview/TrendCharts.tsx"
+ ],
+ "allow_same_subsystem_tests": false,
+ "test_prefixes": [],
+ "exact_files": [
+ "frontend-modern/src/features/dashboardOverview/__tests__/KPIStrip.test.tsx",
+ "frontend-modern/src/features/dashboardOverview/__tests__/ProblemResourcesTable.test.tsx",
+ "frontend-modern/src/features/dashboardOverview/__tests__/TrendCharts.test.tsx",
+ "frontend-modern/src/pages/__tests__/DashboardPage.test.tsx",
+ "frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts",
+ "frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts"
+ ]
+ },
{
"id": "first-session-runtime-and-preview",
"label": "first-session runtime and preview proof",
@@ -2858,13 +2887,13 @@
"internal/recovery/"
],
"owned_files": [
+ "frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts",
"frontend-modern/src/hooks/useDashboardRecovery.ts",
"frontend-modern/src/hooks/useRecoveryPoints.ts",
"frontend-modern/src/hooks/useRecoveryPointsFacets.ts",
"frontend-modern/src/hooks/useRecoveryPointsSeries.ts",
"frontend-modern/src/hooks/useRecoveryRollups.ts",
"frontend-modern/src/pages/Dashboard.tsx",
- "frontend-modern/src/pages/DashboardPanels/dashboardWidgets.ts",
"frontend-modern/src/pages/DashboardPanels/RecoveryStatusPanel.tsx",
"frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx",
"frontend-modern/src/pages/RecoveryRoute.tsx",
@@ -2922,8 +2951,8 @@
"label": "dashboard storage and recovery surface proof",
"match_prefixes": [],
"match_files": [
- "frontend-modern/src/pages/Dashboard.tsx",
- "frontend-modern/src/pages/DashboardPanels/dashboardWidgets.ts"
+ "frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts",
+ "frontend-modern/src/pages/Dashboard.tsx"
],
"allow_same_subsystem_tests": false,
"test_prefixes": [],
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index d9c59942ca..1fc40b4431 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -40,7 +40,7 @@ querying, and the operator-facing storage health presentation layer.
15. `frontend-modern/src/hooks/useRecoveryRollups.ts`
16. `frontend-modern/src/pages/RecoveryRoute.tsx`
17. `frontend-modern/src/pages/Dashboard.tsx`
-18. `frontend-modern/src/pages/DashboardPanels/dashboardWidgets.ts`
+18. `frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts`
19. `frontend-modern/src/pages/DashboardPanels/RecoveryStatusPanel.tsx`
20. `frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx`
21. `frontend-modern/src/types/recovery.ts`
@@ -221,14 +221,14 @@ coverage only through `frontend-modern/src/pages/RecoveryRoute.tsx`.
That same rule applies to the dashboard recovery entry points too:
`frontend-modern/src/hooks/useDashboardRecovery.ts`,
`frontend-modern/src/pages/Dashboard.tsx`,
-`frontend-modern/src/pages/DashboardPanels/dashboardWidgets.ts`,
+`frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts`,
`frontend-modern/src/pages/DashboardPanels/RecoveryStatusPanel.tsx`, and
`frontend-modern/src/utils/dashboardRecoveryPresentation.ts` must stay on
explicit direct dashboard/recovery proof routing instead of inheriting
coverage only through the full recovery route or broader dashboard shells.
The storage dashboard entry point must be treated the same way on the storage
side: `frontend-modern/src/pages/Dashboard.tsx`,
-`frontend-modern/src/pages/DashboardPanels/dashboardWidgets.ts`, and
+`frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts`, and
`frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx` must stay on
explicit direct dashboard/storage proof routing instead of borrowing release-
control coverage only from the broader storage page and model surfaces.
diff --git a/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts b/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts
index 1e1396d327..56d88d39cb 100644
--- a/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts
@@ -115,7 +115,7 @@ import recoveryHistoryTableSource from '@/components/Recovery/RecoveryHistoryTab
import recoveryProtectedInventorySectionSource from '@/components/Recovery/RecoveryProtectedInventorySection.tsx?raw';
import recoveryHistorySectionStateSource from '@/components/Recovery/useRecoveryHistorySectionState.ts?raw';
import recoveryTablePresentationSource from '@/utils/recoveryTablePresentation.ts?raw';
-import problemResourcesTableSource from '@/pages/DashboardPanels/ProblemResourcesTable.tsx?raw';
+import problemResourcesTableSource from '@/features/dashboardOverview/ProblemResourcesTable.tsx?raw';
import workloadTypeBadgesSource from '@/components/shared/workloadTypeBadges.ts?raw';
import workloadTypePresentationSource from '@/utils/workloadTypePresentation.ts?raw';
diff --git a/frontend-modern/src/pages/DashboardPanels/ActionRequiredPanel.tsx b/frontend-modern/src/features/dashboardOverview/ActionRequiredPanel.tsx
similarity index 100%
rename from frontend-modern/src/pages/DashboardPanels/ActionRequiredPanel.tsx
rename to frontend-modern/src/features/dashboardOverview/ActionRequiredPanel.tsx
diff --git a/frontend-modern/src/pages/DashboardPanels/DashboardCustomizer.tsx b/frontend-modern/src/features/dashboardOverview/DashboardCustomizer.tsx
similarity index 100%
rename from frontend-modern/src/pages/DashboardPanels/DashboardCustomizer.tsx
rename to frontend-modern/src/features/dashboardOverview/DashboardCustomizer.tsx
diff --git a/frontend-modern/src/pages/DashboardPanels/KPIStrip.tsx b/frontend-modern/src/features/dashboardOverview/KPIStrip.tsx
similarity index 100%
rename from frontend-modern/src/pages/DashboardPanels/KPIStrip.tsx
rename to frontend-modern/src/features/dashboardOverview/KPIStrip.tsx
diff --git a/frontend-modern/src/pages/DashboardPanels/ProblemResourcesTable.tsx b/frontend-modern/src/features/dashboardOverview/ProblemResourcesTable.tsx
similarity index 100%
rename from frontend-modern/src/pages/DashboardPanels/ProblemResourcesTable.tsx
rename to frontend-modern/src/features/dashboardOverview/ProblemResourcesTable.tsx
diff --git a/frontend-modern/src/pages/DashboardPanels/TrendCharts.tsx b/frontend-modern/src/features/dashboardOverview/TrendCharts.tsx
similarity index 100%
rename from frontend-modern/src/pages/DashboardPanels/TrendCharts.tsx
rename to frontend-modern/src/features/dashboardOverview/TrendCharts.tsx
diff --git a/frontend-modern/src/pages/DashboardPanels/__tests__/KPIStrip.test.tsx b/frontend-modern/src/features/dashboardOverview/__tests__/KPIStrip.test.tsx
similarity index 100%
rename from frontend-modern/src/pages/DashboardPanels/__tests__/KPIStrip.test.tsx
rename to frontend-modern/src/features/dashboardOverview/__tests__/KPIStrip.test.tsx
diff --git a/frontend-modern/src/pages/DashboardPanels/__tests__/ProblemResourcesTable.test.tsx b/frontend-modern/src/features/dashboardOverview/__tests__/ProblemResourcesTable.test.tsx
similarity index 100%
rename from frontend-modern/src/pages/DashboardPanels/__tests__/ProblemResourcesTable.test.tsx
rename to frontend-modern/src/features/dashboardOverview/__tests__/ProblemResourcesTable.test.tsx
diff --git a/frontend-modern/src/pages/DashboardPanels/__tests__/TrendCharts.test.tsx b/frontend-modern/src/features/dashboardOverview/__tests__/TrendCharts.test.tsx
similarity index 100%
rename from frontend-modern/src/pages/DashboardPanels/__tests__/TrendCharts.test.tsx
rename to frontend-modern/src/features/dashboardOverview/__tests__/TrendCharts.test.tsx
diff --git a/frontend-modern/src/pages/DashboardPanels/dashboardWidgets.ts b/frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts
similarity index 100%
rename from frontend-modern/src/pages/DashboardPanels/dashboardWidgets.ts
rename to frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts
diff --git a/frontend-modern/src/features/dashboardOverview/index.ts b/frontend-modern/src/features/dashboardOverview/index.ts
new file mode 100644
index 0000000000..c62536c913
--- /dev/null
+++ b/frontend-modern/src/features/dashboardOverview/index.ts
@@ -0,0 +1,5 @@
+export { ActionRequiredPanel } from './ActionRequiredPanel';
+export { DashboardCustomizer } from './DashboardCustomizer';
+export { KPIStrip } from './KPIStrip';
+export { ProblemResourcesTable } from './ProblemResourcesTable';
+export { TrendCharts } from './TrendCharts';
diff --git a/frontend-modern/src/hooks/useDashboardLayout.ts b/frontend-modern/src/hooks/useDashboardLayout.ts
index 260d636db5..d0a69c48f3 100644
--- a/frontend-modern/src/hooks/useDashboardLayout.ts
+++ b/frontend-modern/src/hooks/useDashboardLayout.ts
@@ -5,7 +5,7 @@ import {
getDashboardWidget,
type DashboardWidgetDef,
type DashboardWidgetId,
-} from '@/pages/DashboardPanels/dashboardWidgets';
+} from '@/features/dashboardOverview/dashboardWidgets';
type DashboardLayoutState = {
order: DashboardWidgetId[];
diff --git a/frontend-modern/src/pages/Dashboard.tsx b/frontend-modern/src/pages/Dashboard.tsx
index 0ec6c75322..fbaa247c0c 100644
--- a/frontend-modern/src/pages/Dashboard.tsx
+++ b/frontend-modern/src/pages/Dashboard.tsx
@@ -24,15 +24,14 @@ import type { HistoryTimeRange } from '@/api/charts';
import type { Alert } from '@/types/api';
import {
ActionRequiredPanel,
- ProblemResourcesTable,
+ DashboardCustomizer,
KPIStrip,
- RecoveryStatusPanel,
- StoragePanel,
+ ProblemResourcesTable,
TrendCharts,
- DashboardCustomizer,
-} from './DashboardPanels';
+} from '@/features/dashboardOverview';
import { RecentAlertsPanel } from '@/components/Alerts/RecentAlertsPanel';
-import type { DashboardWidgetDef, DashboardWidgetId } from './DashboardPanels/dashboardWidgets';
+import type { DashboardWidgetDef, DashboardWidgetId } from '@/features/dashboardOverview/dashboardWidgets';
+import { RecoveryStatusPanel, StoragePanel } from './DashboardPanels';
export default function Dashboard() {
const { connected, reconnecting, reconnect, activeAlerts } = useWebSocket();
diff --git a/frontend-modern/src/pages/DashboardPanels/CompositionPanel.tsx b/frontend-modern/src/pages/DashboardPanels/CompositionPanel.tsx
deleted file mode 100644
index 212376b42d..0000000000
--- a/frontend-modern/src/pages/DashboardPanels/CompositionPanel.tsx
+++ /dev/null
@@ -1,102 +0,0 @@
-import { For, Show } from 'solid-js';
-import { Dynamic } from 'solid-js/web';
-import type { ValidComponent } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import {
- DASHBOARD_COMPOSITION_EMPTY_STATE,
- getDashboardCompositionIcon,
- getDashboardCompositionLabel,
-} from '@/utils/dashboardCompositionPresentation';
-
-interface CompositionPanelProps {
- infrastructureByType: Record<string, number>;
- workloadsByType: Record<string, number>;
-}
-
-function DistributionItem(props: { type: string; count: number; total: number }) {
- const percent = () => Math.round((props.count / props.total) * 100);
- const Icon = (): ValidComponent => getDashboardCompositionIcon(props.type);
-
- return (
- <div class="space-y-1">
- <div class="flex items-center justify-between text-xs">
- <div class="flex items-center gap-2 text-base-content">
- <Dynamic component={Icon()} class="w-3.5 h-3.5 text-muted" />
- <span class="font-medium">{getDashboardCompositionLabel(props.type)}</span>
- </div>
- <div class="flex items-center gap-1.5">
- <span class="font-bold text-base-content">{props.count}</span>
- <span class="text-muted">({percent()}%)</span>
- </div>
- </div>
- <div class="h-1.5 w-full bg-surface-alt rounded-full overflow-hidden">
- <div
- class="h-full bg-blue-500 dark:bg-blue-600 rounded-full"
- style={{ width: `${percent()}%` }}
- />
- </div>
- </div>
- );
-}
-
-export function CompositionPanel(props: CompositionPanelProps) {
- const infraTypes = () =>
- Object.entries(props.infrastructureByType).filter(
- (item): item is [string, number] => item[1] > 0,
- );
- const workloadTypes = () =>
- Object.entries(props.workloadsByType).filter((item): item is [string, number] => item[1] > 0);
-
- const totalInfra = () => Object.values(props.infrastructureByType).reduce((a, b) => a + b, 0);
- const totalWorkloads = () => Object.values(props.workloadsByType).reduce((a, b) => a + b, 0);
-
- return (
- <Card padding="none" class="px-4 py-3.5">
- <div class="flex items-center gap-2 mb-3">
- <h2 class="text-xs font-semibold text-muted uppercase tracking-wide">Composition</h2>
- </div>
-
- <div class="space-y-4">
- <Show when={totalInfra() > 0}>
- <div class="space-y-2">
- <h3 class="text-[10px] font-bold text-muted uppercase tracking-wider">
- Infrastructure
- </h3>
- <div class="space-y-3">
- <For each={infraTypes()}>
- {([type, count]) => (
- <DistributionItem type={type} count={count} total={totalInfra()} />
- )}
- </For>
- </div>
- </div>
- </Show>
-
- <Show when={totalInfra() > 0 && totalWorkloads() > 0}>
- <div class="h-px bg-surface-alt" />
- </Show>
-
- <Show when={totalWorkloads() > 0}>
- <div class="space-y-2">
- <h3 class="text-[10px] font-bold text-muted uppercase tracking-wider">Workloads</h3>
- <div class="space-y-3">
- <For each={workloadTypes()}>
- {([type, count]) => (
- <DistributionItem type={type} count={count} total={totalWorkloads()} />
- )}
- </For>
- </div>
- </div>
- </Show>
-
- <Show when={totalInfra() === 0 && totalWorkloads() === 0}>
- <p class="text-xs text-muted py-2 text-center italic">
- {DASHBOARD_COMPOSITION_EMPTY_STATE}
- </p>
- </Show>
- </div>
- </Card>
- );
-}
-
-export default CompositionPanel;
diff --git a/frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx b/frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx
index c5d94670cc..0261c853f5 100644
--- a/frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx
+++ b/frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx
@@ -1,8 +1,12 @@
import { Match, Switch } from 'solid-js';
import { Card } from '@/components/shared/Card';
import { buildStoragePath } from '@/routing/resourceLinks';
+import {
+ formatDashboardDelta,
+ formatDashboardPercent,
+ getDashboardDeltaColorClass,
+} from '@/utils/dashboardMetricPresentation';
import { formatBytes } from '@/utils/format';
-import { deltaColorClass, formatDelta, formatPercent } from './dashboardHelpers';
import type { DashboardOverview } from '@/hooks/useDashboardOverview';
import type { TrendData } from '@/hooks/useDashboardTrends';
import {
@@ -49,7 +53,7 @@ export function StoragePanel(props: StoragePanelProps) {
{formatBytes(props.storage.totalUsed)} / {formatBytes(props.storage.totalCapacity)}
</p>
<span class="text-xs font-mono font-semibold text-base-content">
- {formatPercent(capacityPercent())}
+ {formatDashboardPercent(capacityPercent())}
</span>
</div>
@@ -66,9 +70,9 @@ export function StoragePanel(props: StoragePanelProps) {
))}
{hasTrend() && (
<span
- class={`font-mono font-medium ${deltaColorClass(props.storageTrend?.delta ?? null)}`}
+ class={`font-mono font-medium ${getDashboardDeltaColorClass(props.storageTrend?.delta ?? null)}`}
>
- 24h: {formatDelta(props.storageTrend?.delta ?? null) ?? '—'}
+ 24h: {formatDashboardDelta(props.storageTrend?.delta ?? null) ?? '—'}
</span>
)}
</div>
diff --git a/frontend-modern/src/pages/DashboardPanels/Visualizations.tsx b/frontend-modern/src/pages/DashboardPanels/Visualizations.tsx
deleted file mode 100644
index ebb30ed106..0000000000
--- a/frontend-modern/src/pages/DashboardPanels/Visualizations.tsx
+++ /dev/null
@@ -1,147 +0,0 @@
-import { Component, createMemo, For, Show } from 'solid-js';
-
-interface MiniDonutProps {
- data: Array<{ value: number; color: string; tooltip?: string }>;
- size?: number;
- strokeWidth?: number;
- centerText?: string;
- className?: string; // Allow custom classes
-}
-
-export const MiniDonut: Component<MiniDonutProps> = (props) => {
- const size = props.size ?? 32;
- const strokeWidth = props.strokeWidth ?? 4;
- const radius = (size - strokeWidth) / 2;
- const circumference = 2 * Math.PI * radius;
-
- const total = createMemo(() => props.data.reduce((acc, item) => acc + item.value, 0));
-
- return (
- <div
- class={`relative inline-flex items-center justify-center ${props.className || ''}`}
- style={{ width: `${size}px`, height: `${size}px` }}
- >
- <svg
- width={size}
- height={size}
- viewBox={`0 0 ${size} ${size}`}
- class={`absolute inset-0 rotate-[-90deg]`}
- >
- <For
- each={(() => {
- let accumulated = 0;
- const t = total();
- if (t === 0) return [];
-
- return props.data.map((item) => {
- const val = (item.value / t) * circumference;
- const offset = -accumulated;
- accumulated += val;
- return { color: item.color, value: val, offset };
- });
- })()}
- >
- {(segment) => (
- <circle
- cx={size / 2}
- cy={size / 2}
- r={radius}
- fill="none"
- stroke="currentColor"
- stroke-width={strokeWidth}
- stroke-dasharray={`${segment.value} ${circumference}`}
- stroke-dashoffset={segment.offset}
- class={segment.color}
- />
- )}
- </For>
- </svg>
-
- {props.centerText && (
- <span class="absolute text-[10px] font-bold text-base-content">{props.centerText}</span>
- )}
- </div>
- );
-};
-
-interface MiniGaugeProps {
- percent: number; // 0-100
- size?: number;
- strokeWidth?: number;
- color?: string;
-}
-
-export const MiniGauge: Component<MiniGaugeProps> = (props) => {
- const size = props.size ?? 32;
- const strokeWidth = props.strokeWidth ?? 4;
- const radius = (size - strokeWidth) / 2;
- const circumference = 2 * Math.PI * radius;
- // Semi-circle gauge (180deg) or 3/4 gauge (270deg)? Let's do 270deg (open at bottom)
- const arcLength = circumference * 0.75;
-
- return (
- <div
- class="relative inline-flex items-center justify-center"
- style={{ width: `${size}px`, height: `${size}px` }}
- >
- <svg width={size} height={size} viewBox={`0 0 ${size} ${size}`} class="rotate-[135deg]">
- {/* Track */}
- <circle
- cx={size / 2}
- cy={size / 2}
- r={radius}
- fill="none"
- stroke="currentColor"
- stroke-width={strokeWidth}
- stroke-dasharray={`${arcLength} ${circumference}`}
- stroke-linecap="round"
- class="text-base-content"
- />
- {/* Value */}
- <circle
- cx={size / 2}
- cy={size / 2}
- r={radius}
- fill="none"
- stroke="currentColor"
- stroke-width={strokeWidth}
- stroke-dasharray={`${(props.percent / 100) * arcLength} ${circumference}`}
- stroke-linecap="round"
- class={props.color || (props.percent > 90 ? 'text-red-500' : 'text-cyan-500')}
- />
- </svg>
- </div>
- );
-};
-
-interface StackedBarProps {
- data: Array<{ label: string; value: number; color: string }>;
- height?: number;
- className?: string; // Allow custom classes
-}
-
-export const StackedBar: Component<StackedBarProps> = (props) => {
- const total = createMemo(() => props.data.reduce((sum, item) => sum + item.value, 0));
-
- return (
- <div
- class={`flex w-full overflow-hidden rounded-full bg-surface-alt ${props.className || ''}`}
- style={{ height: `${props.height || 8}px` }}
- >
- <For each={props.data}>
- {(item) => {
- const percent = createMemo(() => (total() > 0 ? (item.value / total()) * 100 : 0));
- return (
- <Show when={percent() > 0}>
- <div
- class={`h-full ${item.color} transition-all duration-500`}
- style={{ width: `${percent()}%` }}
- title={`${item.label}: ${item.value} (${Math.round(percent())}%)`}
- />
- </Show>
- );
- }}
- </For>
- </div>
- );
-};
diff --git a/frontend-modern/src/pages/DashboardPanels/__tests__/dashboardHelpers.test.ts b/frontend-modern/src/pages/DashboardPanels/__tests__/dashboardHelpers.test.ts
deleted file mode 100644
index 1a9900a3fa..0000000000
--- a/frontend-modern/src/pages/DashboardPanels/__tests__/dashboardHelpers.test.ts
+++ /dev/null
@@ -1,150 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import {
- statusBadgeClass,
- formatPercent,
- formatDelta,
- deltaColorClass,
- PRIORITY_ORDER,
- priorityBadgeClass,
- MAX_ACTION_ITEMS,
-} from '@/pages/DashboardPanels/dashboardHelpers';
-
-describe('dashboardHelpers', () => {
- describe('statusBadgeClass', () => {
- it('returns correct class for online', () => {
- const result = statusBadgeClass('online');
- expect(result).toContain('bg-emerald-100');
- expect(result).toContain('text-emerald-700');
- });
-
- it('returns correct class for offline', () => {
- const result = statusBadgeClass('offline');
- expect(result).toContain('bg-surface-alt');
- });
-
- it('returns correct class for warning', () => {
- const result = statusBadgeClass('warning');
- expect(result).toContain('bg-amber-100');
- expect(result).toContain('text-amber-700');
- });
-
- it('returns correct class for critical', () => {
- const result = statusBadgeClass('critical');
- expect(result).toContain('bg-red-100');
- expect(result).toContain('text-red-700');
- });
-
- it('returns correct class for unknown', () => {
- const result = statusBadgeClass('unknown');
- expect(result).toContain('bg-surface-alt');
- expect(result).toContain('text-muted');
- });
- });
-
- describe('formatPercent', () => {
- it('formats positive percentage', () => {
- expect(formatPercent(50)).toBe('50%');
- });
-
- it('formats zero', () => {
- expect(formatPercent(0)).toBe('0%');
- });
-
- it('rounds to nearest integer', () => {
- expect(formatPercent(49.6)).toBe('50%');
- expect(formatPercent(49.4)).toBe('49%');
- });
- });
-
- describe('formatDelta', () => {
- it('returns null for null input', () => {
- expect(formatDelta(null)).toBeNull();
- });
-
- it('formats positive delta with plus sign', () => {
- expect(formatDelta(5)).toBe('+5.0%');
- expect(formatDelta(0.5)).toBe('+0.5%');
- });
-
- it('formats negative delta with minus sign', () => {
- expect(formatDelta(-5)).toBe('-5.0%');
- expect(formatDelta(-0.5)).toBe('-0.5%');
- });
-
- it('formats zero as +0.0%', () => {
- expect(formatDelta(0)).toBe('+0.0%');
- });
- });
-
- describe('deltaColorClass', () => {
- it('returns muted for null', () => {
- expect(deltaColorClass(null)).toBe('text-muted');
- });
-
- it('returns red for delta > 5', () => {
- expect(deltaColorClass(10)).toContain('red-500');
- });
-
- it('returns amber for delta > 0 and <= 5', () => {
- expect(deltaColorClass(3)).toContain('amber-500');
- });
-
- it('returns emerald for delta < -5', () => {
- expect(deltaColorClass(-10)).toContain('emerald-500');
- });
-
- it('returns blue for delta < 0 and >= -5', () => {
- expect(deltaColorClass(-3)).toContain('blue-500');
- });
-
- it('returns muted for delta = 0', () => {
- expect(deltaColorClass(0)).toBe('text-muted');
- });
- });
-
- describe('PRIORITY_ORDER', () => {
- it('has correct order for critical', () => {
- expect(PRIORITY_ORDER.critical).toBe(0);
- });
-
- it('has correct order for high', () => {
- expect(PRIORITY_ORDER.high).toBe(1);
- });
-
- it('has correct order for medium', () => {
- expect(PRIORITY_ORDER.medium).toBe(2);
- });
-
- it('has correct order for low', () => {
- expect(PRIORITY_ORDER.low).toBe(3);
- });
- });
-
- describe('priorityBadgeClass', () => {
- it('returns correct class for critical', () => {
- const result = priorityBadgeClass('critical');
- expect(result).toContain('bg-red-100');
- });
-
- it('returns correct class for high', () => {
- const result = priorityBadgeClass('high');
- expect(result).toContain('bg-orange-100');
- });
-
- it('returns correct class for medium', () => {
- const result = priorityBadgeClass('medium');
- expect(result).toContain('bg-amber-100');
- });
-
- it('returns correct class for low', () => {
- const result = priorityBadgeClass('low');
- expect(result).toContain('bg-blue-100');
- });
- });
-
- describe('MAX_ACTION_ITEMS', () => {
- it('is 5', () => {
- expect(MAX_ACTION_ITEMS).toBe(5);
- });
- });
-});
diff --git a/frontend-modern/src/pages/DashboardPanels/dashboardHelpers.ts b/frontend-modern/src/pages/DashboardPanels/dashboardHelpers.ts
deleted file mode 100644
index afb803280b..0000000000
--- a/frontend-modern/src/pages/DashboardPanels/dashboardHelpers.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export {
- DASHBOARD_MAX_ACTION_ITEMS as MAX_ACTION_ITEMS,
- DASHBOARD_PRIORITY_ORDER as PRIORITY_ORDER,
- formatDashboardDelta as formatDelta,
- formatDashboardPercent as formatPercent,
- getDashboardDeltaColorClass as deltaColorClass,
- getDashboardPriorityBadgeClass as priorityBadgeClass,
- getDashboardStatusBadgeClass as statusBadgeClass,
- type DashboardActionItem as ActionItem,
- type DashboardActionPriority as ActionPriority,
- type DashboardStatusTone as StatusTone,
-} from '@/utils/dashboardMetricPresentation';
diff --git a/frontend-modern/src/pages/DashboardPanels/index.ts b/frontend-modern/src/pages/DashboardPanels/index.ts
index ec2a638c23..8d2e272442 100644
--- a/frontend-modern/src/pages/DashboardPanels/index.ts
+++ b/frontend-modern/src/pages/DashboardPanels/index.ts
@@ -1,8 +1,2 @@
-export { ActionRequiredPanel } from './ActionRequiredPanel';
-export { ProblemResourcesTable } from './ProblemResourcesTable';
-export { KPIStrip } from './KPIStrip';
-export { TrendCharts } from './TrendCharts';
-export { CompositionPanel } from './CompositionPanel';
export { RecoveryStatusPanel } from './RecoveryStatusPanel';
export { StoragePanel } from './StoragePanel';
-export { DashboardCustomizer } from './DashboardCustomizer';
diff --git a/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx b/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx
index dec716dd7a..f80aaead94 100644
--- a/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx
+++ b/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx
@@ -129,6 +129,13 @@ describe('Dashboard page module contract', () => {
expect(dashboardPageSource).toContain("from '@/components/Alerts/RecentAlertsPanel'");
});
+ it('routes dashboard overview panels through the dashboard overview feature owner', () => {
+ expect(dashboardPageSource).toContain("from '@/features/dashboardOverview'");
+ expect(dashboardPageSource).toContain(
+ 'ActionRequiredPanel,\n DashboardCustomizer,\n KPIStrip,\n ProblemResourcesTable,\n TrendCharts,',
+ );
+ });
+
it('renders loading skeleton blocks when resources are loading', () => {
unifiedLoading = true;
diff --git a/frontend-modern/src/utils/__tests__/dashboardCompositionPresentation.test.ts b/frontend-modern/src/utils/__tests__/dashboardCompositionPresentation.test.ts
deleted file mode 100644
index 238483edf4..0000000000
--- a/frontend-modern/src/utils/__tests__/dashboardCompositionPresentation.test.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import {
- DASHBOARD_COMPOSITION_EMPTY_STATE,
- getDashboardCompositionIcon,
- getDashboardCompositionLabel,
-} from '@/utils/dashboardCompositionPresentation';
-
-describe('dashboardCompositionPresentation', () => {
- it('returns composition-specific labels for known dashboard buckets', () => {
- expect(getDashboardCompositionLabel('vm')).toBe('Virtual Machines');
- expect(getDashboardCompositionLabel('system-container')).toBe('System Containers');
- expect(getDashboardCompositionLabel('app-container')).toBe('App Containers');
- expect(getDashboardCompositionLabel('pod')).toBe('Kubernetes Pods');
- expect(getDashboardCompositionLabel('database')).toBe('Databases');
- });
-
- it('falls back to canonical resource type labels or titleized labels', () => {
- expect(getDashboardCompositionLabel('storage')).toBe('Storage');
- expect(getDashboardCompositionLabel('custom-backend')).toBe('Custom Backend');
- expect(getDashboardCompositionLabel('')).toBe('Unknown');
- });
-
- it('returns canonical composition icons', () => {
- expect(getDashboardCompositionIcon('vm')).toBeTruthy();
- expect(getDashboardCompositionIcon('system-container')).toBeTruthy();
- expect(getDashboardCompositionIcon('database')).toBeTruthy();
- expect(getDashboardCompositionIcon('')).toBeTruthy();
- });
-
- it('exports canonical dashboard composition empty-state copy', () => {
- expect(DASHBOARD_COMPOSITION_EMPTY_STATE).toBe('No resources detected');
- });
-});
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index d4cbe5a6a3..110e1763c7 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -100,16 +100,13 @@ import stackedMemoryBarModelSource from '@/components/Dashboard/stackedMemoryBar
import stackedMemoryBarStateSource from '@/components/Dashboard/useStackedMemoryBarState.ts?raw';
import workloadsSummarySource from '@/components/Workloads/WorkloadsSummary.tsx?raw';
import dashboardRouteSource from '@/pages/Dashboard.tsx?raw';
-import dashboardHelpersSource from '@/pages/DashboardPanels/dashboardHelpers.ts?raw';
import dashboardMetricPresentationSource from '@/utils/dashboardMetricPresentation.ts?raw';
import dashboardTrendPresentationSource from '@/utils/dashboardTrendPresentation.ts?raw';
-import trendChartsSource from '@/pages/DashboardPanels/TrendCharts.tsx?raw';
+import trendChartsSource from '@/features/dashboardOverview/TrendCharts.tsx?raw';
import thresholdSliderSource from '@/components/Dashboard/ThresholdSlider.tsx?raw';
-import compositionPanelSource from '@/pages/DashboardPanels/CompositionPanel.tsx?raw';
-import dashboardCompositionPresentationSource from '@/utils/dashboardCompositionPresentation.ts?raw';
-import problemResourcesTableSource from '@/pages/DashboardPanels/ProblemResourcesTable.tsx?raw';
+import problemResourcesTableSource from '@/features/dashboardOverview/ProblemResourcesTable.tsx?raw';
import problemResourcePresentationSource from '@/utils/problemResourcePresentation.ts?raw';
-import kpiStripSource from '@/pages/DashboardPanels/KPIStrip.tsx?raw';
+import kpiStripSource from '@/features/dashboardOverview/KPIStrip.tsx?raw';
import recentAlertsPanelSource from '@/components/Alerts/RecentAlertsPanel.tsx?raw';
import storagePanelSource from '@/pages/DashboardPanels/StoragePanel.tsx?raw';
import recoveryStatusPanelSource from '@/pages/DashboardPanels/RecoveryStatusPanel.tsx?raw';
@@ -956,9 +953,6 @@ describe('frontend resource type boundaries', () => {
expect(recoverySummarySource).toContain('getRecoveryAttentionDotClass');
expect(recoverySummarySource).not.toContain('function getAttentionChipClass(');
expect(recoverySummarySource).not.toContain('function getAttentionDotClass(');
- expect(dashboardHelpersSource).toContain("from '@/utils/dashboardMetricPresentation'");
- expect(dashboardHelpersSource).not.toContain('export function statusBadgeClass');
- expect(dashboardHelpersSource).not.toContain('export function priorityBadgeClass');
expect(dashboardMetricPresentationSource).toContain(
'export function getDashboardStatusBadgeClass',
);
@@ -1244,18 +1238,6 @@ describe('frontend resource type boundaries', () => {
expect(trendChartsSource).not.toContain(
"'px-2 py-0.5 rounded bg-blue-600 text-white text-[11px] font-medium'",
);
- expect(compositionPanelSource).toContain('getDashboardCompositionIcon');
- expect(compositionPanelSource).toContain('DASHBOARD_COMPOSITION_EMPTY_STATE');
- expect(compositionPanelSource).not.toContain('No resources detected');
- expect(compositionPanelSource).not.toContain('const TYPE_ICONS: Record<string, any> =');
- expect(dashboardCompositionPresentationSource).toContain(
- 'export const getDashboardCompositionIcon',
- );
- expect(dashboardCompositionPresentationSource).toContain(
- 'export const DASHBOARD_COMPOSITION_EMPTY_STATE',
- );
- expect(dashboardCompositionPresentationSource).toContain('titleCaseDelimitedLabel');
- expect(dashboardCompositionPresentationSource).not.toContain('const titleize =');
expect(problemResourcesTableSource).toContain('getProblemResourceStatusVariant');
expect(problemResourcesTableSource).not.toContain(
'function statusVariant(pr: ProblemResource)',
@@ -1273,11 +1255,14 @@ describe('frontend resource type boundaries', () => {
expect(recentAlertsPanelSource).not.toContain('getAlertSeverityTextClass');
expect(recentAlertsPanelSource).not.toContain("alert.level === 'critical' ? 'CRIT' : 'WARN'");
expect(recentAlertsPanelSource).not.toContain('No active alerts');
+ expect(dashboardRouteSource).toContain("from '@/features/dashboardOverview'");
expect(alertOverviewPresentationSource).toContain('export function getDashboardAlertTone');
expect(alertOverviewPresentationSource).toContain(
'export function getDashboardAlertSummaryText',
);
expect(storagePanelSource).toContain('@/utils/dashboardStoragePresentation');
+ expect(storagePanelSource).toContain('@/utils/dashboardMetricPresentation');
+ expect(storagePanelSource).not.toContain('./dashboardHelpers');
expect(storagePanelSource).not.toContain('No storage resources');
expect(recoveryStatusPanelSource).toContain('@/utils/dashboardRecoveryPresentation');
expect(recoveryStatusPanelSource).not.toContain('No recovery data available');
diff --git a/frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts b/frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts
index f818081265..b440c3ef50 100644
--- a/frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';
-import alertsPageSource from '@/pages/Alerts.tsx?raw';
-import problemResourcesTableSource from '@/pages/DashboardPanels/ProblemResourcesTable.tsx?raw';
+import alertsHistoryTabSource from '@/features/alerts/tabs/HistoryTab.tsx?raw';
+import problemResourcesTableSource from '@/features/dashboardOverview/ProblemResourcesTable.tsx?raw';
import { TYPE_COLUMN_LABEL } from '@/utils/typeColumnContract';
import { getTypeColumnLabel } from '@/utils/typeColumnPresentation';
@@ -17,7 +17,7 @@ describe('typeColumnPresentation', () => {
it('keeps fixed runtime Type headers on the shared label utility', () => {
expect(problemResourcesTableSource).toContain('getTypeColumnLabel()');
- expect(alertsPageSource).toContain('getTypeColumnLabel()');
+ expect(alertsHistoryTabSource).toContain('getTypeColumnLabel()');
});
it('limits runtime Type header label helper imports to the known allowlist', () => {
@@ -33,8 +33,8 @@ describe('typeColumnPresentation', () => {
.sort();
expect(directTypeLabelHelperUsers).toEqual([
- '../../pages/Alerts.tsx',
- '../../pages/DashboardPanels/ProblemResourcesTable.tsx',
+ '../../features/alerts/tabs/HistoryTab.tsx',
+ '../../features/dashboardOverview/ProblemResourcesTable.tsx',
]);
});
});
diff --git a/frontend-modern/src/utils/dashboardCompositionPresentation.ts b/frontend-modern/src/utils/dashboardCompositionPresentation.ts
deleted file mode 100644
index 949436e589..0000000000
--- a/frontend-modern/src/utils/dashboardCompositionPresentation.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import Server from 'lucide-solid/icons/server';
-import AppWindow from 'lucide-solid/icons/app-window';
-import Database from 'lucide-solid/icons/database';
-import Box from 'lucide-solid/icons/box';
-import Container from 'lucide-solid/icons/container';
-import type { ValidComponent } from 'solid-js';
-import { getResourceTypeLabel } from '@/utils/resourceTypePresentation';
-import { titleCaseDelimitedLabel } from '@/utils/textPresentation';
-
-const COMPOSITION_ICONS: Record<string, ValidComponent> = {
- vm: Server,
- 'system-container': Box,
- 'app-container': Container,
- pod: AppWindow,
- database: Database,
- unknown: Server,
-};
-
-const COMPOSITION_LABELS: Record<string, string> = {
- vm: 'Virtual Machines',
- 'system-container': 'System Containers',
- 'app-container': 'App Containers',
- pod: 'Kubernetes Pods',
- database: 'Databases',
-};
-
-export const DASHBOARD_COMPOSITION_EMPTY_STATE = 'No resources detected';
-
-export const getDashboardCompositionLabel = (resourceType: string): string => {
- const normalized = (resourceType || '').trim().toLowerCase();
- if (!normalized) return 'Unknown';
- if (COMPOSITION_LABELS[normalized]) return COMPOSITION_LABELS[normalized];
- const sharedLabel = getResourceTypeLabel(normalized);
- if (sharedLabel && sharedLabel !== normalized) return sharedLabel;
- return titleCaseDelimitedLabel(normalized);
-};
-
-export const getDashboardCompositionIcon = (resourceType: string): ValidComponent => {
- const normalized = (resourceType || '').trim().toLowerCase();
- return COMPOSITION_ICONS[normalized] ?? Server;
-};
diff --git a/scripts/release_control/canonical_completion_guard_test.py b/scripts/release_control/canonical_completion_guard_test.py
index 597ba53728..41185fb368 100644
--- a/scripts/release_control/canonical_completion_guard_test.py
+++ b/scripts/release_control/canonical_completion_guard_test.py
@@ -808,7 +808,7 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
def test_dashboard_widgets_change_requires_storage_recovery_contract(self):
required = infer_impacted_subsystems(
- ["frontend-modern/src/pages/DashboardPanels/dashboardWidgets.ts"]
+ ["frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts"]
)
self.assertEqual(set(required), {"storage-recovery"})
@@ -819,7 +819,7 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
)
self.assertEqual(
recovery["touched_runtime_files"],
- ["frontend-modern/src/pages/DashboardPanels/dashboardWidgets.ts"],
+ ["frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts"],
)
self.assertEqual(
recovery["verification_requirements"],
@@ -828,7 +828,7 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
"id": "dashboard-storage-recovery-surface",
"label": "dashboard storage and recovery surface proof",
"touched_runtime_files": [
- "frontend-modern/src/pages/DashboardPanels/dashboardWidgets.ts"
+ "frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts"
],
"allow_same_subsystem_tests": False,
"test_prefixes": [],
diff --git a/scripts/release_control/subsystem_lookup_test.py b/scripts/release_control/subsystem_lookup_test.py
index 626f973959..93fd9e4792 100644
--- a/scripts/release_control/subsystem_lookup_test.py
+++ b/scripts/release_control/subsystem_lookup_test.py
@@ -296,7 +296,7 @@ class SubsystemLookupTest(unittest.TestCase):
)
def test_lookup_paths_assigns_dashboard_widgets_to_storage_recovery(self) -> None:
- result = lookup_paths(["frontend-modern/src/pages/DashboardPanels/dashboardWidgets.ts"])
+ result = lookup_paths(["frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts"])
self.assertEqual(result["unowned_runtime_files"], [])
self.assertEqual(
{item["subsystem"] for item in result["impacted_subsystems"]},
@@ -310,15 +310,39 @@ class SubsystemLookupTest(unittest.TestCase):
)
match = file_entry["matches"][0]
self.assertEqual(match["contract"], "docs/release-control/v6/internal/subsystems/storage-recovery.md")
- self.assertEqual(match["lane_context"]["lane_id"], "L15")
+
+ def test_lookup_paths_assigns_dashboard_overview_problem_resources_to_frontend_primitives(self) -> None:
+ result = lookup_paths(["frontend-modern/src/features/dashboardOverview/ProblemResourcesTable.tsx"])
+ self.assertEqual(result["unowned_runtime_files"], [])
+ self.assertEqual(
+ {item["subsystem"] for item in result["impacted_subsystems"]},
+ {"frontend-primitives"},
+ )
+ file_entry = result["files"][0]
+ self.assertEqual(file_entry["classification"], "runtime")
+ self.assertEqual(
+ {match["subsystem"] for match in file_entry["matches"]},
+ {"frontend-primitives"},
+ )
+ match = file_entry["matches"][0]
+ self.assertEqual(
+ match["contract"],
+ "docs/release-control/v6/internal/subsystems/frontend-primitives.md",
+ )
+ self.assertEqual(match["lane_context"]["lane_id"], "L8")
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-storage-recovery-surface",
+ "dashboard-overview-feature-surface",
)
self.assertEqual(
match["verification_requirement"]["exact_files"],
[
+ "frontend-modern/src/features/dashboardOverview/__tests__/KPIStrip.test.tsx",
+ "frontend-modern/src/features/dashboardOverview/__tests__/ProblemResourcesTable.test.tsx",
+ "frontend-modern/src/features/dashboardOverview/__tests__/TrendCharts.test.tsx",
"frontend-modern/src/pages/__tests__/DashboardPage.test.tsx",
+ "frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts",
+ "frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts",
],
)