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.

Retire dashboard landing surface

rcourtmanc743a231b8fb
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md
index c8dc2476ce..5d10a49ac1 100644
--- a/ARCHITECTURE.md
+++ b/ARCHITECTURE.md
@@ -97,7 +97,7 @@ All backend code lives under `cmd/`, `internal/`, and `pkg/`. The binary is asse
9. **Recovery Engine (`internal/recovery`)**
- Aggregates backup data (PBS snapshots, ZFS snapshots, replication tasks) into a unified recovery point timeline.
- - Provides faceted queries: filter by type, source, status. Rollup summaries for dashboards.
+ - Provides faceted queries: filter by type, source, status, and source health.
- API: `/api/recovery/points`, `/api/recovery/series`, `/api/recovery/facets`, `/api/recovery/rollups`.
10. **Audit Logging (`pkg/audit`)**
@@ -137,7 +137,6 @@ Navigation is organised by **task**, not by platform:
| `/storage` | Storage | Proxmox storage, ZFS pools, Ceph |
| `/recovery` | Recovery | Backups, snapshots, replication |
| `/ceph` | Ceph | Detailed Ceph cluster view |
-| `/dashboard` | Dashboard | Summary panels and metrics |
| `/alerts/*` | Alerts | Alert rules, active alerts, history |
| `/ai/*` | AI Intelligence | Patrol findings, investigations, forecasts |
| `/settings/*` | Settings | Configuration, security, diagnostics, reporting, AI, relay |
diff --git a/README.md b/README.md
index 23093c350d..45355c3ce5 100644
--- a/README.md
+++ b/README.md
@@ -16,11 +16,11 @@
## πŸš€ Overview
-Pulse is a modern, unified dashboard for monitoring your **infrastructure** across Proxmox, Docker, Kubernetes, and TrueNAS. It consolidates metrics, alerts, and AI-powered insights from all your systems into a single, beautiful interface.
+Pulse is a modern, unified monitoring workspace for your **infrastructure** across Proxmox, Docker, Kubernetes, and TrueNAS. It consolidates metrics, alerts, and AI-powered insights from all your systems into a single, beautiful interface.
Designed for homelabs, sysadmins, and MSPs who need a "single pane of glass" without the complexity of enterprise monitoring stacks.
-![Pulse Dashboard](docs/images/01-dashboard.jpg)
+![Pulse Infrastructure](docs/images/01-dashboard.jpg)
## 🧭 Unified Navigation
@@ -94,7 +94,7 @@ docker run -d \
rcourtman/pulse:vX.Y.Z
```
-Access the dashboard at `http://<your-ip>:7655`.
+Open Pulse at `http://<your-ip>:7655`.
## Local Development
diff --git a/docs/RBAC.md b/docs/RBAC.md
index bbd09d6c91..d8943ff23d 100644
--- a/docs/RBAC.md
+++ b/docs/RBAC.md
@@ -176,7 +176,7 @@ A typical team configuration:
|------|------|--------|
| alice | `admin` | Full access to everything |
| bob | `operator` | Can view nodes/VMs and manage alerts |
-| carol | `viewer` | Read-only access to dashboards and metrics |
+| carol | `viewer` | Read-only access to monitoring views and metrics |
| monitoring-bot | API token with `alerts:read` scope | Automated alert polling |
---
diff --git a/docs/release-control/v6/internal/records/infrastructure-default-landing-dashboard-retirement-2026-04-29.md b/docs/release-control/v6/internal/records/infrastructure-default-landing-dashboard-retirement-2026-04-29.md
new file mode 100644
index 0000000000..7e75c07c64
--- /dev/null
+++ b/docs/release-control/v6/internal/records/infrastructure-default-landing-dashboard-retirement-2026-04-29.md
@@ -0,0 +1,44 @@
+# Infrastructure Default Landing Dashboard Retirement
+
+Date: 2026-04-29
+Lane: First-session post-RC polish
+Follow-up: `first-session-post-rc-polish`
+Assertion: `infrastructure-default-landing-surface`
+
+## Outcome
+
+Pulse v6 now treats Infrastructure as the authenticated landing surface. The old Dashboard route is retired instead of preserved as a compatibility wallboard: primary navigation no longer includes Dashboard, root runtime routing sends authenticated operators to Infrastructure, and first-session/setup completion handoffs now point into Infrastructure or Add infrastructure.
+
+The Dashboard-specific overview stack is also removed rather than rebranded locally. Workload table code that still belongs to the product is owned under `frontend-modern/src/components/Workloads/`, and the deleted Dashboard overview API (`/api/resources/dashboard-summary`) is absent from the router, handler inventory, client API, and route tests.
+
+## Proof
+
+- `npm --prefix frontend-modern run type-check`
+ - Result: pass.
+- `npm --prefix frontend-modern run lint`
+ - Result: pass; ESLint, theme audit, and canonical platform audit completed.
+- `npm --prefix frontend-modern test -- src/components/Workloads src/pages/__tests__/Workloads.helpers.test.ts src/utils/__tests__/frontendResourceTypeBoundaries.test.ts src/utils/__tests__/workloadEmptyStatePresentation.test.ts src/utils/__tests__/workloadGuestPresentation.test.ts src/__tests__/App.architecture.test.ts src/__tests__/AppLayout.test.tsx src/routing/__tests__/navigation.test.ts`
+ - Result: pass, 36 files and 563 tests.
+- `go test ./internal/api -run 'Test(RouterRouteInventory|RouteInventoryContractCoversAllRouteModules|RouterFrontendRouteInventory|ResourceList|ResourceGet|ResourceAndStorageResponses|ResourceContract|ApplyResource|ComputeResource|UnsupportedResourceType|ParseResource|SecurityStatus|SecurityTokens|RouterCSRF|AdminEndpoints|SSO|OIDC|SAML|MagicLink|HandlePublicMagicLink|EstablishOIDCSession|EstablishSAMLSession|BuildSSOOIDCCallbackURL|SanitizeOIDCReturnTo|RedirectOIDC|RedirectSAML|Contract_Resource|Contract_Security|Contract_ResetFirstRunSecurity)' -count=1`
+ - Result: pass.
+- `python3 scripts/release_control/contract_audit.py --pretty`
+ - Result: pass.
+- `python3 scripts/release_control/status_audit.py --pretty`
+ - Result: pass.
+- `python3 scripts/release_control/registry_audit.py --pretty`
+ - Result: pass.
+- `python3 scripts/release_control/canonical_completion_guard.py`
+ - Result: pass.
+- `python3 scripts/release_control/canonical_completion_guard_test.py`
+ - Result: pass, 136 tests.
+- `python3 scripts/release_control/subsystem_lookup_test.py`
+ - Result: pass, 181 tests.
+- Browser proof on the local v6 app:
+ - Authenticated `/` redirected to `/infrastructure`.
+ - `/infrastructure` rendered the Infrastructure heading with no Dashboard primary-nav tab.
+ - `/dashboard` rendered the Not Found page with no Workloads surface and no Dashboard primary-nav tab.
+
+## Verification Residual
+
+- `go test ./internal/api -count=1`
+ - Result: fail outside this slice. `TestSLO_WorkloadCharts` exceeded its strict local p95 SLO under package load (`p95=92.83075ms` against a 90ms target), and `TestSLO_WorkloadsSummaryCharts` exceeded the same local p95 SLO (`p95=135.267ms` against a 90ms target). The focused API route/resource/auth contract tests above are green.
diff --git a/docs/release-control/v6/internal/status.json b/docs/release-control/v6/internal/status.json
index 9a97b8605b..34153adf39 100644
--- a/docs/release-control/v6/internal/status.json
+++ b/docs/release-control/v6/internal/status.json
@@ -2898,37 +2898,37 @@
"evidence": [
{
"repo": "pulse",
- "path": "frontend-modern/src/components/Dashboard/__tests__/Dashboard.performance.contract.test.tsx",
+ "path": "frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx",
"kind": "file"
},
{
"repo": "pulse",
- "path": "frontend-modern/src/components/Dashboard/Dashboard.tsx",
+ "path": "frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts",
"kind": "file"
},
{
"repo": "pulse",
- "path": "frontend-modern/src/components/Dashboard/workloadSelectors.ts",
+ "path": "frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts",
"kind": "file"
},
{
"repo": "pulse",
- "path": "frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx",
+ "path": "frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx",
"kind": "file"
},
{
"repo": "pulse",
- "path": "frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts",
+ "path": "frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx",
"kind": "file"
},
{
"repo": "pulse",
- "path": "frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts",
+ "path": "frontend-modern/src/components/Workloads/workloadSelectors.ts",
"kind": "file"
},
{
"repo": "pulse",
- "path": "frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx",
+ "path": "frontend-modern/src/components/Workloads/WorkloadsSurface.tsx",
"kind": "file"
},
{
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index d6d9bb4d23..d222543716 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -307,16 +307,16 @@ helper instead of carrying lifecycle-local background or hover classes.
That same presentation-only boundary must preserve canonical millisecond timestamps when it serializes chart points, so lifecycle-adjacent first-host and fleet surfaces do not misread rounded chart samples as duplicate or restarted heartbeat evidence.
The same rule now applies to storage summary interaction. Shared sticky-card or row-hover focus behavior on infrastructure, workloads, and storage may reuse the canonical chart transport, but lifecycle-adjacent install, enrollment, and fleet surfaces must not treat highlighted summary series or sticky-shell state as agent freshness or setup progress.
The same rule now applies to infrastructure-summary metric filters. Shared
- dashboard and infrastructure consumers may narrow the canonical
+ infrastructure and other route-owned consumers may narrow the canonical
`/api/charts/infrastructure` payload with a `metrics` query for
presentation hot paths, but lifecycle surfaces must not reinterpret
omitted disk or network series as missing lifecycle telemetry, missing
agent capabilities, or reduced fleet freshness truth.
- The same rule now applies to compact dashboard summary payloads. Shared
- `internal/api/resources.go` summary routes may collapse resource counts,
- problem rows, and top-resource rankings for dashboard hot paths, but
- lifecycle surfaces must not treat `/api/resources/dashboard-summary` as
- install inventory authority, enrollment proof, or fleet freshness truth.
+ The same rule now applies to retired compact dashboard summary payloads.
+ Shared `internal/api/resources.go` routes must not restore
+ `/api/resources/dashboard-summary` as a compatibility read; lifecycle
+ surfaces must continue to use install inventory, enrollment proof, and
+ fleet freshness truth from their owning contracts.
The same presentation-only boundary now covers compact storage summary
chart reads as well. Shared `/api/charts/storage-summary` transport may
request only the canonical `used` and `avail` storage series needed for the
@@ -597,8 +597,8 @@ helper instead of carrying lifecycle-local background or hover classes.
platform-management shell. The secondary agent handoff must land on
`/settings/infrastructure?add=agent`.
When the first host reports successfully, the install workflow must treat
- that as a completion handoff with direct navigation into `/dashboard` and
- `/settings/infrastructure/operations` instead of leaving operators on a
+ that as a completion handoff with direct navigation into `/infrastructure`
+ and `/settings/infrastructure/operations` instead of leaving operators on a
generic lookup result. When the workspace starts from zero active connected
infrastructure and install commands are available, the same lifecycle path
must auto-watch the canonical `/api/state` projection for the first
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index 399e2fabd6..9e79209a4f 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -247,7 +247,7 @@ assistant drawer may dock and push the authenticated shell only when the
viewport is wide enough to preserve a usable primary operating surface; once
the available viewport drops below that shell threshold, the drawer must
become an overlay owned by `frontend-modern/src/components/AI/Chat/index.tsx`
-instead of compressing Infrastructure, Dashboard, Storage, or other primary
+instead of compressing Infrastructure, Workloads, Storage, or other primary
runtime pages into an unusable narrow column or forking page-local layout
exceptions.
The closed assistant launcher follows the same shared-shell rule. While the
@@ -875,19 +875,19 @@ The `/api/ai/intelligence/changes` endpoint should also route through the
canonical unified-intelligence recent-change accessor before any
patrol-local detector fallback, so the API surface reads the same unified
timeline source that powers the summary payload.
-Dashboard Pulse Brief context follows the same monitoring-first AI boundary:
-Pulse may surface an Assistant-ready operator paragraph on the dashboard, but
-the first render must be fact-bound to governed dashboard, Patrol, storage,
-recovery, and alert summaries and must pass those facts as structured context
-when the operator asks Assistant to continue. Future server-generated dashboard
-briefs must keep that structured fact contract and policy boundary rather than
-letting an unbounded prompt become the dashboard's source of truth.
-The dashboard-to-Assistant handoff must also keep its execution mode scoped to
-the request. When a Pulse Brief opens Assistant from the dashboard, the drawer
-may prefill the governed dashboard prompt and context, but the submitted chat
-request must set `autonomous_mode:false`, preserve the operator's persistent
-Assistant control-level setting, and disclose the temporary approval-required
-mode in the drawer instead of showing the generic Autonomous warning.
+Retired dashboard Pulse Brief context follows the same monitoring-first AI
+boundary in negative space: `frontend-modern/src/features/dashboardOverview/`
+and the Dashboard route must not be restored just to create an Assistant-ready
+operator paragraph. Future overview or brief surfaces need a governed product
+owner first, must pass fact-bound structured context from owning Infrastructure,
+Workloads, Patrol, storage, recovery, and alert summaries, and must not let an
+unbounded prompt become a route's source of truth.
+Future route-to-Assistant handoffs must also keep their execution mode scoped
+to the request. When an overview brief opens Assistant, the drawer may prefill
+only governed prompt/context data, but the submitted chat request must set
+`autonomous_mode:false`, preserve the operator's persistent Assistant
+control-level setting, and disclose the temporary approval-required mode in
+the drawer instead of showing the generic Autonomous warning.
Those backend AI and Patrol change summaries should derive their canonical
labels and provenance fragments from
`internal/unifiedresources/change_presentation.go`, so the resource-model
diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.md
index abf4eb6c8a..37b75547f2 100644
--- a/docs/release-control/v6/internal/subsystems/alerts.md
+++ b/docs/release-control/v6/internal/subsystems/alerts.md
@@ -25,7 +25,7 @@ operator-facing alert routing behavior for live runtime alerts.
3. `internal/alerts/canonical_metric.go`
4. `internal/alerts/canonical_lifecycle.go`
5. `internal/alerts/unified_incidents.go`
-6. `frontend-modern/src/components/Alerts/RecentAlertsPanel.tsx`
+6. `frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx`
7. `frontend-modern/src/utils/alertOverviewPresentation.ts`
8. `frontend-modern/src/utils/alertResourceTablePresentation.ts`
9. `frontend-modern/src/utils/alertDestinationsPresentation.ts`
@@ -501,31 +501,25 @@ inline in `frontend-modern/src/features/alerts/OverviewTab.tsx`.
The canonical shared alert-acknowledgement runtime owner is now
`frontend-modern/src/features/alerts/useAlertAcknowledgementState.ts`, which
owns optimistic single/bulk acknowledge control flow, restore behavior, and
-notification feedback for both
-`frontend-modern/src/features/alerts/useAlertOverviewState.ts` and
-`frontend-modern/src/components/Alerts/RecentAlertsPanel.tsx`.
+notification feedback for `frontend-modern/src/features/alerts/useAlertOverviewState.ts`
+and the alert overview render shells.
`frontend-modern/src/features/alerts/useAlertOverviewState.ts` now owns the
derived alert read-model and Last 24 Hours stat refresh for
`frontend-modern/src/features/alerts/OverviewTab.tsx`, while composing that
shared acknowledgement owner instead of keeping its own alert mutation fork.
-Future overview or dashboard recent-alert action behavior should extend that
-shared acknowledgement hook instead of putting acknowledge mutations back into
-either render shell.
+Future overview action behavior should extend that shared acknowledgement hook
+instead of putting acknowledge mutations back into render shells.
Render-heavy alert overview ownership now routes through
`frontend-modern/src/features/alerts/AlertOverviewStatsCards.tsx`,
`frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx`,
and `frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx` instead
of rebuilding stats-card, active-alert, and timeline-card presentation inline
inside `frontend-modern/src/features/alerts/OverviewTab.tsx`.
-Dashboard recent-alert rendering and dashboard alert summary/tone copy now
-route through that same alert overview presentation owner and the alert-owned
-`frontend-modern/src/components/Alerts/RecentAlertsPanel.tsx` surface instead
-of living as a dashboard-page-local panel plus a second dashboard-only alert
-presentation helper.
-That same dashboard recent-alert surface must rank structural health warnings
-above state-only warning messages such as powered-off, stopped, or paused
-workloads before falling back to recency, so chosen workload state does not
-hide active infrastructure or storage problems on the first dashboard screen.
+The retired dashboard recent-alert panel must not be reintroduced as a
+parallel alert surface. Alert summary/tone copy belongs to the alert overview
+presentation owner, and any future compact alert surface must compose the
+shared alert read-model and acknowledgement hook rather than creating a
+dashboard-only panel.
Alert threshold and schedule surfaces must now also treat
`discoveryTarget` as optional frontend input and keep grouping-card state on
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index ba7c8b6ef3..f9fed41d4a 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -428,22 +428,21 @@ the canonical monitored-system blocked payload.
`internal/api/router_routes_monitoring.go`, `internal/api/router.go`,
`internal/api/types.go`, and `internal/api/contract_test.go` must route
optional infrastructure-summary `metrics` filters through one governed
- transport contract, so dashboard-specific consumers can request only CPU
- and memory without inventing a second summary endpoint or silently widening
- back to disk/network payloads. The same contract must carry those requested
- metric filters through the shared guest-chart batch loader in
+ transport contract, so route-owned consumers can request only the series
+ they render without inventing a second summary endpoint or silently
+ widening back to disk/network payloads. The same contract must carry those
+ requested metric filters through the shared guest-chart batch loader in
`internal/monitoring/monitor_metrics.go` instead of fetching the full guest
metric set and trimming after the API payload is already assembled.
-37. Keep the compact dashboard overview route canonical on that same shared API
- surface. `internal/api/resources.go`,
- `internal/api/router_routes_monitoring.go`,
- `frontend-modern/src/api/resources.ts`,
- `frontend-modern/src/hooks/useDashboardOverview.ts`, and frontend dashboard
- consumers must route KPI cards, problem-resource rows, governed resource
- labels, top-infrastructure identity, and canonical metrics-target join keys
- through `/api/resources/dashboard-summary` instead of reconstructing that
- shell from the paginated `/api/resources` list payload or guessing how
- dashboard trend identities map onto infrastructure chart series.
+37. Keep the retired compact dashboard overview route absent from that same
+ shared API surface. `internal/api/resources.go`,
+ `internal/api/router_routes_monitoring.go`, and
+ `frontend-modern/src/api/resources.ts` must not restore
+ `/api/resources/dashboard-summary`, `useDashboardOverview`, or frontend
+ dashboard consumers as compatibility paths for KPI cards, problem-resource
+ rows, governed resource labels, top-infrastructure identity, or metrics-
+ target join keys. New summary payloads must be owned by their product
+ route and pinned in the API contract there.
38. Keep mock and demo chart reads on the same canonical unified snapshot as
the rest of the API surface. `internal/api/router.go`,
`internal/api/contract_test.go`, and chart consumers must route
@@ -594,7 +593,7 @@ the canonical monitored-system blocked payload.
boundary: when
`frontend-modern/src/components/Settings/useInfrastructureInstallState.tsx`
receives a successful connected-agent lookup result, the canonical install
- flow must expose direct navigation into `/dashboard` and
+ flow must expose direct navigation into `/infrastructure` and
`/settings/infrastructure/operations` rather than leaving the operator on a
transport-only status readout.
21. Keep the shared first-host detection contract explicit on `/api/state` as
@@ -699,7 +698,7 @@ the canonical monitored-system blocked payload.
the status payload flips `hasAuthentication` to `false`, preserves
`bootstrapTokenPath`, and allows browser-owned first-session proof to
re-enter the real setup wizard instead of silently falling back to an
- authenticated dashboard state. That recovery transport may expose the
+ already-authenticated app state. That recovery transport may expose the
bootstrap token file path, but it must not emit the token value into
automatic runtime logs.
30. Keep shared SSO test and metadata-preview transport fail-closed: SAML
@@ -924,7 +923,7 @@ that internal grant.
That same shared API contract now also owns browser-proofed read separation.
Non-billing browser journeys such as
`tests/integration/tests/11-first-session.spec.ts`,
-`tests/integration/tests/journeys/01-smoke-bootstrap-login-dashboard.spec.ts`,
+`tests/integration/tests/journeys/01-smoke-bootstrap-login-infrastructure.spec.ts`,
and `tests/integration/tests/journeys/03-relay-pairing.spec.ts` may call
`/api/license/runtime-capabilities` for feature truth, but they must assert
zero browser requests to `/api/license/entitlements`. Billing activation,
@@ -1604,9 +1603,9 @@ That correlations route now reads through the canonical AI intelligence
facade first, so the handler and its payload keep the detector behind one
shared access layer instead of routing directly to Patrol-local correlation
state.
-That store now also owns the dashboard load bundle used by the Patrol page,
-so the page refresh path stays aligned on one store-owned orchestration layer
-instead of re-encoding the AI bundle inline.
+That store now also owns the Patrol page load bundle, so the page refresh path
+stays aligned on one store-owned orchestration layer instead of re-encoding
+the AI bundle inline.
The AI summary page now also renders the canonical
`frontend-modern/src/components/Infrastructure/ResourcePolicySummary.tsx`
card for policy posture, so sensitivity, routing, and redaction counts are
diff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.md
index 9524437d25..c612ca9947 100644
--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md
+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md
@@ -267,7 +267,7 @@ runtime gating as separate unlinked claims.
they must not turn `trial_eligible`, `trial_eligibility_reason`, or an
expired trial marker into a default Pro CTA or banner.
17. Add or change monitored-system ledger, disclosure, or admission-preview presentation through `frontend-modern/src/components/Settings/MonitoredSystemLedgerPanel.tsx`, `frontend-modern/src/components/Settings/MonitoredSystemAdmissionPreview.tsx`, `frontend-modern/src/components/Commercial/MonitoredSystemDefinitionDisclosure.tsx`, and `frontend-modern/src/utils/monitoredSystemPresentation.ts`
-18. Add or change paid relay settings and pairing presentation through `frontend-modern/src/components/Settings/RelaySettingsPanel.tsx`, `frontend-modern/src/components/Settings/RelayPairingSection.tsx`, and `frontend-modern/src/components/Settings/useRelaySettingsPanelState.ts`. The Dashboard shell must not carry a Relay onboarding card or equivalent blanket upsell β€” relay discovery stays inside its owning settings surface.
+18. Add or change paid relay settings and pairing presentation through `frontend-modern/src/components/Settings/RelaySettingsPanel.tsx`, `frontend-modern/src/components/Settings/RelayPairingSection.tsx`, and `frontend-modern/src/components/Settings/useRelaySettingsPanelState.ts`. The retired Dashboard shell must not be restored to carry a Relay onboarding card or equivalent blanket upsell β€” relay discovery stays inside its owning settings surface.
Public demo and other read-only presentation policy states must suppress
relay setup and upsell onboarding instead of inviting pairing or commercial
action from a governed non-manageable surface.
@@ -359,11 +359,11 @@ runtime gating as separate unlinked claims.
RBAC, SSO, audit logging, reporting, and agent profiles may remain present,
but they are secondary included value and must not displace that operator
outcome framing on owned commercial surfaces.
-24. Keep public-demo dashboard bootstrap route-owned on the adjacent
+24. Keep public-demo route bootstrap owned on the adjacent
commercial/runtime boundary. `frontend-modern/src/useAppRuntimeState.ts`
- may prewarm shared infrastructure summary caches for non-dashboard routes,
- but public-demo dashboard arrival must not front-run a broader
- infrastructure-summary fetch than the route actually renders. Commercial
+ may prewarm shared infrastructure summary caches for route-owned surfaces,
+ but public-demo arrival must not front-run a broader infrastructure-summary
+ fetch than the route actually renders. Commercial
posture on `v6-demo` therefore stays governed by the route-owned
presentation policy and summary scope rather than by app-shell-wide
bootstrap heuristics. That same app-shell boundary must also keep the
@@ -641,7 +641,7 @@ contract, but shared billing and upgrade surfaces now hide or suppress
themselves from the resolved `presentationPolicy` payload instead of teaching
mock mode, response-header inference, or frontend-only feature flags to
bypass the real licensing model. That includes settings billing tabs,
-public-demo banner and monitored-system/trial nudges, dashboard relay
+public-demo banner and monitored-system/trial nudges, app-wide relay
paywalls, Patrol upgrade CTAs, and history-lock upsells. Demo readiness
therefore means presentation isolation, not a license exemption.
That same public-demo boundary now also owns route-level commercial
@@ -713,12 +713,12 @@ surfaces such as `frontend-modern/src/components/Settings/useProLicensePanelStat
may still force refresh through the same shared store when plan, activation, or
recovery actions mutate commercial truth.
Non-billing browser journeys must also stay off
-`/api/license/entitlements` entirely. Dashboard, infrastructure, alerts,
+`/api/license/entitlements` entirely. Infrastructure, Workloads, alerts,
first-session gated routes, and relay settings must take feature truth from
`/api/license/runtime-capabilities` or already loaded commercial posture, and
the governed browser proof in
`tests/integration/tests/11-first-session.spec.ts`,
-`tests/integration/tests/journeys/01-smoke-bootstrap-login-dashboard.spec.ts`,
+`tests/integration/tests/journeys/01-smoke-bootstrap-login-infrastructure.spec.ts`,
and `tests/integration/tests/journeys/03-relay-pairing.spec.ts` must continue
to assert zero browser-shell entitlement requests outside owned billing flows.
That same authenticated-shell commercial boundary may surface prerelease
@@ -1375,12 +1375,12 @@ That same authenticated route shell also owns the canonical post-auth landing
path. `frontend-modern/src/App.tsx` and
`frontend-modern/src/pages/RuntimeHome.tsx` must send authenticated `/`
through the runtime-home landing contract first: existing operators and
-self-hosted sessions land on the governed dashboard route, while hosted
-workspaces with no connected infrastructure forward into the canonical
-infrastructure onboarding contract before the workspace normalizes back to the
-single `/settings/infrastructure` shell. That same shared landing contract
-must not regress into a root-only redirect straight to the infrastructure
-workspace or a dashboard-only shortcut that strands first-time hosted tenants.
+self-hosted sessions land on the governed Infrastructure route, while hosted
+workspaces with no connected infrastructure stay on the same Infrastructure
+and Add infrastructure ownership path before the workspace normalizes back to
+the single `/settings/infrastructure` shell. That same shared landing contract
+must not regress into a root-only settings redirect or a dashboard-only
+shortcut that strands first-time hosted tenants.
That same landing contract also owns authenticated `/login`: once the browser
has a valid session, `frontend-modern/src/App.tsx` must route `/login`
through that same runtime-home landing boundary instead of leaving the
@@ -1580,10 +1580,11 @@ license state for Community users and leave discovery of paid tiers to
surfaces outside the plan page.
That same no-funnel rule extends beyond Settings -> Plan. The self-hosted
frontend must not render blanket trial/upgrade marketing to Community users
-from the main dashboard shell, the setup wizard completion screen, or any
+from the main app shell, the setup wizard completion screen, or any
app-wide surface that fires without the user having explicitly engaged with
-a paid feature. In particular the Dashboard overview may not carry a
-`RelayOnboardingCard` paywall or equivalent `Start trial` prompt, the
+a paid feature. In particular the retired Dashboard overview must not be
+restored to carry a `RelayOnboardingCard` paywall or equivalent `Start trial`
+prompt, the
`SetupCompletionPanel` may not carry a `Monitor from Anywhere` Relay trial
block, and no time-triggered "active use" nudge such as `ActiveUseTrialNudge`
may auto-appear for Community users. Feature-gated discovery that fires only
@@ -1673,10 +1674,10 @@ owns relay config/status polling and pairing runtime, and
`frontend-modern/src/components/Settings/RelayPairingSection.tsx` owns the QR
pairing surface. Future relay settings work must extend that split instead of
pulling polling and QR-generation lifecycle back into the shell component.
-The Dashboard shell must not host a Relay onboarding card or equivalent
-blanket Relay upsell. Relay discovery belongs to the owning Settings surface
-above; the Dashboard stays a monitoring-first view with no app-wide paywall
-onboarding composed into it.
+The retired Dashboard shell must not be restored to host a Relay onboarding
+card or equivalent blanket Relay upsell. Relay discovery belongs to the owning
+Settings surface above; Infrastructure and Workloads stay monitoring-first
+views with no app-wide paywall onboarding composed into them.
That relay pairing boundary now also includes backend-owned mobile credential
lifecycle: when the settings surface generates a mobile pairing QR, it must ask
the server for a fresh scoped Pulse Mobile relay access token, fetch the
@@ -2096,7 +2097,7 @@ canonical browser bootstrap signal, and shared billing or upgrade surfaces
must hide or suppress themselves from that contract rather than teaching mock
mode, response-header inference, or frontend-only feature flags to bypass the
real licensing model. That includes settings billing tabs, public-demo banner
-and monitored-system/trial nudges, dashboard relay paywalls, Patrol upgrade
+and monitored-system/trial nudges, app-wide relay paywalls, Patrol upgrade
CTAs, and history-lock upsells. Demo readiness therefore means presentation
isolation, not a license exemption.
That same bootstrap owner must also avoid protected pre-auth noise. When auth
diff --git a/docs/release-control/v6/internal/subsystems/deployment-installability.md b/docs/release-control/v6/internal/subsystems/deployment-installability.md
index 3cc01339e9..1351608d31 100644
--- a/docs/release-control/v6/internal/subsystems/deployment-installability.md
+++ b/docs/release-control/v6/internal/subsystems/deployment-installability.md
@@ -247,9 +247,10 @@ server-side update execution surfaces.
7. Keep managed-runtime first-session helpers deterministic: shared browser
helpers under `tests/integration/tests/helpers.ts` may only drive the live
setup wizard through the current managed runtime after refreshing the
- canonical dev reset route, and any helper changes that rely on hot-dev
- browser/backend behavior must keep a managed-runtime recovery proof updated
- in the same slice.
+ canonical dev reset route, authenticated completion must expect the
+ Infrastructure landing path rather than the retired `/dashboard` route, and
+ any helper changes that rely on hot-dev browser/backend behavior must keep a
+ managed-runtime recovery proof updated in the same slice.
8. Keep root-level Playwright wrapper routing on the canonical managed browser
truth. `playwright.config.ts`, `tests/integration/playwright.config.ts`,
and `tests/integration/tests/runtime-defaults.ts` must resolve the same
@@ -690,7 +691,8 @@ requests together with `page.request` or other direct API helper calls.
Managed runtime recovery and browser bootstrap proofs therefore need to keep
helper coverage that demonstrates browser-shell request tracking remains
trustworthy when the same test also performs direct health or security-status
-API probes.
+API probes, and that authenticated bootstrap does not fall back to the retired
+Dashboard route.
`scripts/hot-dev-bg.sh` must also supervise `scripts/hot-dev.sh` in an isolated
child session so an unexpected owner-process death cannot leave orphaned
watchers or health monitors behind. When the supervisor replaces the managed
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 954963ffaf..1c003b9c60 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -99,10 +99,10 @@ work extends shared components instead of creating new local variants.
73. `frontend-modern/src/utils/reportableResourceTypes.ts`
74. `frontend-modern/src/utils/reportingResourceTypes.ts`
75. `frontend-modern/src/utils/problemResourcePresentation.ts`
-76. `frontend-modern/src/utils/dashboardEmptyStatePresentation.ts`
-77. `frontend-modern/src/utils/dashboardGuestPresentation.ts`
-78. `frontend-modern/src/utils/dashboardKpiPresentation.ts`
-79. `frontend-modern/src/utils/dashboardTrendPresentation.ts`
+76. `frontend-modern/src/utils/workloadEmptyStatePresentation.ts`
+77. `frontend-modern/src/utils/workloadGuestPresentation.ts`
+78. `frontend-modern/src/utils/emptyStatePresentation.ts`
+79. `frontend-modern/src/utils/semanticTonePresentation.ts`
80. `frontend-modern/src/components/Toast/Toast.tsx`
81. `frontend-modern/src/utils/toast.ts`
82. `frontend-modern/src/utils/semanticTonePresentation.ts`
@@ -194,10 +194,10 @@ work extends shared components instead of creating new local variants.
icon components may keep their standalone labels, but the nav must treat
those icons as decorative inside tab buttons so names come from the tab
label plus meaningful badge counts, not duplicated icon titles.
- Dashboard overview primitives under `frontend-modern/src/features/` must keep
- grouped resource labels operator-readable: count-led labels may aggregate
- repeated resources, but uncountable or category-like resource types such as
- storage must use resource wording instead of naive pluralization.
+ Shared grouped-resource presentation primitives must keep grouped resource
+ labels operator-readable: count-led labels may aggregate repeated resources,
+ but uncountable or category-like resource types such as storage must use
+ resource wording instead of naive pluralization.
Infrastructure filter chrome under `frontend-modern/src/features/infrastructure/`
must use mode-oriented labels for table presentation controls: grouped table
mode is `Grouped`, not `Cluster`, because cluster remains a
@@ -536,9 +536,8 @@ work extends shared components instead of creating new local variants.
16. Keep assistant availability bootstrap on the shared app-shell boundary.
`frontend-modern/src/useAppRuntimeState.ts`,
`frontend-modern/src/App.tsx`,
- `frontend-modern/src/stores/aiChat.ts`,
- `frontend-modern/src/components/AI/Chat/index.tsx`, and
- `frontend-modern/src/hooks/useDashboardActions.ts` must consume the
+ `frontend-modern/src/stores/aiChat.ts`, and
+ `frontend-modern/src/components/AI/Chat/index.tsx` must consume the
backend-owned `/api/security/status.sessionCapabilities.assistantEnabled`
fact instead of probing `/api/settings/ai` or `/api/ai/*` during ordinary
route bootstrap. Closed assistant chrome and non-AI settings panels may
@@ -674,7 +673,7 @@ work extends shared components instead of creating new local variants.
instead of importing generic commercial presentation helpers directly into
hosted settings route shells.
8. Keep first-session dashboard empty-state copy on
- `frontend-modern/src/utils/dashboardEmptyStatePresentation.ts`, and make
+ `frontend-modern/src/utils/workloadEmptyStatePresentation.ts`, and make
infrastructure setup guidance name the canonical destination explicitly
instead of falling back to generic settings CTA labels.
9. Keep the live first-session wizard on the canonical three-step runtime
@@ -722,10 +721,11 @@ work extends shared components instead of creating new local variants.
and the `Add infrastructure` entry point on it, not by a second landing route,
so first-time operators and returning operators see one consistent
infrastructure surface by default.
-14. Keep dashboard onboarding copy on the shared presentation owner in
- `frontend-modern/src/utils/dashboardEmptyStatePresentation.ts`. Both the
- infrastructure empty state and the dashboard route's no-resources state
- must route first-time operators into the canonical
+14. Keep Infrastructure and Workloads onboarding copy on the shared
+ presentation owner in
+ `frontend-modern/src/utils/workloadEmptyStatePresentation.ts`. Both the
+ infrastructure empty state and the Workloads no-resources state must route
+ first-time operators into the canonical
`/settings/infrastructure?add=pick` source picker, describe platform API
inventory and Pulse Agent telemetry as equal source strategies, and avoid
falling back to either passive β€œnothing here yet” wording or the retired
@@ -778,14 +778,14 @@ work extends shared components instead of creating new local variants.
storage summary emphasis, and workloads summary emphasis must all route through
that helper instead of maintaining page-local copies of the same hover/focus
rules.
- `frontend-modern/src/App.tsx` must land `/` on the dashboard shell and let
- the governed dashboard empty state route first-time operators into the
- `Add infrastructure` source picker, instead of preserving a separate
- root-only jump to `/infrastructure` or an agent-only install jump that
- drifts from the rest of the onboarding contract.
+ `frontend-modern/src/App.tsx` must land `/` on the Infrastructure route and
+ let the governed Infrastructure empty state route first-time operators into
+ the `Add infrastructure` source picker, instead of preserving a separate
+ root-only compatibility shell or an agent-only install jump that drifts from
+ the rest of the onboarding contract.
The same entry-shell contract must also canonicalize authenticated
`/login`: once auth succeeds, the shared shell must resolve that route back
- onto the governed dashboard landing path instead of rendering a page-local
+ onto the governed Infrastructure landing path instead of rendering a page-local
not-found state inside the authenticated chrome.
24. Keep relay settings shell copy on the shared presentation owner in
`frontend-modern/src/utils/relayPresentation.ts`. The route metadata in
@@ -1213,9 +1213,9 @@ activity support surface or integrated summary panel must remain factual
activity copy rather than shifting into a second Patrol verdict label while a
run is underway.
`frontend-modern/src/components/shared/TagBadges.tsx` is now also the
-canonical tag-badge primitive. Dashboard workload rows and the unified-resource
-detail drawer must import that shared owner instead of keeping a dashboard-local
-tag badge variant or importing a feature-local path into infrastructure
+canonical tag-badge primitive. Workload rows and the unified-resource detail
+drawer must import that shared owner instead of keeping a workload-local tag
+badge variant or importing a feature-local path into infrastructure
surfaces.
That same owner now also holds the CSP-safe tag-dot rendering contract: tag
color and active-state emphasis must travel through SVG fill/stroke attributes
@@ -1322,33 +1322,21 @@ metadata. The shell may expose `data-active-series-display` and
runtime/model owners may decide whether a hovered or focused series is merely
emphasized or fully isolated; feature shells must not fork their own row-hover
line filtering.
-The dashboard overview trend cards now also have an explicit shared-shell
-obligation: `frontend-modern/src/features/dashboardOverview/TrendCharts.tsx`
-must treat missing infrastructure history as a governed empty state rather than
-as a silent blank sparkline box. Error copy and empty-history copy belong to
-the feature shell, while the data path and chart-shaping logic must stay in the
-owned hook/model layers that feed it.
-That same dashboard overview shell also owns workload discoverability copy on
-the KPI strip. `frontend-modern/src/features/dashboardOverview/KPIStrip.tsx`
-and `frontend-modern/src/utils/dashboardKpiPresentation.ts` must keep the
-`Workloads` card explicit that the unified workloads surface contains VMs,
-containers, and pods, rather than assuming operators will infer that mapping
-from the route label alone.
-That same dashboard boundary now also owns the shared dashboard presentation
-helpers through `frontend-modern/src/utils/dashboardEmptyStatePresentation.ts`,
-`frontend-modern/src/utils/dashboardGuestPresentation.ts`,
-`frontend-modern/src/utils/dashboardKpiPresentation.ts`,
-`frontend-modern/src/utils/dashboardMetricPresentation.ts`, and
-`frontend-modern/src/utils/dashboardTrendPresentation.ts`. Dashboard loading,
-disconnect, and empty states; guest backup/disk fallback copy; KPI card
-framing; status-badge, delta, percent, and action-priority formatting; and
-trend palette/error copy must extend those helpers instead of being redefined
-inline in route shells, guest rows, or overview cards.
-That shell must also stay passive with respect to data ownership: dashboard
-trend cards may render the summary-range controls and operator-facing empty or
-error copy, but they must not reintroduce route-local metrics-history fetch
-loops for CPU and memory sparklines when the canonical infrastructure summary
-surface already owns the chart contract.
+The retired dashboard overview route must not regain feature-local trend,
+KPI, problem-resource, or card shells. Workload-table and guest-row fallback
+copy that lives under `frontend-modern/src/components/Workloads/` must keep
+using `frontend-modern/src/utils/workloadEmptyStatePresentation.ts` and
+`frontend-modern/src/utils/workloadGuestPresentation.ts`. New route-level empty
+states, tone mapping, or compact issue copy must extend the shared
+`emptyStatePresentation`, `semanticTonePresentation`, and
+`problemResourcePresentation` helpers instead of reviving deleted
+dashboard-only KPI, metric, storage, recovery, or trend presentation helpers.
+That shell must also stay passive with respect to data ownership: future
+overview trend cards may render summary-range controls and operator-facing
+empty or error copy only after they have a governed owner, and they must not
+reintroduce route-local metrics-history fetch loops for CPU and memory
+sparklines when the canonical infrastructure summary surface already owns the
+chart contract.
The shared density map now follows that same owner split.
`frontend-modern/src/components/shared/DensityMap.tsx` stays the render shell,
`frontend-modern/src/components/shared/useDensityMapState.ts` owns hover
@@ -1685,7 +1673,7 @@ runtime logic inline. Audit-log filter option labels must come from
label primitive instead of hard-coded title-case strings in the settings shell.
That shared filter-option primitive is also the canonical owner for default
`All <scope>` option wording wherever a product surface exposes filter selects
-or segmented filter choices. Workloads/dashboard filters, storage source
+or segmented filter choices. Workloads filters, storage source
filters, recovery history and platform/type filters, Kubernetes namespace
drawers, resource-change timeline filters, and alert configuration options must
call `frontend-modern/src/components/shared/filterOptionPresentation.ts` through
@@ -1736,49 +1724,15 @@ public demo posture must keep those support entries hidden from the Settings
navigation instead of reviving a standalone operations page.
that are unavailable in demo mode.
-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.
-That same dashboard overview boundary owns the first-viewport estate
-orientation contract for the v6 landing page. `EstateSummaryPanel.tsx` and
-`estateSummaryModel.ts` in `frontend-modern/src/features/dashboardOverview/`
-must derive system count, health, source coverage, and freshness from the
-canonical connected-infrastructure projection, fall back only to the compact
-dashboard summary that the route already owns, and keep the explicit
-Infrastructure handoff above detailed problem, storage, recovery, or trend
-rows without restoring platform-special navigation.
-Source coverage is part of that first-viewport proof and must remain readable
-at mobile and tablet shell widths; the estate summary may wrap that provider
-inventory across lines, but it must not truncate the canonical source mix with
-ellipsis in the default dashboard viewport.
-That compact fallback must keep speaking in system terms. When the connected
-projection has not arrived yet, estate orientation copy may say how many
-systems are reporting or syncing, but it must not slide back to generic
-resource-count language that blurs the v6 system model.
-That first-viewport copy must distinguish system-level estate health from
-resource, alert, storage, or recovery issues that remain elsewhere on the
-dashboard, and partial/empty dashboard states must describe synchronization or
-infrastructure-source onboarding in operator terms instead of exposing
-implementation fallback language.
-The estate summary may surface resource and alert issue counts only as
-below-the-summary detail references; it must not claim the whole dashboard has
-no issues when storage or recovery widgets still own independent health
-signals. Those detail references must use governed dashboard section anchors so
-the first viewport can move focus to Problem Resources or Alerts without
-inventing separate dashboard drill-down routes.
-The dashboard may add an optional Pulse Brief below that estate orientation
-only when Assistant and Patrol are actually enabled and configured. That brief
-must stay additive to the factual dashboard source of truth, derive its first
-render from the already-owned estate, overview, action, storage, and recovery
-facts, and hand off to Pulse Assistant through a structured context prompt
-instead of replacing the route's canonical numbers, tables, or lane-owned
-widgets with model prose. `PulseBriefPanel.tsx`, `useDashboardPulseBrief.ts`,
-and `dashboardPulseBriefModel.ts` own that presentation and deterministic
-first-render summary contract under `frontend-modern/src/features/dashboardOverview/`.
+The dashboard overview route and its feature-owned summary surfaces are
+retired. Authenticated root entry now lands on Infrastructure, so first-
+viewport estate orientation belongs to the Infrastructure page and Add
+infrastructure flow rather than a separate dashboard shell. Future overview or
+brief-style surfaces must be governed as new product surfaces before they add
+route-level data orchestration, section anchors, or Assistant prompt handoffs;
+they must not restore `frontend-modern/src/pages/Dashboard.tsx`,
+`frontend-modern/src/features/dashboardOverview/`, or deleted dashboard-only
+presentation helpers as compatibility paths.
The recovery feature shell now also depends on the shared
`frontend-modern/src/components/shared/Subtabs.tsx` primitive for its primary
protected-items versus recovery-events workspace switch. The recovery lane may
@@ -1882,28 +1836,19 @@ status-shaped names such as `storage (offline)` into first-viewport prose or
grouped-row sublabels; when the resource name is only a type plus status, the
surface should summarize the type-level issue in operator language instead of
repeating raw backend-shaped labels.
-That same dashboard overview boundary must consume the governed Patrol finding
-presentation helpers when it surfaces Patrol findings in compact form. In
-`frontend-modern/src/features/dashboardOverview/ActionRequiredPanel.tsx`,
-Patrol-owned runtime findings must use the shared compact badge, title, and
-primary-action/manual-control contracts from
-`frontend-modern/src/utils/aiFindingPresentation.ts` rather than rendering raw
-`Pulse Patrol:` titles or generic snooze/dismiss controls that the Patrol
-runtime lifecycle rejects.
-That same boundary must also consume the shared attention-queue ordering from
-`frontend-modern/src/utils/aiFindingPresentation.ts` through
-`frontend-modern/src/hooks/useDashboardActions.ts`, so Patrol-blinding runtime
-issues sort ahead of same-severity infrastructure findings in the dashboard
-action panel instead of inheriting arbitrary store order.
+The retired dashboard action queue must not be reintroduced as a compact
+Patrol or infrastructure issue panel. Patrol-owned runtime findings remain
+governed by `frontend-modern/src/utils/aiFindingPresentation.ts` and their
+own Patrol route/store surfaces; any future cross-surface issue queue needs a
+new governed owner rather than reviving dashboard action-panel files.
Feature-owned alert shells under `frontend-modern/src/features/alerts/` now
also treat shared action runtime as a first-class feature owner instead of
-rebuilding it per surface. The overview shell and dashboard recent-alerts panel
-must both compose
+rebuilding it per surface. The overview shell must compose
`frontend-modern/src/features/alerts/useAlertAcknowledgementState.ts` for
acknowledge/restore behavior rather than keeping duplicate API and notification
-logic inline in `useAlertOverviewState.ts` or
-`frontend-modern/src/components/Alerts/RecentAlertsPanel.tsx`.
+logic inline in `useAlertOverviewState.ts` or a revived dashboard recent-alert
+panel.
The same feature-owner rule now applies to the alert scheduling surface:
`frontend-modern/src/features/alerts/tabs/ScheduleTab.tsx` must remain the
schedule render shell, while
@@ -2622,7 +2567,7 @@ path inside Infrastructure.
`frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx`,
`frontend-modern/src/components/Settings/settingsHeaderMeta.ts`,
`frontend-modern/src/components/Settings/settingsNavigationModel.ts`,
-`frontend-modern/src/utils/dashboardEmptyStatePresentation.ts`,
+`frontend-modern/src/utils/workloadEmptyStatePresentation.ts`,
`frontend-modern/src/utils/infrastructureEmptyStatePresentation.ts`, and
adjacent setup guidance must use `Add infrastructure` as the operator-facing
first-run label for API-backed onboarding, resolve that label to the shared
@@ -2707,8 +2652,7 @@ That same shared app-shell boundary now also owns assistant bootstrap silence
on non-AI routes. `frontend-modern/src/useAppRuntimeState.ts`,
`frontend-modern/src/App.tsx`,
`frontend-modern/src/stores/aiChat.ts`,
-`frontend-modern/src/components/AI/Chat/index.tsx`, and
-`frontend-modern/src/hooks/useDashboardActions.ts` must treat
+`frontend-modern/src/components/AI/Chat/index.tsx` must treat
`/api/security/status.sessionCapabilities.assistantEnabled` as the only
general-route assistant availability fact, while closed assistant chrome and
non-AI settings panels stay off `/api/settings/ai` and `/api/ai/*` until an
diff --git a/docs/release-control/v6/internal/subsystems/monitoring.md b/docs/release-control/v6/internal/subsystems/monitoring.md
index 1c83426be2..09b21af1b1 100644
--- a/docs/release-control/v6/internal/subsystems/monitoring.md
+++ b/docs/release-control/v6/internal/subsystems/monitoring.md
@@ -322,17 +322,17 @@ sampler generation instead of regenerating or re-downsampling the same seeded
timeline on every endpoint hit. When seeded mock history is rebuilt or a live
mock tick advances, monitoring must invalidate that cache so preview charts
stay current without paying repeated per-request synthesis cost.
-That same sampler-owned cache contract also covers compact dashboard summary
-reads. When live mock ticks advance, monitoring must repopulate the canonical
-24-hour aggregate `/api/charts/storage-summary` cache inside the sampler path
-instead of leaving the first operator request after each tick to rebuild
-per-pool mock storage charts on demand.
+That same sampler-owned cache contract also covers compact summary reads after
+the dashboard overview retirement. When live mock ticks advance, monitoring
+must repopulate the canonical 24-hour aggregate `/api/charts/storage-summary`
+cache inside the sampler path instead of leaving the first operator request
+after each tick to rebuild per-pool mock storage charts on demand.
That same metrics-hot-path ownership also includes metric-type selection for
-compact summary reads. When dashboard infrastructure or storage summary routes
-request only a subset of canonical chart series, `internal/monitoring/monitor_metrics.go`
-must preserve that narrowed metric set through the batch store fallback path
-instead of querying every metric type for each resource and discarding most of
-the payload afterward.
+compact summary reads. When infrastructure or storage summary routes request
+only a subset of canonical chart series,
+`internal/monitoring/monitor_metrics.go` must preserve that narrowed metric
+set through the batch store fallback path instead of querying every metric type
+for each resource and discarding most of the payload afterward.
That same mock-runtime owner now also owns demo-scenario curation.
`internal/mock/fixture_graph.go`, `internal/mock/platform_fixtures.go`, and
`internal/mock/demo_scenarios.go` may project an authored demo estate over
diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
index 9d0081d454..f68bc7c627 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -9,7 +9,7 @@
"contract_file": "docs/release-control/v6/internal/subsystems/performance-and-scalability.md",
"status_file": "docs/release-control/v6/internal/status.json",
"registry_file": "docs/release-control/v6/internal/subsystems/registry.json",
- "dependency_subsystem_ids": ["ai-runtime", "api-contracts", "cloud-paid", "frontend-primitives", "storage-recovery", "unified-resources"]
+ "dependency_subsystem_ids": ["api-contracts", "frontend-primitives"]
}
```
@@ -25,63 +25,63 @@ regression protection.
3. `pkg/metrics/store_slo_test.go`
4. `internal/api/slo.go`
5. `internal/api/slo_bench_test.go`
-6. `frontend-modern/src/components/Dashboard/Dashboard.tsx`
-7. `frontend-modern/src/components/Dashboard/DashboardStateCards.tsx`
-8. `frontend-modern/src/components/Dashboard/DashboardStatsStrip.tsx`
-9. `frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx`
-10. `frontend-modern/src/components/Dashboard/WorkloadPanel.tsx`
-11. `frontend-modern/src/components/Dashboard/WorkloadTableHeader.tsx`
-12. `frontend-modern/src/components/Dashboard/useDashboardState.ts`
-13. `frontend-modern/src/components/Dashboard/useDashboardControlsState.ts`
-14. `frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts`
-15. `frontend-modern/src/components/Dashboard/useDashboardGuestMetadataState.ts`
-16. `frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts`
-17. `frontend-modern/src/components/Dashboard/useDashboardWorkloadRouteState.ts`
-18. `frontend-modern/src/components/Dashboard/useDashboardWorkloadUrlSync.ts`
-19. `frontend-modern/src/components/Dashboard/DashboardFilter.tsx`
-20. `frontend-modern/src/components/Dashboard/dashboardFilterModel.ts`
-21. `frontend-modern/src/components/Dashboard/useDashboardFilterState.ts`
-22. `frontend-modern/src/components/Dashboard/ThresholdSlider.tsx`
-23. `frontend-modern/src/components/Dashboard/thresholdSliderModel.ts`
-24. `frontend-modern/src/components/Dashboard/useThresholdSliderState.ts`
-25. `frontend-modern/src/components/Dashboard/StackedDiskBar.tsx`
-26. `frontend-modern/src/components/Dashboard/stackedDiskBarModel.ts`
-27. `frontend-modern/src/components/Dashboard/useStackedDiskBarState.ts`
-28. `frontend-modern/src/components/Dashboard/StackedMemoryBar.tsx`
-29. `frontend-modern/src/components/Dashboard/stackedMemoryBarModel.ts`
-30. `frontend-modern/src/components/Dashboard/useStackedMemoryBarState.ts`
-31. `frontend-modern/src/components/Dashboard/MetricBar.tsx`
-32. `frontend-modern/src/components/Dashboard/metricBarModel.ts`
-33. `frontend-modern/src/components/Dashboard/useMetricBarState.ts`
-34. `frontend-modern/src/components/Dashboard/EnhancedCPUBar.tsx`
-35. `frontend-modern/src/components/Dashboard/enhancedCpuBarModel.ts`
-36. `frontend-modern/src/components/Dashboard/useEnhancedCPUBarState.ts`
-37. `frontend-modern/src/components/Dashboard/DiskList.tsx`
-38. `frontend-modern/src/components/Dashboard/diskListModel.ts`
-39. `frontend-modern/src/components/Dashboard/useDiskListState.ts`
-40. `frontend-modern/src/components/Dashboard/GuestRow.tsx`
-41. `frontend-modern/src/components/Dashboard/GuestRowCells.tsx`
-42. `frontend-modern/src/components/Dashboard/guestRowModel.tsx`
-43. `frontend-modern/src/components/Dashboard/useGuestRowState.ts`
-44. `frontend-modern/src/components/Dashboard/GuestDrawer.tsx`
-45. `frontend-modern/src/components/Dashboard/GuestDrawerOverview.tsx`
-46. `frontend-modern/src/components/Dashboard/guestDrawerModel.ts`
-47. `frontend-modern/src/components/Dashboard/useGuestDrawerState.ts`
-48. `frontend-modern/src/components/Dashboard/useGroupedTableWindowing.ts`
-49. `frontend-modern/src/components/Dashboard/workloadSelectors.ts`
-50. `frontend-modern/src/components/Dashboard/workloadTopology.ts`
-51. `frontend-modern/src/components/Dashboard/dashboardSelectionModel.ts`
-52. `frontend-modern/src/components/Dashboard/dashboardWorkloadRouteModel.ts`
-53. `frontend-modern/src/components/Dashboard/dashboardWorkloadFilterConfigModel.ts`
-54. `frontend-modern/src/components/Dashboard/dashboardWorkloadRouteStateModel.ts`
-55. `frontend-modern/src/components/Dashboard/dashboardWorkloadUrlSyncModel.ts`
-56. `frontend-modern/src/components/Dashboard/useDashboardWorkloadFilterOptions.ts`
-57. `frontend-modern/src/components/Dashboard/__tests__/dashboardSelectionModel.test.ts`
-58. `frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadFilterConfigModel.test.ts`
-59. `frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteModel.test.ts`
-60. `frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteStateModel.test.ts`
-61. `frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadUrlSyncModel.test.ts`
-62. `frontend-modern/src/components/Dashboard/__tests__/workloadTopology.test.ts`
+6. `frontend-modern/src/components/Workloads/WorkloadsSurface.tsx`
+7. `frontend-modern/src/components/Workloads/WorkloadsStateCards.tsx`
+8. `frontend-modern/src/components/Workloads/WorkloadsStatsStrip.tsx`
+9. `frontend-modern/src/components/Workloads/WorkloadsTable.tsx`
+10. `frontend-modern/src/components/Workloads/WorkloadPanel.tsx`
+11. `frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx`
+12. `frontend-modern/src/components/Workloads/useWorkloadsState.ts`
+13. `frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts`
+14. `frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts`
+15. `frontend-modern/src/components/Workloads/useWorkloadGuestMetadataState.ts`
+16. `frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts`
+17. `frontend-modern/src/components/Workloads/useWorkloadRouteState.ts`
+18. `frontend-modern/src/components/Workloads/useWorkloadUrlSync.ts`
+19. `frontend-modern/src/components/Workloads/WorkloadsFilter.tsx`
+20. `frontend-modern/src/components/Workloads/workloadsFilterModel.ts`
+21. `frontend-modern/src/components/Workloads/useWorkloadsFilterState.ts`
+22. `frontend-modern/src/components/Workloads/ThresholdSlider.tsx`
+23. `frontend-modern/src/components/Workloads/thresholdSliderModel.ts`
+24. `frontend-modern/src/components/Workloads/useThresholdSliderState.ts`
+25. `frontend-modern/src/components/Workloads/StackedDiskBar.tsx`
+26. `frontend-modern/src/components/Workloads/stackedDiskBarModel.ts`
+27. `frontend-modern/src/components/Workloads/useStackedDiskBarState.ts`
+28. `frontend-modern/src/components/Workloads/StackedMemoryBar.tsx`
+29. `frontend-modern/src/components/Workloads/stackedMemoryBarModel.ts`
+30. `frontend-modern/src/components/Workloads/useStackedMemoryBarState.ts`
+31. `frontend-modern/src/components/Workloads/MetricBar.tsx`
+32. `frontend-modern/src/components/Workloads/metricBarModel.ts`
+33. `frontend-modern/src/components/Workloads/useMetricBarState.ts`
+34. `frontend-modern/src/components/Workloads/EnhancedCPUBar.tsx`
+35. `frontend-modern/src/components/Workloads/enhancedCpuBarModel.ts`
+36. `frontend-modern/src/components/Workloads/useEnhancedCPUBarState.ts`
+37. `frontend-modern/src/components/Workloads/DiskList.tsx`
+38. `frontend-modern/src/components/Workloads/diskListModel.ts`
+39. `frontend-modern/src/components/Workloads/useDiskListState.ts`
+40. `frontend-modern/src/components/Workloads/GuestRow.tsx`
+41. `frontend-modern/src/components/Workloads/GuestRowCells.tsx`
+42. `frontend-modern/src/components/Workloads/guestRowModel.tsx`
+43. `frontend-modern/src/components/Workloads/useGuestRowState.ts`
+44. `frontend-modern/src/components/Workloads/GuestDrawer.tsx`
+45. `frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx`
+46. `frontend-modern/src/components/Workloads/guestDrawerModel.ts`
+47. `frontend-modern/src/components/Workloads/useGuestDrawerState.ts`
+48. `frontend-modern/src/components/Workloads/useGroupedTableWindowing.ts`
+49. `frontend-modern/src/components/Workloads/workloadSelectors.ts`
+50. `frontend-modern/src/components/Workloads/workloadTopology.ts`
+51. `frontend-modern/src/components/Workloads/workloadSelectionModel.ts`
+52. `frontend-modern/src/components/Workloads/workloadRouteModel.ts`
+53. `frontend-modern/src/components/Workloads/workloadFilterConfigModel.ts`
+54. `frontend-modern/src/components/Workloads/workloadRouteStateModel.ts`
+55. `frontend-modern/src/components/Workloads/workloadUrlSyncModel.ts`
+56. `frontend-modern/src/components/Workloads/useWorkloadFilterOptions.ts`
+57. `frontend-modern/src/components/Workloads/__tests__/workloadSelectionModel.test.ts`
+58. `frontend-modern/src/components/Workloads/__tests__/workloadFilterConfigModel.test.ts`
+59. `frontend-modern/src/components/Workloads/__tests__/workloadRouteModel.test.ts`
+60. `frontend-modern/src/components/Workloads/__tests__/workloadRouteStateModel.test.ts`
+61. `frontend-modern/src/components/Workloads/__tests__/workloadUrlSyncModel.test.ts`
+62. `frontend-modern/src/components/Workloads/__tests__/workloadTopology.test.ts`
63. `frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx`
64. `frontend-modern/src/components/Infrastructure/unifiedResourceTableStateModel.ts`
65. `frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts`
@@ -95,33 +95,30 @@ regression protection.
73. `frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts`
74. `frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts`
75. `frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts`
-76. `frontend-modern/src/components/Dashboard/__tests__/Dashboard.performance.contract.test.tsx`
-77. `frontend-modern/src/components/Dashboard/__tests__/DashboardFilter.test.tsx`
-78. `frontend-modern/src/components/Dashboard/__tests__/useDashboardFilterState.test.ts`
-79. `frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.ts`
-80. `frontend-modern/src/components/Dashboard/MetricBar.test.tsx`
-81. `frontend-modern/src/components/Dashboard/__tests__/useMetricBarState.test.tsx`
-82. `frontend-modern/src/components/Dashboard/__tests__/EnhancedCPUBar.test.tsx`
-83. `frontend-modern/src/components/Dashboard/__tests__/useEnhancedCPUBarState.test.tsx`
-84. `frontend-modern/src/components/Dashboard/ThresholdSlider.test.tsx`
-85. `frontend-modern/src/components/Dashboard/__tests__/useThresholdSliderState.test.ts`
-86. `frontend-modern/src/components/Dashboard/__tests__/StackedDiskBar.test.tsx`
-87. `frontend-modern/src/components/Dashboard/__tests__/useStackedDiskBarState.test.tsx`
-88. `frontend-modern/src/components/Dashboard/StackedMemoryBar.test.tsx`
-89. `frontend-modern/src/components/Dashboard/__tests__/useStackedMemoryBarState.test.tsx`
-90. `frontend-modern/src/components/Dashboard/__tests__/DiskList.test.tsx`
-91. `frontend-modern/src/components/Dashboard/__tests__/GuestRow.test.tsx`
-92. `frontend-modern/src/components/Dashboard/GuestDrawer.test.tsx`
-93. `frontend-modern/src/components/Dashboard/__tests__/useGroupedTableWindowing.test.ts`
+76. `frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx`
+77. `frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx`
+78. `frontend-modern/src/components/Workloads/__tests__/useWorkloadsFilterState.test.ts`
+79. `frontend-modern/src/components/Workloads/__tests__/useWorkloadSelectionState.test.ts`
+80. `frontend-modern/src/components/Workloads/MetricBar.test.tsx`
+81. `frontend-modern/src/components/Workloads/__tests__/useMetricBarState.test.tsx`
+82. `frontend-modern/src/components/Workloads/__tests__/EnhancedCPUBar.test.tsx`
+83. `frontend-modern/src/components/Workloads/__tests__/useEnhancedCPUBarState.test.tsx`
+84. `frontend-modern/src/components/Workloads/ThresholdSlider.test.tsx`
+85. `frontend-modern/src/components/Workloads/__tests__/useThresholdSliderState.test.ts`
+86. `frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx`
+87. `frontend-modern/src/components/Workloads/__tests__/useStackedDiskBarState.test.tsx`
+88. `frontend-modern/src/components/Workloads/StackedMemoryBar.test.tsx`
+89. `frontend-modern/src/components/Workloads/__tests__/useStackedMemoryBarState.test.tsx`
+90. `frontend-modern/src/components/Workloads/__tests__/DiskList.test.tsx`
+91. `frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx`
+92. `frontend-modern/src/components/Workloads/GuestDrawer.test.tsx`
+93. `frontend-modern/src/components/Workloads/__tests__/useGroupedTableWindowing.test.ts`
94. `frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx`
-95. `frontend-modern/src/components/Dashboard/useDashboardWorkloadViewportSync.ts`
-96. `frontend-modern/src/components/Dashboard/__tests__/useDashboardWorkloadViewportSync.test.tsx`
+95. `frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts`
+96. `frontend-modern/src/components/Workloads/__tests__/useWorkloadViewportSync.test.tsx`
97. `frontend-modern/src/components/Infrastructure/InfrastructureSummary.tsx`
98. `frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts`
99. `frontend-modern/src/components/Infrastructure/infrastructureSummaryModel.ts`
-100. `frontend-modern/src/hooks/useDashboardTrends.ts`
-101. `frontend-modern/src/hooks/__tests__/useDashboardTrends.test.ts`
-102. `frontend-modern/src/components/Storage/DashboardStoragePanel.tsx`
103. `frontend-modern/src/components/Storage/StorageSummary.tsx`
104. `frontend-modern/src/utils/storageSummaryCache.ts`
105. `frontend-modern/src/pages/Workloads.tsx`
@@ -168,40 +165,36 @@ regression protection.
`/auth/trial-activate` and `POST /api/license/trial/start` from public-path
and CSRF inventories must stay as constant-time route-table absence rather
than replacing the old callback with persistence-backed router probes.
-5. Extend dashboard hot-path filter, sort, grouping, and stats math through `frontend-modern/src/components/Dashboard/workloadSelectors.ts`, and extend workload identity, discovery routing, and node-topology helpers through `frontend-modern/src/components/Dashboard/workloadTopology.ts`, rather than duplicating selector or topology logic in `frontend-modern/src/components/Dashboard/Dashboard.tsx`
- Dashboard landing-page estate orientation is part of that same hot-path
- discipline. First-viewport system count, health, source coverage, and
- freshness must be derived from app-runtime connected-infrastructure state
- and the already-loaded compact dashboard summary fallback; it must not
- introduce a new `useUnifiedResources()` subscription, platform-specific
- fetch, or chart/history request just to make the dashboard feel oriented.
- Dashboard Pulse Brief handoff belongs to that existing route state too:
- `frontend-modern/src/pages/Dashboard.tsx` may open Assistant with the
- already-derived compact prompt and a per-request approval-required override,
- but it must not introduce extra dashboard polling, model/settings fetches,
- or chart/history reads before the Assistant drawer is actually used.
-6. Normalize dashboard workload view-mode aliases through `frontend-modern/src/utils/workloads.ts` instead of keeping local URL/storage parsing in `frontend-modern/src/components/Dashboard/Dashboard.tsx`
-7. Deduplicate dashboard workload rows by canonical workload ID from `frontend-modern/src/utils/workloads.ts` rather than via local pass-through wrappers in `frontend-modern/src/components/Dashboard/Dashboard.tsx`
-8. Render dashboard row identity directly from the shared canonical workload helper so row selection, hover, and fallback metadata lookup stay aligned with the same workload contract
+5. Extend workload hot-path filter, sort, grouping, and stats math through `frontend-modern/src/components/Workloads/workloadSelectors.ts`, and extend workload identity, discovery routing, and node-topology helpers through `frontend-modern/src/components/Workloads/workloadTopology.ts`, rather than duplicating selector or topology logic in `frontend-modern/src/components/Workloads/WorkloadsSurface.tsx`
+ The retired dashboard overview route must not return as a hot-path
+ orientation shortcut. First-viewport system count, health, source coverage,
+ and freshness now belong to Infrastructure and Add infrastructure, derived
+ from their existing runtime/resource state rather than a dashboard-specific
+ compact summary fallback. Any future brief-style Assistant handoff needs a
+ newly governed owner and must not add route-global polling, model/settings
+ fetches, or chart/history reads to the authenticated root path.
+6. Normalize workload view-mode aliases through `frontend-modern/src/utils/workloads.ts` instead of keeping local URL/storage parsing in `frontend-modern/src/components/Workloads/WorkloadsSurface.tsx`
+7. Deduplicate workload rows by canonical workload ID from `frontend-modern/src/utils/workloads.ts` rather than via local pass-through wrappers in `frontend-modern/src/components/Workloads/WorkloadsSurface.tsx`
+8. Render workload row identity directly from the shared canonical workload helper so row selection, hover, and fallback metadata lookup stay aligned with the same workload contract
9. Format infrastructure sensor labels through the shared `frontend-modern/src/utils/textPresentation.ts` presentation helper instead of maintaining a local title-casing implementation in `frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts`
-10. Extend dashboard row contract and per-row hot-path derivations through `frontend-modern/src/components/Dashboard/guestRowModel.tsx` and `frontend-modern/src/components/Dashboard/useGuestRowState.ts`, and extend tooltip-backed row cell presentation through `frontend-modern/src/components/Dashboard/GuestRowCells.tsx`, rather than rebuilding column metadata, row identity, cell tooltips, or anomaly correlation inside `frontend-modern/src/components/Dashboard/GuestRow.tsx`
-11. Extend dashboard drawer derivations and runtime wiring through `frontend-modern/src/components/Dashboard/guestDrawerModel.ts` and `frontend-modern/src/components/Dashboard/useGuestDrawerState.ts`, and extend drawer overview rendering through `frontend-modern/src/components/Dashboard/GuestDrawerOverview.tsx`, rather than rebuilding canonical guest identity, discovery routing, or drawer-local normalization inside `frontend-modern/src/components/Dashboard/GuestDrawer.tsx`
-12. Extend dashboard disk-list derivations and fallback runtime wiring through `frontend-modern/src/components/Dashboard/diskListModel.ts` and `frontend-modern/src/components/Dashboard/useDiskListState.ts` rather than rebuilding usage math, progress-state mapping, or tooltip fallback logic inside `frontend-modern/src/components/Dashboard/DiskList.tsx`
-13. Extend dashboard guest metadata cache persistence, metadata refresh, org-scope switching, and optimistic custom-URL updates through `frontend-modern/src/components/Dashboard/useDashboardGuestMetadataState.ts` rather than rebuilding dashboard-local storage caches, event listeners, or guest metadata API wiring inside `frontend-modern/src/components/Dashboard/useDashboardState.ts`
-14. Extend dashboard deep-link selection and hovered-row continuity semantics through `frontend-modern/src/components/Dashboard/dashboardSelectionModel.ts`, and extend table scroll preservation plus reactive selection state through `frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts`, rather than rebuilding resource-query parsing, selected-row scroll pinning, or hovered-row invalidation inside `frontend-modern/src/components/Dashboard/useDashboardState.ts`; canonical typed workload IDs such as `app-container:<host>:<provider-id>` must remain exact route/selection keys and must not be reinterpreted into synthetic node scopes
-15. Extend dashboard workload route ownership, route-driven option catalogs, and toolbar filter config through `frontend-modern/src/components/Dashboard/useDashboardWorkloadRouteState.ts`, `frontend-modern/src/components/Dashboard/useDashboardWorkloadFilterOptions.ts`, `frontend-modern/src/components/Dashboard/dashboardWorkloadRouteModel.ts`, `frontend-modern/src/components/Dashboard/dashboardWorkloadFilterConfigModel.ts`, and `frontend-modern/src/components/Dashboard/dashboardWorkloadRouteStateModel.ts`, and extend query-param synchronization plus managed workload URL semantics through `frontend-modern/src/components/Dashboard/useDashboardWorkloadUrlSync.ts` and `frontend-modern/src/components/Dashboard/dashboardWorkloadUrlSyncModel.ts`, rather than rebuilding route sync, alias parsing, option derivation, toolbar callback/config wiring, reset policy, node-selection compatibility rules, param precedence, or managed workload URLs inside `frontend-modern/src/components/Dashboard/useDashboardState.ts`
- Workloads route host scopes must resolve through `frontend-modern/src/components/Dashboard/workloadTopology.ts`: app-container scopes use the canonical Docker/runtime host id before host labels or node fallbacks, while VM and system-container scopes keep the instance-node key. Route `agent` filters and option catalogs must consume that shared scope so Infrastructure related-workload links cannot drift from Workloads filtering.
-16. Extend grouped dashboard workload derivation, summary fallbacks, and grouped/windowed table presentation through `frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts`, extend viewport-driven grouped table synchronization through `frontend-modern/src/components/Dashboard/useDashboardWorkloadViewportSync.ts`, and extend node parent mapping through `frontend-modern/src/components/Dashboard/workloadTopology.ts`, rather than rebuilding grouped selectors, summary snapshot math, scroll listeners, or topology lookups inside `frontend-modern/src/components/Dashboard/useDashboardState.ts`
-17. Extend dashboard control defaults, persistent view preferences, keyboard reset behavior, column-visibility ownership, and tag-search flow through `frontend-modern/src/components/Dashboard/useDashboardControlsState.ts` and `frontend-modern/src/components/Dashboard/dashboardFilterModel.ts` rather than rebuilding sort/search/grouping state, reset drift, or column-toggle plumbing inside `frontend-modern/src/components/Dashboard/useDashboardState.ts`
-18. Extend dashboard filter active-count, reset semantics, and mobile toolbar state through `frontend-modern/src/components/Dashboard/dashboardFilterModel.ts` and `frontend-modern/src/components/Dashboard/useDashboardFilterState.ts`, rather than rebuilding filter-local state inside `frontend-modern/src/components/Dashboard/DashboardFilter.tsx`
-19. Extend threshold-slider value-position math, title/label derivation, and drag scroll-lock runtime through `frontend-modern/src/components/Dashboard/thresholdSliderModel.ts` and `frontend-modern/src/components/Dashboard/useThresholdSliderState.ts` rather than rebuilding slider-local state and pointer lifecycle inside `frontend-modern/src/components/Dashboard/ThresholdSlider.tsx`
-20. Extend stacked disk-bar capacity math, segment/tooltip derivation, and resize-observer runtime through `frontend-modern/src/components/Dashboard/stackedDiskBarModel.ts` and `frontend-modern/src/components/Dashboard/useStackedDiskBarState.ts` rather than rebuilding disk-bar-local state, mode branching, and tooltip shaping inside `frontend-modern/src/components/Dashboard/StackedDiskBar.tsx`
-21. Extend stacked memory-bar capacity math, balloon/swap derivation, and resize-observer runtime through `frontend-modern/src/components/Dashboard/stackedMemoryBarModel.ts` and `frontend-modern/src/components/Dashboard/useStackedMemoryBarState.ts` rather than rebuilding memory-bar-local state, tooltip shaping, and label-fit logic inside `frontend-modern/src/components/Dashboard/StackedMemoryBar.tsx`
-22. Extend metric-bar width, label-fit logic, and resize-observer runtime through `frontend-modern/src/components/Dashboard/metricBarModel.ts` and `frontend-modern/src/components/Dashboard/useMetricBarState.ts` rather than rebuilding metric-local state and threshold mapping inside `frontend-modern/src/components/Dashboard/MetricBar.tsx`
-23. Extend enhanced CPU bar usage/anomaly presentation and tooltip runtime through `frontend-modern/src/components/Dashboard/enhancedCpuBarModel.ts` and `frontend-modern/src/components/Dashboard/useEnhancedCPUBarState.ts` rather than rebuilding tooltip-local state and CPU-threshold formatting inside `frontend-modern/src/components/Dashboard/EnhancedCPUBar.tsx`
-23. Extend grouped dashboard row windowing, reveal-index clamping, overscan math, and per-group visible-slice derivation through `frontend-modern/src/components/Dashboard/useGroupedTableWindowing.ts`, and extend viewport event wiring through `frontend-modern/src/components/Dashboard/useDashboardWorkloadViewportSync.ts` rather than rebuilding scroll handlers, mounted-row budgets, viewport listeners, or group-slice math inside `frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts`
-24. Extend dashboard shell rendering through `frontend-modern/src/components/Dashboard/DashboardStateCards.tsx`, `frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx`, and `frontend-modern/src/components/Dashboard/DashboardStatsStrip.tsx` rather than accreting loading cards, workload table markup, or stats-strip presentation back into `frontend-modern/src/components/Dashboard/Dashboard.tsx`
-25. Extend dashboard workload table shell ownership through `frontend-modern/src/components/Dashboard/WorkloadTableHeader.tsx` and `frontend-modern/src/components/Dashboard/WorkloadPanel.tsx` rather than rebuilding sortable header markup, grouped node rows, row expansion, or guest-drawer rendering inside `frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx`
+10. Extend workload row contract and per-row hot-path derivations through `frontend-modern/src/components/Workloads/guestRowModel.tsx` and `frontend-modern/src/components/Workloads/useGuestRowState.ts`, and extend tooltip-backed row cell presentation through `frontend-modern/src/components/Workloads/GuestRowCells.tsx`, rather than rebuilding column metadata, row identity, cell tooltips, or anomaly correlation inside `frontend-modern/src/components/Workloads/GuestRow.tsx`
+11. Extend workload drawer derivations and runtime wiring through `frontend-modern/src/components/Workloads/guestDrawerModel.ts` and `frontend-modern/src/components/Workloads/useGuestDrawerState.ts`, and extend drawer overview rendering through `frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx`, rather than rebuilding canonical guest identity, discovery routing, or drawer-local normalization inside `frontend-modern/src/components/Workloads/GuestDrawer.tsx`
+12. Extend workload disk-list derivations and fallback runtime wiring through `frontend-modern/src/components/Workloads/diskListModel.ts` and `frontend-modern/src/components/Workloads/useDiskListState.ts` rather than rebuilding usage math, progress-state mapping, or tooltip fallback logic inside `frontend-modern/src/components/Workloads/DiskList.tsx`
+13. Extend workload guest metadata cache persistence, metadata refresh, org-scope switching, and optimistic custom-URL updates through `frontend-modern/src/components/Workloads/useWorkloadGuestMetadataState.ts` rather than rebuilding workload-local storage caches, event listeners, or guest metadata API wiring inside `frontend-modern/src/components/Workloads/useWorkloadsState.ts`
+14. Extend workload deep-link selection and hovered-row continuity semantics through `frontend-modern/src/components/Workloads/workloadSelectionModel.ts`, and extend table scroll preservation plus reactive selection state through `frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts`, rather than rebuilding resource-query parsing, selected-row scroll pinning, or hovered-row invalidation inside `frontend-modern/src/components/Workloads/useWorkloadsState.ts`; canonical typed workload IDs such as `app-container:<host>:<provider-id>` must remain exact route/selection keys and must not be reinterpreted into synthetic node scopes
+15. Extend workload route ownership, route-driven option catalogs, and toolbar filter config through `frontend-modern/src/components/Workloads/useWorkloadRouteState.ts`, `frontend-modern/src/components/Workloads/useWorkloadFilterOptions.ts`, `frontend-modern/src/components/Workloads/workloadRouteModel.ts`, `frontend-modern/src/components/Workloads/workloadFilterConfigModel.ts`, and `frontend-modern/src/components/Workloads/workloadRouteStateModel.ts`, and extend query-param synchronization plus managed workload URL semantics through `frontend-modern/src/components/Workloads/useWorkloadUrlSync.ts` and `frontend-modern/src/components/Workloads/workloadUrlSyncModel.ts`, rather than rebuilding route sync, alias parsing, option derivation, toolbar callback/config wiring, reset policy, node-selection compatibility rules, param precedence, or managed workload URLs inside `frontend-modern/src/components/Workloads/useWorkloadsState.ts`
+ Workloads route host scopes must resolve through `frontend-modern/src/components/Workloads/workloadTopology.ts`: app-container scopes use the canonical Docker/runtime host id before host labels or node fallbacks, while VM and system-container scopes keep the instance-node key. Route `agent` filters and option catalogs must consume that shared scope so Infrastructure related-workload links cannot drift from Workloads filtering.
+16. Extend grouped workload derivation, summary fallbacks, and grouped/windowed table presentation through `frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts`, extend viewport-driven grouped table synchronization through `frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts`, and extend node parent mapping through `frontend-modern/src/components/Workloads/workloadTopology.ts`, rather than rebuilding grouped selectors, summary snapshot math, scroll listeners, or topology lookups inside `frontend-modern/src/components/Workloads/useWorkloadsState.ts`
+17. Extend workload control defaults, persistent view preferences, keyboard reset behavior, column-visibility ownership, and tag-search flow through `frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts` and `frontend-modern/src/components/Workloads/workloadsFilterModel.ts` rather than rebuilding sort/search/grouping state, reset drift, or column-toggle plumbing inside `frontend-modern/src/components/Workloads/useWorkloadsState.ts`
+18. Extend workload filter active-count, reset semantics, and mobile toolbar state through `frontend-modern/src/components/Workloads/workloadsFilterModel.ts` and `frontend-modern/src/components/Workloads/useWorkloadsFilterState.ts`, rather than rebuilding filter-local state inside `frontend-modern/src/components/Workloads/WorkloadsFilter.tsx`
+19. Extend threshold-slider value-position math, title/label derivation, and drag scroll-lock runtime through `frontend-modern/src/components/Workloads/thresholdSliderModel.ts` and `frontend-modern/src/components/Workloads/useThresholdSliderState.ts` rather than rebuilding slider-local state and pointer lifecycle inside `frontend-modern/src/components/Workloads/ThresholdSlider.tsx`
+20. Extend stacked disk-bar capacity math, segment/tooltip derivation, and resize-observer runtime through `frontend-modern/src/components/Workloads/stackedDiskBarModel.ts` and `frontend-modern/src/components/Workloads/useStackedDiskBarState.ts` rather than rebuilding disk-bar-local state, mode branching, and tooltip shaping inside `frontend-modern/src/components/Workloads/StackedDiskBar.tsx`
+21. Extend stacked memory-bar capacity math, balloon/swap derivation, and resize-observer runtime through `frontend-modern/src/components/Workloads/stackedMemoryBarModel.ts` and `frontend-modern/src/components/Workloads/useStackedMemoryBarState.ts` rather than rebuilding memory-bar-local state, tooltip shaping, and label-fit logic inside `frontend-modern/src/components/Workloads/StackedMemoryBar.tsx`
+22. Extend metric-bar width, label-fit logic, and resize-observer runtime through `frontend-modern/src/components/Workloads/metricBarModel.ts` and `frontend-modern/src/components/Workloads/useMetricBarState.ts` rather than rebuilding metric-local state and threshold mapping inside `frontend-modern/src/components/Workloads/MetricBar.tsx`
+23. Extend enhanced CPU bar usage/anomaly presentation and tooltip runtime through `frontend-modern/src/components/Workloads/enhancedCpuBarModel.ts` and `frontend-modern/src/components/Workloads/useEnhancedCPUBarState.ts` rather than rebuilding tooltip-local state and CPU-threshold formatting inside `frontend-modern/src/components/Workloads/EnhancedCPUBar.tsx`
+23. Extend grouped workload row windowing, reveal-index clamping, overscan math, and per-group visible-slice derivation through `frontend-modern/src/components/Workloads/useGroupedTableWindowing.ts`, and extend viewport event wiring through `frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts` rather than rebuilding scroll handlers, mounted-row budgets, viewport listeners, or group-slice math inside `frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts`
+24. Extend Workloads shell rendering through `frontend-modern/src/components/Workloads/WorkloadsStateCards.tsx`, `frontend-modern/src/components/Workloads/WorkloadsTable.tsx`, and `frontend-modern/src/components/Workloads/WorkloadsStatsStrip.tsx` rather than accreting loading cards, workload table markup, or stats-strip presentation back into `frontend-modern/src/components/Workloads/WorkloadsSurface.tsx`
+25. Extend workload table shell ownership through `frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx` and `frontend-modern/src/components/Workloads/WorkloadPanel.tsx` rather than rebuilding sortable header markup, grouped node rows, row expansion, or guest-drawer rendering inside `frontend-modern/src/components/Workloads/WorkloadsTable.tsx`
Compact icon headers inside `WorkloadTableHeader.tsx` may stay visually
dense for responsive workload tables, but the icon must be decorative and
the column label must remain present through an `sr-only` label so the
@@ -253,14 +246,14 @@ regression protection.
show the host and service tables dropping lower-priority columns without
introducing horizontal overflow.
Dashboard workload table responsive behavior belongs to the same hot-path
- owner. `frontend-modern/src/components/Dashboard/useDashboardControlsState.ts`
+ owner. `frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts`
must derive workload table layout stages from live viewport width, and
- `frontend-modern/src/components/Dashboard/guestRowModel.tsx` must own the
- responsive workload column priority and width model. `DashboardWorkloadTable`,
+ `frontend-modern/src/components/Workloads/guestRowModel.tsx` must own the
+ responsive workload column priority and width model. `WorkloadsTable`,
`WorkloadTableHeader`, and `WorkloadPanel` must consume one shared
layout-visible column set so headers, colgroups, and rows stay aligned during
live resize. View-mode-specific column sets in
- `frontend-modern/src/components/Dashboard/guestRowModel.tsx` must retain
+ `frontend-modern/src/components/Workloads/guestRowModel.tsx` must retain
core monitoring metrics when narrowing scope: app-container mode keeps CPU,
memory, disk, and the responsive Net I/O and Disk I/O columns available,
while the layout priority model decides when detail-heavy I/O columns are
@@ -287,7 +280,14 @@ regression protection.
performance work must not add filesystem reads, GitHub release lookups, or
other per-request version discovery on activation, legacy exchange, or
grant-refresh traffic just to stamp authenticated install metadata.
-30. Keep dashboard summary-chart fetches scope-owned rather than page-churn-owned: `frontend-modern/src/hooks/useDashboardTrends.ts` must hydrate infrastructure and storage summaries once per org/range scope from the canonical summary caches and recompute card presentation locally as the compact dashboard overview changes, rather than refetching the infrastructure-summary transport in `frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts`, the dashboard storage-summary trend transport in `frontend-modern/src/utils/storageSummaryTrendCache.ts`, or the storage-page summary transport in `frontend-modern/src/utils/storageSummaryCache.ts` for every top-resource or card reshuffle on the same dashboard load. That dashboard infrastructure path must also request only the metrics it renders through the canonical infrastructure-summary route owned by `internal/api/router_routes_monitoring.go` and `internal/api/router.go`; the dashboard may not pay for disk or network summary series when it only renders CPU and memory. App-shell prewarm in `frontend-modern/src/useAppRuntimeState.ts` must not front-run that dashboard-specific route while the operator is already on the root dashboard route owned by `frontend-modern/src/App.tsx`.
+30. Keep retired dashboard summary-chart paths absent rather than replacing
+them with new hot-path fetches. Infrastructure summary cards must continue to
+hydrate through `frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts`
+and the canonical infrastructure-summary route owned by
+`internal/api/router_routes_monitoring.go` and `internal/api/router.go`; storage
+summary cards must use the storage summary cache owners. The authenticated
+root path in `frontend-modern/src/App.tsx` must not prewarm a deleted
+dashboard-specific overview, trend, or summary transport.
The same hot path must keep mock/demo chart identity on the canonical
unified snapshot too: when mock mode is enabled, `internal/api/router.go`
may not read `/api/charts`, `/api/charts/infrastructure`, or
@@ -320,7 +320,7 @@ regression protection.
hot-path contract: `frontend-modern/src/useAppRuntimeState.ts` may reload
the org list from the shared `organizations_changed` event, but that refresh
must stay event-driven and route-safe rather than expanding into a second
- full app bootstrap, a pre-auth org probe, or a dashboard-route prewarm
+ full app bootstrap, a pre-auth org probe, or a deleted dashboard-route prewarm
that duplicates the canonical summary fetch path.
into another summary-fetch or org-bootstrap hot path.
The same protected hot path also owns Patrol route compatibility: if
@@ -334,7 +334,7 @@ regression protection.
work before the canonical Settings URL takes over.
Authenticated `/login` recovery belongs to that same app-shell boundary:
`frontend-modern/src/App.tsx` must redirect that route back to the
- canonical dashboard landing path instead of leaving the freshly
+ canonical Infrastructure landing path instead of leaving the freshly
authenticated shell on a not-found page that immediately pays another cold
bootstrap.
The same protected hot path now also owns proof harness steadiness.
@@ -343,27 +343,25 @@ regression protection.
must wait for deferred metrics-store startup maintenance to quiesce before
timing steady-state reads, so one-time retention or auto-vacuum cleanup does
not masquerade as summary-route or chart-batch regression latency.
-31. Keep the dashboard overview hot path compact and route-owned. `frontend-modern/src/pages/Dashboard.tsx`, `frontend-modern/src/api/resources.ts`, and `frontend-modern/src/hooks/useDashboardOverview.ts` must hydrate KPI cards, problem-resource rows, and top-infrastructure identities through the compact dashboard-summary API contract owned by the adjacent `api-contracts` and `unified-resources` surfaces, rather than booting the full unfiltered paginated unified-resource list just to derive summary cards.
- Any commercial or relay-owned dashboard affordances composed into that
- route must remain additive shells on top of the same compact summary
- payload instead of reintroducing route-local `all-resources` fetches,
- summary recomputation, or page-level layout churn that displaces the
- protected overview widgets.
- Estate-summary issue copy on that route must use the already-hydrated
- compact overview problem-resource and alert counts; it must not introduce a
- second resource scan, alert fetch, storage read, or recovery read just to
- clarify first-viewport copy. In-page issue anchors must therefore remain
- pure section focus links against already-rendered dashboard sections rather
- than triggering new data hydration.
- Dashboard Pulse Brief composition belongs to that same hot-path rule: the
- first render may issue the existing non-blocking AI runtime settings
- readiness read and consume existing action-state signals, but it must not
- issue an LLM request, mount a second resource scan, or block estate/KPI
- rendering just to produce prose. Its Assistant handoff may add a scoped
- `autonomous_mode:false` flag only when the operator submits the prefilled
- prompt; that request-level safety override must not become a dashboard
- render dependency or a persistent settings write on the hot path.
-32. Keep infrastructure summary consumers on the compact dashboard overview rather than reopening the all-resources hook. `frontend-modern/src/hooks/useDashboardTrends.ts`, `frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts`, and adjacent dashboard summary consumers may derive chart identity and storage presence from the overview payload they were already given, but they must not call `useResources()` or mount a second unfiltered unified-resource fetch path inside the dashboard hot path. That rule also applies to globally mounted helpers such as `frontend-modern/src/components/AI/Chat/index.tsx`: closed assistant surfaces must read the live websocket snapshot or existing unified-resource cache rather than forcing the dashboard to pay for `all-resources` just because the shell component is mounted. When that assistant shell changes presentation, `frontend-modern/src/utils/aiChatPresentation.ts` must remain the canonical owner for launcher, drawer, session-menu, and empty-state copy so hot-path consumers do not grow one-off inline strings or extra state branches alongside the mounted shell. Blocking shared dialogs must also suppress closed assistant affordances through the shared dialog runtime instead of leaving the mounted shell clickable behind another overlay.
+31. Keep the retired dashboard overview route absent from the protected hot
+path. `frontend-modern/src/pages/Dashboard.tsx`,
+`frontend-modern/src/hooks/useDashboardOverview.ts`, and
+`/api/resources/dashboard-summary` must not be restored as compatibility
+surfaces for KPI cards, problem-resource rows, or top-infrastructure
+identities. New summary cards must live on their owning product route and
+prove their data path there.
+32. Keep infrastructure and assistant consumers off deleted dashboard summary
+state. `frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts`
+and globally mounted helpers such as `frontend-modern/src/components/AI/Chat/index.tsx`
+must read the live websocket snapshot or existing unified-resource cache
+rather than forcing root navigation to pay for a replacement dashboard
+overview transport. When the assistant shell changes presentation,
+`frontend-modern/src/utils/aiChatPresentation.ts` must remain the canonical
+owner for launcher, drawer, session-menu, and empty-state copy so hot-path
+consumers do not grow one-off inline strings or extra state branches alongside
+the mounted shell. Blocking shared dialogs must also suppress closed assistant
+affordances through the shared dialog runtime instead of leaving the mounted
+shell clickable behind another overlay.
Approval presentation inside that mounted assistant shell must stay
state-local to the existing drawer/session state and backend approval
endpoints. Deny/skip failure handling may preserve the pending approval
@@ -383,21 +381,19 @@ regression protection.
must not hydrate `all-resources` or recovery rollups behind a hidden node
summary; selector-owned data hooks must be explicitly visibility-gated so
`/workloads` only pays for workload-owned transports.
-34. Keep dashboard page-header framing additive on the compact hot path.
- `frontend-modern/src/pages/Dashboard.tsx` may render the shared
- `PageHeader` for route-level shell consistency, but that header must stay
- pure presentation on top of the existing compact overview, trends,
- actions, and recovery/storage widget hydration. It must not introduce a
- second dashboard data load, widen suspense ownership, or force dashboard
- summaries back through full-resource fetch paths just to satisfy page
+34. Keep the retired dashboard page-header path absent from the compact hot
+ path. New page headers must stay pure presentation on their owning route
+ and must not introduce a second data load, widen suspense ownership, or
+ force deleted dashboard summaries back through full-resource fetch paths
+ just to satisfy page
chrome.
-35. Keep the dashboard workloads table CSP-safe on the hot path. The renderers
- in `frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx`,
- `frontend-modern/src/components/Dashboard/WorkloadTableHeader.tsx`,
- `frontend-modern/src/components/Dashboard/GuestRow.tsx`,
- `frontend-modern/src/components/Dashboard/EnhancedCPUBar.tsx`,
- `frontend-modern/src/components/Dashboard/StackedMemoryBar.tsx`, and
- `frontend-modern/src/components/Dashboard/StackedDiskBar.tsx` may still
+35. Keep the Workloads table CSP-safe on the hot path. The renderers
+ in `frontend-modern/src/components/Workloads/WorkloadsTable.tsx`,
+ `frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx`,
+ `frontend-modern/src/components/Workloads/GuestRow.tsx`,
+ `frontend-modern/src/components/Workloads/EnhancedCPUBar.tsx`,
+ `frontend-modern/src/components/Workloads/StackedMemoryBar.tsx`, and
+ `frontend-modern/src/components/Workloads/StackedDiskBar.tsx` may still
use shared models plus SVG or HTML attributes for widths, offsets, and
colors, but they must not fall back to inline `style=` attributes on the
public shell just to express virtualization spacers, alert accents, or
@@ -444,7 +440,7 @@ health-state counts (offline, degraded, alerting) instead of raw online/offline
splits. `InfrastructureSummary.tsx` and `infrastructureSummaryModel.ts` add
`degraded` and `alerting` resource counts; `StorageSummary.tsx` and
`useStoragePageSummary.ts` add `poolsDegraded` and `disksFailing` indicators;
-`WorkloadsSummary.tsx` and `useDashboardWorkloadDerivedState.ts` add an
+`WorkloadsSummary.tsx` and `useWorkloadsDerivedState.ts` add an
alerting count derived from `activeAlerts`. These additions must remain
read-only projections from existing websocket state β€” they must not introduce
new polling loops or widen fetch scope on the hot-path boundary.
@@ -474,10 +470,10 @@ snapshot-owned sources; the hot path must fail closed until the monitor has
both observed an initial baseline for every active connection and rebuilt the
canonical store at or after the latest provider watermark.
-The dashboard workload selector path and the dashboard runtime that consumes it
+The Workloads selector path and the Workloads runtime that consumes it
are now part of the protected performance surface rather than proof-only
context. Future hot-path filter/group/sort/windowing changes must route through
-the explicit dashboard performance proof policy in the subsystem registry.
+the explicit Workloads performance proof policy in the subsystem registry.
Route-backed workload `resource` focus on that hot path is contextual state
only, not inferred filter state: opening or closing an inline drawer must not
invent, retain, or clear `agent` or node-scope filters unless those filters
@@ -502,15 +498,15 @@ That same hot path now also owns dashboard freshness discipline. Supported
unified-resource dashboard reads may hydrate from REST for first paint, but
once websocket `state.resources` is available they must consume that canonical
live snapshot directly instead of turning each websocket update into a second
-REST fetch. Dashboard trend loading must also key off stable target identity
+REST fetch. Route-owned trend loading must also key off stable target identity
and selected range only; reconciled resource snapshots that do not change the
-effective target set must not trigger duplicate infrastructure or storage
-chart requests.
+effective target set must not trigger duplicate infrastructure or storage chart
+requests.
That same protected metrics-store boundary now also owns selected-series batch
-queries. Compact dashboard routes that request only CPU/memory or only
-storage `used`/`avail` capacity must keep that metric-type filter all the way
-through `pkg/metrics/store.go` instead of fetching every series for every
-resource and discarding the extra payload in higher layers.
+queries. Compact route consumers that request only CPU/memory or only storage
+`used`/`avail` capacity must keep that metric-type filter all the way through
+`pkg/metrics/store.go` instead of fetching every series for every resource and
+discarding the extra payload in higher layers.
That same protected workload-chart hot path now also owns rendered-metric
budgeting. `internal/api/router.go` may parallelize VM, container, pod, and
docker-container workload batch reads, but `/api/charts/workloads` and
@@ -566,7 +562,7 @@ rows and infrastructure resource rows must expose summary-linked activity
through the shared `data-summary-row-active` marker and let the shared frontend
primitive render the emphasis, instead of layering lane-local row-fill classes
that diverge across pages or wash out inline metric bars.
-`frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts` must
+`frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts` must
write workload selection back into the workloads route through the shared
same-path route-state scheduler, but the actual shell-position handoff for
query-only row focus must go through `frontend-modern/src/utils/appShellScrollRestoration.ts`
@@ -619,23 +615,22 @@ must include API-backed systems such as top-level TrueNAS appliances through
the shared `isAgentFacetInfrastructureResource(...)` helper instead of a local
`resource.type` branch, so the summary poll/cache path stays on one canonical
infrastructure selector contract.
-That same protected dashboard hot path now includes storage trend loading too.
-`frontend-modern/src/hooks/useDashboardTrends.ts` and
-`internal/api/router.go` must keep dashboard storage trends on one compact
-`/api/charts/storage-summary` request backed by
-`GetStorageMetricsForChartBatch(...)`, so the dashboard does not pull the full
-storage-page `/api/storage-charts` payload or reopen an N+1 per-pool
-`/api/metrics-store/history` fan-out just to compute the shared 24-hour
-storage capacity delta.
-That same dashboard shell boundary also owns empty-state action routing in
-`frontend-modern/src/components/Dashboard/DashboardStateCards.tsx`. When the
-dashboard has no connected infrastructure, the CTA must hand operators
+That same protected hot path keeps storage trend loading route-owned after the
+dashboard overview retirement. `internal/api/router.go` must continue serving
+the compact `/api/charts/storage-summary` request backed by
+`GetStorageMetricsForChartBatch(...)` for the surfaces that still own storage
+summary presentation, but no deleted dashboard trend hook may reopen the full
+storage-page `/api/storage-charts` payload or an N+1 per-pool
+`/api/metrics-store/history` fan-out.
+That same Workloads shell boundary also owns empty-state action routing in
+`frontend-modern/src/components/Workloads/WorkloadsStateCards.tsx`. When the
+Workloads route has no connected infrastructure, the CTA must hand operators
directly to the canonical infrastructure install route via
`buildInfrastructureWorkspacePath('install')` instead of bouncing through a
generic settings landing page.
That workload route now also treats readiness as a route-owned contract instead
-of a raw websocket proxy signal: `frontend-modern/src/components/Dashboard/Dashboard.tsx`
-and `frontend-modern/src/components/Dashboard/useDashboardState.ts` must keep
+of a raw websocket proxy signal: `frontend-modern/src/components/Workloads/WorkloadsSurface.tsx`
+and `frontend-modern/src/components/Workloads/useWorkloadsState.ts` must keep
filters, stats, and table visibility driven by the workload route's own
REST-backed health so websocket churn does not hide already-fetched workloads
or swap the protected hot path into a false disconnected shell. The first
@@ -657,47 +652,48 @@ served stale mixed-cadence chart shapes after the backend timeline model has
already been corrected.
stay on one ordered index scan plus Go-side bucket aggregation rather than
forcing SQLite to `GROUP BY` computed buckets through a temp B-tree on the
-fleet-scale dashboard path.
+fleet-scale workload path.
That runtime is now intentionally split by concern:
-`frontend-modern/src/components/Dashboard/useDashboardState.ts` owns
-top-level dashboard orchestration, workload loading, and composition across
-the canonical dashboard owners, while
-`frontend-modern/src/components/Dashboard/useDashboardControlsState.ts`
+`frontend-modern/src/components/Workloads/useWorkloadsState.ts` owns
+top-level Workloads orchestration, workload loading, and composition across
+the canonical Workloads owners, while
+`frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts`
owns persistent control defaults, keyboard-reset semantics, sort/search/tag
behavior, column visibility, and summary display preferences, while
-`frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts`
+`frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts`
owns grouped workload derivation, summary fallbacks, parent-node mapping,
and grouped/windowed table math, while
-`frontend-modern/src/components/Dashboard/useDashboardWorkloadViewportSync.ts`
+`frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts`
owns grouped workload viewport synchronization and the scroll/resize listener
lifecycle, while
-`frontend-modern/src/components/Dashboard/useDashboardGuestMetadataState.ts`
+`frontend-modern/src/components/Workloads/useWorkloadGuestMetadataState.ts`
owns guest metadata cache persistence, optimistic custom-URL updates,
org-scope switching, and metadata refresh, and
-`frontend-modern/src/components/Dashboard/useDashboardWorkloadRouteState.ts`
+`frontend-modern/src/components/Workloads/useWorkloadRouteState.ts`
owns workload-route synchronization, deep-link normalization, and route-scoped
-filter contracts. Future dashboard hot-path changes must extend through those
-owners instead of accreting back into `frontend-modern/src/components/Dashboard/Dashboard.tsx`.
+filter contracts. Future workload hot-path changes must extend through those
+owners within the Workloads surface, and new overview-route work must not
+accrete back into `frontend-modern/src/components/Workloads/WorkloadsSurface.tsx`.
That same route-owned filter contract now also includes canonical workload
-`platform` scoping for API-backed runtimes. Dashboard URL-sync, filter-option
+`platform` scoping for API-backed runtimes. Workloads URL-sync, filter-option
assembly, and workload drill-down routes must preserve
`platform=<owned-source-key>` for surfaces such as TrueNAS app-containers,
while treating host or cluster identity as secondary scope instead of
collapsing those routes back to generic agent-only semantics. The derived
workload hot path must also tolerate transient async route/data gaps by
treating missing filtered-workload collections as empty until the route and
-resource snapshots converge, rather than crashing the dashboard between sync
+resource snapshots converge, rather than crashing Workloads between sync
phases.
That same workload hot path also owns the split between canonical
app-container routing and Docker-only actions. `frontend-modern/src/hooks/useWorkloads.ts`,
-`frontend-modern/src/components/Dashboard/workloadTopology.ts`, and
-`frontend-modern/src/components/Dashboard/useGuestRowState.ts` must preserve a
+`frontend-modern/src/components/Workloads/workloadTopology.ts`, and
+`frontend-modern/src/components/Workloads/useGuestRowState.ts` must preserve a
canonical app-container navigation path while keeping Docker runtime action
-identifiers explicit. Discovery affordances on the dashboard drawer must follow
+identifiers explicit. Discovery affordances on the Workloads drawer must follow
the canonical `discoveryTarget` contract, not generic app-container host
fallbacks. TrueNAS app-containers may reuse runtime metadata such as image and
runtime strings, but they must not inherit Docker-only update affordances or
-agent-only Discovery tabs on the dashboard row path unless the unified
+agent-only Discovery tabs on the Workloads row path unless the unified
resource contract explicitly supplies discovery ownership.
That same row-and-selection boundary also requires canonical app-container
identity to stay intact on the workload surface. `/workloads` rows, deep links,
@@ -729,50 +725,50 @@ When a row is only known through an agent or container runtime, the table must
prefer reported OS/appliance identity before falling back to Docker/runtime
capability labels.
That derived workload owner now also routes grouped row windowing through
-`frontend-modern/src/components/Dashboard/useGroupedTableWindowing.ts`, which
+`frontend-modern/src/components/Workloads/useGroupedTableWindowing.ts`, which
owns row-window thresholds, overscan behavior, reveal-index clamping, and
-per-group visible-slice derivation. Future dashboard table windowing changes
+per-group visible-slice derivation. Future Workloads table windowing changes
must extend through that hook instead of rebuilding scroll math or mounted-row
-budgets inline inside `frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts`.
+budgets inline inside `frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts`.
Viewport-driven grouped table synchronization now also routes through
-`frontend-modern/src/components/Dashboard/useDashboardWorkloadViewportSync.ts`,
-which owns the dashboard table body measurement and the scroll/resize listener
+`frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts`,
+which owns the Workloads table body measurement and the scroll/resize listener
lifecycle. Future viewport sync changes must extend through that hook rather
than rebuilding browser-event wiring or table-body geometry reads inside
-`frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts`.
-The dashboard guest-row path now follows the same pattern: the render shell
-stays in `frontend-modern/src/components/Dashboard/GuestRow.tsx`, tooltip-backed
-cell presentation lives in `frontend-modern/src/components/Dashboard/GuestRowCells.tsx`,
+`frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts`.
+The workload guest-row path now follows the same pattern: the render shell
+stays in `frontend-modern/src/components/Workloads/GuestRow.tsx`, tooltip-backed
+cell presentation lives in `frontend-modern/src/components/Workloads/GuestRowCells.tsx`,
and the canonical row contract and per-row hot-path derivations live in
-`frontend-modern/src/components/Dashboard/guestRowModel.tsx` and
-`frontend-modern/src/components/Dashboard/useGuestRowState.ts`. Future row
+`frontend-modern/src/components/Workloads/guestRowModel.tsx` and
+`frontend-modern/src/components/Workloads/useGuestRowState.ts`. Future row
identity, column, cell-tooltip, anomaly-correlation, and link-state changes
must extend through those owners instead of rebuilding row-local state inside
the shell.
That per-row link state now also consumes the shared
`frontend-modern/src/routing/resourceLinks.ts` workload-to-infrastructure
-helper instead of a dashboard-local routing shim. Future infrastructure-link
-changes for dashboard rows must extend through the shared routing owner rather
+helper instead of a workload-local routing shim. Future infrastructure-link
+changes for workload rows must extend through the shared routing owner rather
than recreating feature-local path builders.
That shell now also routes tag-dot rendering through the shared
`frontend-modern/src/components/shared/TagBadges.tsx` primitive instead of
-keeping a dashboard-local badge helper. Future guest-row tag presentation
+keeping a workload-local badge helper. Future guest-row tag presentation
changes must extend through that shared owner rather than reintroducing a
-dashboard-only tag-badge variant.
-The dashboard guest drawer now follows that same ownership rule: the shell
-stays in `frontend-modern/src/components/Dashboard/GuestDrawer.tsx`, the
+workload-only tag-badge variant.
+The Workloads guest drawer now follows that same ownership rule: the shell
+stays in `frontend-modern/src/components/Workloads/GuestDrawer.tsx`, the
overview card surface lives in
-`frontend-modern/src/components/Dashboard/GuestDrawerOverview.tsx`, and
+`frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx`, and
drawer-local normalization, backup/tag formatting, discovery identity wiring,
and workload-derived navigation state live in
-`frontend-modern/src/components/Dashboard/guestDrawerModel.ts` and
-`frontend-modern/src/components/Dashboard/useGuestDrawerState.ts`. Future
+`frontend-modern/src/components/Workloads/guestDrawerModel.ts` and
+`frontend-modern/src/components/Workloads/useGuestDrawerState.ts`. Future
drawer runtime and overview-surface changes must extend through those owners
instead of adding more mixed state and helper drift back into the shell.
That drawer state now also consumes the same shared
`frontend-modern/src/routing/resourceLinks.ts` workload-to-infrastructure
helper, so row and drawer navigation stay aligned without a second
-dashboard-local link-mapping file.
+workload-local link-mapping file.
The shared infrastructure mapper hot path now stays intentionally narrow:
`frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts`
continues to own sensor-label presentation and hot-path host/agent projection,
@@ -790,86 +786,86 @@ service-model helpers, while
stays a thin render shell. Future running-task visibility changes must extend
through the shared model and accepted performance proof file instead of adding
per-row PBS status parsing or inline job scans in the table render path.
-The dashboard disk list now follows the same pattern: the shell stays in
-`frontend-modern/src/components/Dashboard/DiskList.tsx`, while disk-row
+The Workloads disk list now follows the same pattern: the shell stays in
+`frontend-modern/src/components/Workloads/DiskList.tsx`, while disk-row
presentation derivations and fallback tooltip/runtime wiring live in
-`frontend-modern/src/components/Dashboard/diskListModel.ts` and
-`frontend-modern/src/components/Dashboard/useDiskListState.ts`. Future disk
+`frontend-modern/src/components/Workloads/diskListModel.ts` and
+`frontend-modern/src/components/Workloads/useDiskListState.ts`. Future disk
usage math, threshold-color routing, and fallback handling must extend
through those owners instead of accreting back into the shell.
-The dashboard filter now follows that same ownership rule: the shell
-stays in `frontend-modern/src/components/Dashboard/DashboardFilter.tsx`, while
+The Workloads filter now follows that same ownership rule: the shell
+stays in `frontend-modern/src/components/Workloads/WorkloadsFilter.tsx`, while
toolbar defaults, active-filter counting, and reset semantics live in
-`frontend-modern/src/components/Dashboard/dashboardFilterModel.ts` and
-`frontend-modern/src/components/Dashboard/useDashboardFilterState.ts`.
-Dashboard table-mode controls must also keep their accessible group name aligned
+`frontend-modern/src/components/Workloads/workloadsFilterModel.ts` and
+`frontend-modern/src/components/Workloads/useWorkloadsFilterState.ts`.
+Workloads table-mode controls must also keep their accessible group name aligned
with the shared table presentation contract by using `Group by` for the
grouped/list selector instead of reintroducing local `Group By` casing or
platform-specific cluster wording. Dense workload toolbar variants must keep
that same row wrap-capable so optional runtime, chart, column, and reset
controls remain reachable on desktop instead of forcing a single no-wrap row
that clips trailing actions.
-The dashboard-owned filter-config assembly now lives in
-`frontend-modern/src/components/Dashboard/useDashboardState.ts`, so future
+The Workloads-owned filter-config assembly now lives in
+`frontend-modern/src/components/Workloads/useWorkloadsState.ts`, so future
filter runtime changes must extend through those owners instead of
-reintroducing dashboard-local state, reset drift, or inline config assembly
+reintroducing workload-local state, reset drift, or inline config assembly
into the shell.
Workload type option labels are part of that filter-config model ownership:
-`DashboardFilter.tsx` must render the exported workload type option catalog
+`WorkloadsFilter.tsx` must render the exported workload type option catalog
instead of embedding its own `System containers` / `App containers` wording in
the shell.
The dashboard threshold slider now follows that same pattern: the shell stays
-in `frontend-modern/src/components/Dashboard/ThresholdSlider.tsx`, while
+in `frontend-modern/src/components/Workloads/ThresholdSlider.tsx`, while
metric-type text and fill presentation live in
`frontend-modern/src/utils/thresholdSliderPresentation.ts`, while
slider bounds math, thumb-position transforms, and title/label derivations
-live in `frontend-modern/src/components/Dashboard/thresholdSliderModel.ts`
+live in `frontend-modern/src/components/Workloads/thresholdSliderModel.ts`
and drag scroll-lock lifecycle lives in
-`frontend-modern/src/components/Dashboard/useThresholdSliderState.ts`.
+`frontend-modern/src/components/Workloads/useThresholdSliderState.ts`.
Future slider runtime changes must extend through those owners instead of
reintroducing mixed drag state, type-color formatting, and presentation logic
into the shell.
The dashboard stacked disk bar now follows that same pattern: the shell stays
-in `frontend-modern/src/components/Dashboard/StackedDiskBar.tsx`, while
+in `frontend-modern/src/components/Workloads/StackedDiskBar.tsx`, while
disk-capacity math, segment and tooltip derivation, max-disk labeling, and
mode-specific presentation live in
-`frontend-modern/src/components/Dashboard/stackedDiskBarModel.ts` and
+`frontend-modern/src/components/Workloads/stackedDiskBarModel.ts` and
resize-observer plus tooltip lifecycle live in
-`frontend-modern/src/components/Dashboard/useStackedDiskBarState.ts`.
+`frontend-modern/src/components/Workloads/useStackedDiskBarState.ts`.
Future disk-bar runtime changes must extend through those owners instead of
reintroducing mixed resize state and presentation branching into the shell.
The dashboard stacked memory bar now follows that same pattern: the shell
-stays in `frontend-modern/src/components/Dashboard/StackedMemoryBar.tsx`,
+stays in `frontend-modern/src/components/Workloads/StackedMemoryBar.tsx`,
while memory-capacity math, balloon/swap tooltip derivation, anomaly label
presentation, and sublabel-fit logic live in
-`frontend-modern/src/components/Dashboard/stackedMemoryBarModel.ts` and
+`frontend-modern/src/components/Workloads/stackedMemoryBarModel.ts` and
resize-observer plus tooltip lifecycle live in
-`frontend-modern/src/components/Dashboard/useStackedMemoryBarState.ts`.
+`frontend-modern/src/components/Workloads/useStackedMemoryBarState.ts`.
Future memory-bar runtime changes must extend through those owners instead of
reintroducing mixed resize state, balloon branching, and tooltip shaping into
the shell.
The dashboard metric bar now follows that same pattern: the shell stays in
-`frontend-modern/src/components/Dashboard/MetricBar.tsx`, while width,
+`frontend-modern/src/components/Workloads/MetricBar.tsx`, while width,
show-label, sublabel-fit, and threshold-color derivation live in
-`frontend-modern/src/components/Dashboard/metricBarModel.ts` and
+`frontend-modern/src/components/Workloads/metricBarModel.ts` and
resize-observer lifecycle lives in
-`frontend-modern/src/components/Dashboard/useMetricBarState.ts`. Future
+`frontend-modern/src/components/Workloads/useMetricBarState.ts`. Future
metric-bar runtime changes must extend through those owners instead of
reintroducing mixed resize state and label-fit logic into the shell.
The dashboard enhanced CPU bar now follows that same pattern: the shell stays
-in `frontend-modern/src/components/Dashboard/EnhancedCPUBar.tsx`, while usage
+in `frontend-modern/src/components/Workloads/EnhancedCPUBar.tsx`, while usage
formatting, anomaly presentation, tooltip load-average formatting, and
threshold-driven label state live in
-`frontend-modern/src/components/Dashboard/enhancedCpuBarModel.ts` and
+`frontend-modern/src/components/Workloads/enhancedCpuBarModel.ts` and
tooltip lifecycle lives in
-`frontend-modern/src/components/Dashboard/useEnhancedCPUBarState.ts`. Future
+`frontend-modern/src/components/Workloads/useEnhancedCPUBarState.ts`. Future
CPU-bar runtime changes must extend through those owners instead of
reintroducing mixed tooltip state and formatting logic into the shell.
The unified resource table hot path is now also governed as explicit
performance-owned runtime, with shared ownership against the unified-resource
consumer boundary. The remaining performance work is no longer top-level
-ownership ambiguity on the main dashboard or infrastructure tables.
+ownership ambiguity on the main Infrastructure or Workloads tables.
The table's reactive runtime, grouping, and row-windowing owner now lives in
`frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts`,
while pure table-state derivation, service sorting, sort-cycle policy, and
@@ -975,7 +971,7 @@ The shared workloads-link helper used by the resource drawer and table now
also routes its Kubernetes-cluster fallback through the same preferred
resource display contract, so navigation context does not leak raw
`displayName` values for governed clusters.
-That same workloads-link path and the dashboard workload projection now also
+That same workloads-link path and the workload projection now also
share the canonical cluster-name helpers in the shared agent-resource layer,
so route labels, pod grouping, and cluster-name fetch keys keep using the
same source of truth instead of rebuilding the `clusterName`/`context`/
@@ -1084,7 +1080,7 @@ doing range selection and fallback. Feature-local polling loops or browser-side
disk ring buffers are forbidden because they duplicate live sampling work and
drift out of sync with the governed history timeline.
That same hot-path ownership now also requires lazy-load-safe websocket
-consumption. `frontend-modern/src/components/Dashboard/useDashboardState.ts`
+consumption. `frontend-modern/src/components/Workloads/useWorkloadsState.ts`
may read connection and alert state only through
`frontend-modern/src/contexts/appRuntime.ts`; it must not import `@/App` or
create a reverse dependency into the root shell just to read websocket state.
@@ -1093,15 +1089,15 @@ Shared shells may consume the small `/api/license/runtime-capabilities`
contract for feature truth, but commercial demo routes stay hidden and the
browser must not keep retrying `/api/license/commercial-posture`,
`/api/license/entitlements`, `/auth/license-purchase-start`, or other hidden
-commercial endpoints from performance-sensitive settings or dashboard shells.
-Dashboard and infrastructure summary consumers now also keep null-tolerant read
+commercial endpoints from performance-sensitive settings or route shells.
+Workloads and infrastructure summary consumers now also keep null-tolerant read
models on the shared hot path. Guest rows, stacked bars, anomaly summaries, and
resource detail mappers may accept partial platform metadata or undefined
ratios, but they must normalize those values once in the shared model layer
instead of scattering non-null assertions or per-component count coercion
-through the dashboard runtime.
+through the Workloads runtime.
That same workload-table hot path now also owns a single width contract.
-`frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx`,
+`frontend-modern/src/components/Workloads/WorkloadsTable.tsx`,
`WorkloadTableHeader.tsx`, `GuestRow.tsx`, and `guestRowModel.tsx` must remain
the canonical owners for desktop and mobile workload column sizing. Global CSS
must not reintroduce competing `.workload-table [data-workload-col=…]` width
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index 44dc240df8..79ca212144 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -1320,7 +1320,6 @@
"exact_files": [
"frontend-modern/src/components/Alerts/__tests__/BulkEditDialog.test.tsx",
"frontend-modern/src/components/Alerts/__tests__/InvestigateAlertButton.test.tsx",
- "frontend-modern/src/components/Alerts/__tests__/RecentAlertsPanel.test.tsx",
"frontend-modern/src/components/Alerts/__tests__/ThresholdsTable.test.tsx",
"frontend-modern/src/components/Alerts/EmailProviderSelect.test.tsx",
"frontend-modern/src/components/Alerts/ResourceTable.test.tsx",
@@ -2990,27 +2989,11 @@
"frontend-modern/src/components/SetupWizard/SetupCompletionPreview.tsx",
"frontend-modern/src/components/SetupWizard/SetupWizard.tsx",
"frontend-modern/src/components/Toast/Toast.tsx",
- "frontend-modern/src/features/dashboardOverview/ActionRequiredPanel.tsx",
- "frontend-modern/src/features/dashboardOverview/DashboardCustomizer.tsx",
- "frontend-modern/src/features/dashboardOverview/dashboardPulseBriefModel.ts",
- "frontend-modern/src/features/dashboardOverview/estateSummaryModel.ts",
- "frontend-modern/src/features/dashboardOverview/EstateSummaryPanel.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/PulseBriefPanel.tsx",
- "frontend-modern/src/features/dashboardOverview/TrendCharts.tsx",
- "frontend-modern/src/features/dashboardOverview/useDashboardPulseBrief.ts",
"frontend-modern/src/hooks/createNonSuspendingQuery.ts",
"frontend-modern/src/index.css",
"frontend-modern/src/pages/Operations.tsx",
"frontend-modern/src/stores/aiChat.ts",
"frontend-modern/src/utils/aiSettingsPresentation.ts",
- "frontend-modern/src/utils/dashboardEmptyStatePresentation.ts",
- "frontend-modern/src/utils/dashboardGuestPresentation.ts",
- "frontend-modern/src/utils/dashboardKpiPresentation.ts",
- "frontend-modern/src/utils/dashboardMetricPresentation.ts",
- "frontend-modern/src/utils/dashboardTrendPresentation.ts",
"frontend-modern/src/utils/diagnosticsPresentation.ts",
"frontend-modern/src/utils/discoveryPresentation.ts",
"frontend-modern/src/utils/emptyStatePresentation.ts",
@@ -3032,7 +3015,9 @@
"frontend-modern/src/utils/toast.ts",
"frontend-modern/src/utils/typeColumnPresentation.ts",
"frontend-modern/src/utils/updatesPresentation.ts",
- "frontend-modern/src/utils/upgradeNavigation.ts"
+ "frontend-modern/src/utils/upgradeNavigation.ts",
+ "frontend-modern/src/utils/workloadEmptyStatePresentation.ts",
+ "frontend-modern/src/utils/workloadGuestPresentation.ts"
],
"verification": {
"allow_same_subsystem_tests": false,
@@ -3214,24 +3199,18 @@
]
},
{
- "id": "dashboard-presentation-helpers",
- "label": "dashboard presentation helper proof",
+ "id": "workload-presentation-helpers",
+ "label": "workload presentation helper proof",
"match_prefixes": [],
"match_files": [
- "frontend-modern/src/utils/dashboardEmptyStatePresentation.ts",
- "frontend-modern/src/utils/dashboardGuestPresentation.ts",
- "frontend-modern/src/utils/dashboardKpiPresentation.ts",
- "frontend-modern/src/utils/dashboardMetricPresentation.ts",
- "frontend-modern/src/utils/dashboardTrendPresentation.ts"
+ "frontend-modern/src/utils/workloadEmptyStatePresentation.ts",
+ "frontend-modern/src/utils/workloadGuestPresentation.ts"
],
"allow_same_subsystem_tests": false,
"test_prefixes": [],
"exact_files": [
- "frontend-modern/src/utils/__tests__/dashboardEmptyStatePresentation.test.ts",
- "frontend-modern/src/utils/__tests__/dashboardGuestPresentation.test.ts",
- "frontend-modern/src/utils/__tests__/dashboardKpiPresentation.test.ts",
- "frontend-modern/src/utils/__tests__/dashboardMetricPresentation.test.ts",
- "frontend-modern/src/utils/__tests__/dashboardTrendPresentation.test.ts"
+ "frontend-modern/src/utils/__tests__/workloadEmptyStatePresentation.test.ts",
+ "frontend-modern/src/utils/__tests__/workloadGuestPresentation.test.ts"
]
},
{
@@ -3256,6 +3235,7 @@
"match_files": [
"frontend-modern/src/components/Toast/Toast.tsx",
"frontend-modern/src/utils/emptyStatePresentation.ts",
+ "frontend-modern/src/utils/problemResourcePresentation.ts",
"frontend-modern/src/utils/semanticTonePresentation.ts",
"frontend-modern/src/utils/toast.ts",
"frontend-modern/src/utils/typeColumnPresentation.ts"
@@ -3266,6 +3246,7 @@
"frontend-modern/src/components/shared/TypeColumn.guardrails.test.ts",
"frontend-modern/src/components/Toast/__tests__/Toast.test.tsx",
"frontend-modern/src/utils/__tests__/emptyStatePresentation.test.ts",
+ "frontend-modern/src/utils/__tests__/problemResourcePresentation.test.ts",
"frontend-modern/src/utils/__tests__/semanticTonePresentation.test.ts",
"frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts"
]
@@ -3393,37 +3374,6 @@
"frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx"
]
},
- {
- "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/dashboardPulseBriefModel.ts",
- "frontend-modern/src/features/dashboardOverview/estateSummaryModel.ts",
- "frontend-modern/src/features/dashboardOverview/EstateSummaryPanel.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/PulseBriefPanel.tsx",
- "frontend-modern/src/features/dashboardOverview/TrendCharts.tsx",
- "frontend-modern/src/features/dashboardOverview/useDashboardPulseBrief.ts",
- "frontend-modern/src/utils/problemResourcePresentation.ts"
- ],
- "allow_same_subsystem_tests": false,
- "test_prefixes": [],
- "exact_files": [
- "frontend-modern/src/features/dashboardOverview/__tests__/dashboardPulseBriefModel.test.ts",
- "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__/problemResourcePresentation.test.ts",
- "frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts"
- ]
- },
{
"id": "first-session-runtime-and-preview",
"label": "first-session runtime and preview proof",
@@ -4155,58 +4105,6 @@
"pkg/metrics/"
],
"owned_files": [
- "frontend-modern/src/components/Dashboard/Dashboard.tsx",
- "frontend-modern/src/components/Dashboard/DashboardFilter.tsx",
- "frontend-modern/src/components/Dashboard/dashboardFilterModel.ts",
- "frontend-modern/src/components/Dashboard/dashboardSelectionModel.ts",
- "frontend-modern/src/components/Dashboard/DashboardStateCards.tsx",
- "frontend-modern/src/components/Dashboard/DashboardStatsStrip.tsx",
- "frontend-modern/src/components/Dashboard/dashboardWorkloadFilterConfigModel.ts",
- "frontend-modern/src/components/Dashboard/dashboardWorkloadRouteModel.ts",
- "frontend-modern/src/components/Dashboard/dashboardWorkloadRouteStateModel.ts",
- "frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx",
- "frontend-modern/src/components/Dashboard/dashboardWorkloadUrlSyncModel.ts",
- "frontend-modern/src/components/Dashboard/DiskList.tsx",
- "frontend-modern/src/components/Dashboard/diskListModel.ts",
- "frontend-modern/src/components/Dashboard/EnhancedCPUBar.tsx",
- "frontend-modern/src/components/Dashboard/enhancedCpuBarModel.ts",
- "frontend-modern/src/components/Dashboard/GuestDrawer.tsx",
- "frontend-modern/src/components/Dashboard/guestDrawerModel.ts",
- "frontend-modern/src/components/Dashboard/GuestDrawerOverview.tsx",
- "frontend-modern/src/components/Dashboard/GuestRow.tsx",
- "frontend-modern/src/components/Dashboard/GuestRowCells.tsx",
- "frontend-modern/src/components/Dashboard/guestRowModel.tsx",
- "frontend-modern/src/components/Dashboard/MetricBar.tsx",
- "frontend-modern/src/components/Dashboard/metricBarModel.ts",
- "frontend-modern/src/components/Dashboard/StackedDiskBar.tsx",
- "frontend-modern/src/components/Dashboard/stackedDiskBarModel.ts",
- "frontend-modern/src/components/Dashboard/StackedMemoryBar.tsx",
- "frontend-modern/src/components/Dashboard/stackedMemoryBarModel.ts",
- "frontend-modern/src/components/Dashboard/ThresholdSlider.tsx",
- "frontend-modern/src/components/Dashboard/thresholdSliderModel.ts",
- "frontend-modern/src/components/Dashboard/useDashboardControlsState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardFilterState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardGuestMetadataState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardWorkloadFilterOptions.ts",
- "frontend-modern/src/components/Dashboard/useDashboardWorkloadRouteState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardWorkloadUrlSync.ts",
- "frontend-modern/src/components/Dashboard/useDashboardWorkloadViewportSync.ts",
- "frontend-modern/src/components/Dashboard/useDiskListState.ts",
- "frontend-modern/src/components/Dashboard/useEnhancedCPUBarState.ts",
- "frontend-modern/src/components/Dashboard/useGroupedTableWindowing.ts",
- "frontend-modern/src/components/Dashboard/useGuestDrawerState.ts",
- "frontend-modern/src/components/Dashboard/useGuestRowState.ts",
- "frontend-modern/src/components/Dashboard/useMetricBarState.ts",
- "frontend-modern/src/components/Dashboard/useStackedDiskBarState.ts",
- "frontend-modern/src/components/Dashboard/useStackedMemoryBarState.ts",
- "frontend-modern/src/components/Dashboard/useThresholdSliderState.ts",
- "frontend-modern/src/components/Dashboard/WorkloadPanel.tsx",
- "frontend-modern/src/components/Dashboard/workloadSelectors.ts",
- "frontend-modern/src/components/Dashboard/WorkloadTableHeader.tsx",
- "frontend-modern/src/components/Dashboard/workloadTopology.ts",
"frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts",
"frontend-modern/src/components/Infrastructure/InfrastructureSummary.tsx",
"frontend-modern/src/components/Infrastructure/infrastructureSummaryModel.ts",
@@ -4221,7 +4119,59 @@
"frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts",
"frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts",
"frontend-modern/src/components/Infrastructure/useUnifiedResourceTableViewportSync.ts",
+ "frontend-modern/src/components/Workloads/DiskList.tsx",
+ "frontend-modern/src/components/Workloads/diskListModel.ts",
+ "frontend-modern/src/components/Workloads/EnhancedCPUBar.tsx",
+ "frontend-modern/src/components/Workloads/enhancedCpuBarModel.ts",
+ "frontend-modern/src/components/Workloads/GuestDrawer.tsx",
+ "frontend-modern/src/components/Workloads/guestDrawerModel.ts",
+ "frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx",
+ "frontend-modern/src/components/Workloads/GuestRow.tsx",
+ "frontend-modern/src/components/Workloads/GuestRowCells.tsx",
+ "frontend-modern/src/components/Workloads/guestRowModel.tsx",
+ "frontend-modern/src/components/Workloads/MetricBar.tsx",
+ "frontend-modern/src/components/Workloads/metricBarModel.ts",
+ "frontend-modern/src/components/Workloads/StackedDiskBar.tsx",
+ "frontend-modern/src/components/Workloads/stackedDiskBarModel.ts",
+ "frontend-modern/src/components/Workloads/StackedMemoryBar.tsx",
+ "frontend-modern/src/components/Workloads/stackedMemoryBarModel.ts",
+ "frontend-modern/src/components/Workloads/ThresholdSlider.tsx",
+ "frontend-modern/src/components/Workloads/thresholdSliderModel.ts",
+ "frontend-modern/src/components/Workloads/useDiskListState.ts",
+ "frontend-modern/src/components/Workloads/useEnhancedCPUBarState.ts",
+ "frontend-modern/src/components/Workloads/useGroupedTableWindowing.ts",
+ "frontend-modern/src/components/Workloads/useGuestDrawerState.ts",
+ "frontend-modern/src/components/Workloads/useGuestRowState.ts",
+ "frontend-modern/src/components/Workloads/useMetricBarState.ts",
+ "frontend-modern/src/components/Workloads/useStackedDiskBarState.ts",
+ "frontend-modern/src/components/Workloads/useStackedMemoryBarState.ts",
+ "frontend-modern/src/components/Workloads/useThresholdSliderState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadFilterOptions.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadGuestMetadataState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadRouteState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadsFilterState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadsState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadUrlSync.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts",
+ "frontend-modern/src/components/Workloads/workloadFilterConfigModel.ts",
+ "frontend-modern/src/components/Workloads/WorkloadPanel.tsx",
+ "frontend-modern/src/components/Workloads/workloadRouteModel.ts",
+ "frontend-modern/src/components/Workloads/workloadRouteStateModel.ts",
+ "frontend-modern/src/components/Workloads/workloadSelectionModel.ts",
+ "frontend-modern/src/components/Workloads/workloadSelectors.ts",
+ "frontend-modern/src/components/Workloads/WorkloadsFilter.tsx",
+ "frontend-modern/src/components/Workloads/workloadsFilterModel.ts",
+ "frontend-modern/src/components/Workloads/WorkloadsStateCards.tsx",
+ "frontend-modern/src/components/Workloads/WorkloadsStatsStrip.tsx",
"frontend-modern/src/components/Workloads/WorkloadsSummary.tsx",
+ "frontend-modern/src/components/Workloads/WorkloadsSurface.tsx",
+ "frontend-modern/src/components/Workloads/WorkloadsTable.tsx",
+ "frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx",
+ "frontend-modern/src/components/Workloads/workloadTopology.ts",
+ "frontend-modern/src/components/Workloads/workloadUrlSyncModel.ts",
"frontend-modern/src/pages/Workloads.tsx",
"frontend-modern/src/utils/thresholdSliderPresentation.ts",
"frontend-modern/src/utils/throughputPresentation.ts",
@@ -4233,28 +4183,28 @@
"allow_same_subsystem_tests": false,
"test_prefixes": [],
"exact_files": [
- "frontend-modern/src/components/Dashboard/__tests__/Dashboard.performance.contract.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/DashboardFilter.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/dashboardSelectionModel.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadFilterConfigModel.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteModel.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteStateModel.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadUrlSyncModel.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/DiskList.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/EnhancedCPUBar.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/StackedDiskBar.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useDashboardFilterState.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/useDashboardWorkloadViewportSync.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useEnhancedCPUBarState.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useGroupedTableWindowing.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/useMetricBarState.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useStackedDiskBarState.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useStackedMemoryBarState.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useThresholdSliderState.test.ts",
- "frontend-modern/src/components/Dashboard/MetricBar.test.tsx",
- "frontend-modern/src/components/Dashboard/StackedMemoryBar.test.tsx",
- "frontend-modern/src/components/Dashboard/ThresholdSlider.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/DiskList.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/EnhancedCPUBar.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/useEnhancedCPUBarState.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/useGroupedTableWindowing.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/useMetricBarState.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/useStackedDiskBarState.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/useStackedMemoryBarState.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/useThresholdSliderState.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/useWorkloadSelectionState.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/useWorkloadsFilterState.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/useWorkloadViewportSync.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/workloadFilterConfigModel.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/workloadRouteModel.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/workloadRouteStateModel.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/workloadSelectionModel.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/workloadUrlSyncModel.test.ts",
+ "frontend-modern/src/components/Workloads/MetricBar.test.tsx",
+ "frontend-modern/src/components/Workloads/StackedMemoryBar.test.tsx",
+ "frontend-modern/src/components/Workloads/ThresholdSlider.test.tsx",
"internal/api/router_bench_test.go",
"internal/api/slo_bench_test.go",
"pkg/metrics/store_bench_test.go",
@@ -4280,62 +4230,10 @@
]
},
{
- "id": "dashboard-workload-hot-path",
- "label": "dashboard workload selector proof",
- "match_prefixes": [],
- "match_files": [
- "frontend-modern/src/components/Dashboard/Dashboard.tsx",
- "frontend-modern/src/components/Dashboard/DashboardFilter.tsx",
- "frontend-modern/src/components/Dashboard/dashboardFilterModel.ts",
- "frontend-modern/src/components/Dashboard/dashboardSelectionModel.ts",
- "frontend-modern/src/components/Dashboard/DashboardStateCards.tsx",
- "frontend-modern/src/components/Dashboard/DashboardStatsStrip.tsx",
- "frontend-modern/src/components/Dashboard/dashboardWorkloadFilterConfigModel.ts",
- "frontend-modern/src/components/Dashboard/dashboardWorkloadRouteModel.ts",
- "frontend-modern/src/components/Dashboard/dashboardWorkloadRouteStateModel.ts",
- "frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx",
- "frontend-modern/src/components/Dashboard/dashboardWorkloadUrlSyncModel.ts",
- "frontend-modern/src/components/Dashboard/DiskList.tsx",
- "frontend-modern/src/components/Dashboard/diskListModel.ts",
- "frontend-modern/src/components/Dashboard/EnhancedCPUBar.tsx",
- "frontend-modern/src/components/Dashboard/enhancedCpuBarModel.ts",
- "frontend-modern/src/components/Dashboard/GuestDrawer.tsx",
- "frontend-modern/src/components/Dashboard/guestDrawerModel.ts",
- "frontend-modern/src/components/Dashboard/GuestDrawerOverview.tsx",
- "frontend-modern/src/components/Dashboard/GuestRow.tsx",
- "frontend-modern/src/components/Dashboard/GuestRowCells.tsx",
- "frontend-modern/src/components/Dashboard/guestRowModel.tsx",
- "frontend-modern/src/components/Dashboard/MetricBar.tsx",
- "frontend-modern/src/components/Dashboard/metricBarModel.ts",
- "frontend-modern/src/components/Dashboard/StackedDiskBar.tsx",
- "frontend-modern/src/components/Dashboard/stackedDiskBarModel.ts",
- "frontend-modern/src/components/Dashboard/StackedMemoryBar.tsx",
- "frontend-modern/src/components/Dashboard/stackedMemoryBarModel.ts",
- "frontend-modern/src/components/Dashboard/ThresholdSlider.tsx",
- "frontend-modern/src/components/Dashboard/thresholdSliderModel.ts",
- "frontend-modern/src/components/Dashboard/useDashboardControlsState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardFilterState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardGuestMetadataState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardWorkloadFilterOptions.ts",
- "frontend-modern/src/components/Dashboard/useDashboardWorkloadRouteState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardWorkloadUrlSync.ts",
- "frontend-modern/src/components/Dashboard/useDashboardWorkloadViewportSync.ts",
- "frontend-modern/src/components/Dashboard/useDiskListState.ts",
- "frontend-modern/src/components/Dashboard/useEnhancedCPUBarState.ts",
- "frontend-modern/src/components/Dashboard/useGroupedTableWindowing.ts",
- "frontend-modern/src/components/Dashboard/useGuestDrawerState.ts",
- "frontend-modern/src/components/Dashboard/useGuestRowState.ts",
- "frontend-modern/src/components/Dashboard/useMetricBarState.ts",
- "frontend-modern/src/components/Dashboard/useStackedDiskBarState.ts",
- "frontend-modern/src/components/Dashboard/useStackedMemoryBarState.ts",
- "frontend-modern/src/components/Dashboard/useThresholdSliderState.ts",
- "frontend-modern/src/components/Dashboard/WorkloadPanel.tsx",
- "frontend-modern/src/components/Dashboard/workloadSelectors.ts",
- "frontend-modern/src/components/Dashboard/WorkloadTableHeader.tsx",
- "frontend-modern/src/components/Dashboard/workloadTopology.ts",
+ "id": "workloads-hot-path",
+ "label": "Workloads hot-path proof",
+ "match_prefixes": [],
+ "match_files": [
"frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts",
"frontend-modern/src/components/Infrastructure/InfrastructureSummary.tsx",
"frontend-modern/src/components/Infrastructure/infrastructureSummaryModel.ts",
@@ -4350,42 +4248,94 @@
"frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts",
"frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts",
"frontend-modern/src/components/Infrastructure/useUnifiedResourceTableViewportSync.ts",
+ "frontend-modern/src/components/Workloads/DiskList.tsx",
+ "frontend-modern/src/components/Workloads/diskListModel.ts",
+ "frontend-modern/src/components/Workloads/EnhancedCPUBar.tsx",
+ "frontend-modern/src/components/Workloads/enhancedCpuBarModel.ts",
+ "frontend-modern/src/components/Workloads/GuestDrawer.tsx",
+ "frontend-modern/src/components/Workloads/guestDrawerModel.ts",
+ "frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx",
+ "frontend-modern/src/components/Workloads/GuestRow.tsx",
+ "frontend-modern/src/components/Workloads/GuestRowCells.tsx",
+ "frontend-modern/src/components/Workloads/guestRowModel.tsx",
+ "frontend-modern/src/components/Workloads/MetricBar.tsx",
+ "frontend-modern/src/components/Workloads/metricBarModel.ts",
+ "frontend-modern/src/components/Workloads/StackedDiskBar.tsx",
+ "frontend-modern/src/components/Workloads/stackedDiskBarModel.ts",
+ "frontend-modern/src/components/Workloads/StackedMemoryBar.tsx",
+ "frontend-modern/src/components/Workloads/stackedMemoryBarModel.ts",
+ "frontend-modern/src/components/Workloads/ThresholdSlider.tsx",
+ "frontend-modern/src/components/Workloads/thresholdSliderModel.ts",
+ "frontend-modern/src/components/Workloads/useDiskListState.ts",
+ "frontend-modern/src/components/Workloads/useEnhancedCPUBarState.ts",
+ "frontend-modern/src/components/Workloads/useGroupedTableWindowing.ts",
+ "frontend-modern/src/components/Workloads/useGuestDrawerState.ts",
+ "frontend-modern/src/components/Workloads/useGuestRowState.ts",
+ "frontend-modern/src/components/Workloads/useMetricBarState.ts",
+ "frontend-modern/src/components/Workloads/useStackedDiskBarState.ts",
+ "frontend-modern/src/components/Workloads/useStackedMemoryBarState.ts",
+ "frontend-modern/src/components/Workloads/useThresholdSliderState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadFilterOptions.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadGuestMetadataState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadRouteState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadsFilterState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadsState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadUrlSync.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts",
+ "frontend-modern/src/components/Workloads/workloadFilterConfigModel.ts",
+ "frontend-modern/src/components/Workloads/WorkloadPanel.tsx",
+ "frontend-modern/src/components/Workloads/workloadRouteModel.ts",
+ "frontend-modern/src/components/Workloads/workloadRouteStateModel.ts",
+ "frontend-modern/src/components/Workloads/workloadSelectionModel.ts",
+ "frontend-modern/src/components/Workloads/workloadSelectors.ts",
+ "frontend-modern/src/components/Workloads/WorkloadsFilter.tsx",
+ "frontend-modern/src/components/Workloads/workloadsFilterModel.ts",
+ "frontend-modern/src/components/Workloads/WorkloadsStateCards.tsx",
+ "frontend-modern/src/components/Workloads/WorkloadsStatsStrip.tsx",
"frontend-modern/src/components/Workloads/WorkloadsSummary.tsx",
+ "frontend-modern/src/components/Workloads/WorkloadsSurface.tsx",
+ "frontend-modern/src/components/Workloads/WorkloadsTable.tsx",
+ "frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx",
+ "frontend-modern/src/components/Workloads/workloadTopology.ts",
+ "frontend-modern/src/components/Workloads/workloadUrlSyncModel.ts",
"frontend-modern/src/pages/Workloads.tsx",
"frontend-modern/src/utils/thresholdSliderPresentation.ts"
],
"allow_same_subsystem_tests": false,
"test_prefixes": [],
"exact_files": [
- "frontend-modern/src/components/Dashboard/__tests__/Dashboard.performance.contract.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/DashboardFilter.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/dashboardSelectionModel.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadFilterConfigModel.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteModel.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteStateModel.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadUrlSyncModel.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/DiskList.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/EnhancedCPUBar.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/GuestRow.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/StackedDiskBar.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useDashboardFilterState.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/useDashboardWorkloadViewportSync.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useEnhancedCPUBarState.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useGroupedTableWindowing.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/useMetricBarState.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useStackedDiskBarState.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useStackedMemoryBarState.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useThresholdSliderState.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/workloadSelectors.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/workloadTopology.test.ts",
- "frontend-modern/src/components/Dashboard/GuestDrawer.test.tsx",
- "frontend-modern/src/components/Dashboard/MetricBar.test.tsx",
- "frontend-modern/src/components/Dashboard/StackedMemoryBar.test.tsx",
- "frontend-modern/src/components/Dashboard/ThresholdSlider.test.tsx",
"frontend-modern/src/components/Infrastructure/__tests__/infrastructureSummaryModel.test.ts",
"frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx",
"frontend-modern/src/components/Infrastructure/__tests__/unifiedResourceTableStateModel.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/DiskList.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/EnhancedCPUBar.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/useEnhancedCPUBarState.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/useGroupedTableWindowing.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/useMetricBarState.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/useStackedDiskBarState.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/useStackedMemoryBarState.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/useThresholdSliderState.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/useWorkloadSelectionState.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/useWorkloadsFilterState.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/useWorkloadViewportSync.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/workloadFilterConfigModel.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/workloadRouteModel.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/workloadRouteStateModel.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/workloadSelectionModel.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/workloadSelectors.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/workloadTopology.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/workloadUrlSyncModel.test.ts",
+ "frontend-modern/src/components/Workloads/GuestDrawer.test.tsx",
+ "frontend-modern/src/components/Workloads/MetricBar.test.tsx",
+ "frontend-modern/src/components/Workloads/StackedMemoryBar.test.tsx",
+ "frontend-modern/src/components/Workloads/ThresholdSlider.test.tsx",
"frontend-modern/src/components/Workloads/WorkloadsSummary.test.tsx",
"frontend-modern/src/pages/__tests__/Workloads.helpers.test.ts",
"frontend-modern/src/utils/__tests__/thresholdSliderPresentation.test.ts"
@@ -4731,21 +4681,14 @@
"internal/recovery/"
],
"owned_files": [
- "frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx",
- "frontend-modern/src/components/Storage/DashboardStoragePanel.tsx",
- "frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts",
"frontend-modern/src/features/recovery/useRecoverySurfaceState.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/Recovery.tsx",
"frontend-modern/src/pages/Storage.tsx",
"frontend-modern/src/types/recovery.ts",
- "frontend-modern/src/utils/dashboardRecoveryPresentation.ts",
- "frontend-modern/src/utils/dashboardStoragePresentation.ts",
"frontend-modern/src/utils/recoveryActionPresentation.ts",
"frontend-modern/src/utils/recoveryArtifactModePresentation.ts",
"frontend-modern/src/utils/recoveryDatePresentation.ts",
@@ -4769,7 +4712,6 @@
"frontend-modern/src/components/Recovery/RecoverySummary.test.tsx",
"frontend-modern/src/components/Storage/code_standards.test.ts",
"frontend-modern/src/pages/__tests__/Recovery.test.tsx",
- "frontend-modern/src/utils/__tests__/dashboardRecoveryPresentation.test.ts",
"internal/recovery/recovery_test.go"
],
"require_explicit_path_policy_coverage": true,
@@ -4793,20 +4735,6 @@
"internal/recovery/store/store_test.go"
]
},
- {
- "id": "dashboard-storage-recovery-surface",
- "label": "dashboard storage and recovery surface proof",
- "match_prefixes": [],
- "match_files": [
- "frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts",
- "frontend-modern/src/pages/Dashboard.tsx"
- ],
- "allow_same_subsystem_tests": false,
- "test_prefixes": [],
- "exact_files": [
- "frontend-modern/src/pages/__tests__/DashboardPage.test.tsx"
- ]
- },
{
"id": "recovery-product-surface",
"label": "recovery product surface proof",
@@ -4814,16 +4742,13 @@
"frontend-modern/src/components/Recovery/"
],
"match_files": [
- "frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx",
"frontend-modern/src/features/recovery/useRecoverySurfaceState.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/Recovery.tsx",
"frontend-modern/src/types/recovery.ts",
- "frontend-modern/src/utils/dashboardRecoveryPresentation.ts",
"frontend-modern/src/utils/recoveryActionPresentation.ts",
"frontend-modern/src/utils/recoveryArtifactModePresentation.ts",
"frontend-modern/src/utils/recoveryDatePresentation.ts",
@@ -4845,7 +4770,6 @@
"frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx",
"frontend-modern/src/components/Recovery/RecoverySummary.test.tsx",
"frontend-modern/src/pages/__tests__/Recovery.test.tsx",
- "frontend-modern/src/utils/__tests__/dashboardRecoveryPresentation.test.ts",
"frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts",
"tests/integration/tests/17-recovery-layout.spec.ts"
]
@@ -4858,14 +4782,11 @@
"frontend-modern/src/features/storageBackups/"
],
"match_files": [
- "frontend-modern/src/components/Storage/DashboardStoragePanel.tsx",
- "frontend-modern/src/pages/Storage.tsx",
- "frontend-modern/src/utils/dashboardStoragePresentation.ts"
+ "frontend-modern/src/pages/Storage.tsx"
],
"allow_same_subsystem_tests": false,
"test_prefixes": [],
"exact_files": [
- "frontend-modern/src/components/Storage/__tests__/DashboardStoragePanel.test.tsx",
"frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx",
"frontend-modern/src/components/Storage/__tests__/Storage.test.tsx",
"frontend-modern/src/components/Storage/__tests__/StorageControls.test.tsx",
@@ -4881,7 +4802,6 @@
"frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.ts",
"frontend-modern/src/features/storageBackups/__tests__/storagePoolsTablePresentation.test.ts",
"frontend-modern/src/pages/__tests__/Storage.helpers.test.ts",
- "frontend-modern/src/utils/__tests__/dashboardStoragePresentation.test.ts",
"frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts"
]
}
@@ -4935,7 +4855,6 @@
"frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx",
"frontend-modern/src/features/infrastructure/useInfrastructurePageRouteState.ts",
"frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts",
- "frontend-modern/src/hooks/useDashboardTrends.ts",
"frontend-modern/src/hooks/useUnifiedResources.ts",
"frontend-modern/src/pages/Infrastructure.tsx",
"frontend-modern/src/routing/resourceLinks.ts",
@@ -5054,7 +4973,6 @@
"frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx",
"frontend-modern/src/features/infrastructure/useInfrastructurePageRouteState.ts",
"frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts",
- "frontend-modern/src/hooks/useDashboardTrends.ts",
"frontend-modern/src/hooks/useUnifiedResources.ts",
"frontend-modern/src/pages/Infrastructure.tsx",
"frontend-modern/src/routing/resourceLinks.ts",
@@ -5080,7 +4998,6 @@
"frontend-modern/src/components/Infrastructure/__tests__/unifiedResourceTableStateModel.test.ts",
"frontend-modern/src/features/infrastructure/__tests__/infrastructurePageModel.test.ts",
"frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.ts",
- "frontend-modern/src/hooks/__tests__/useDashboardTrends.test.ts",
"frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts",
"frontend-modern/src/pages/__tests__/Infrastructure.empty-state.test.tsx",
"frontend-modern/src/pages/__tests__/Infrastructure.pbs-pmg.test.tsx",
diff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.md
index 5fdeba29f2..0e0a89f095 100644
--- a/docs/release-control/v6/internal/subsystems/security-privacy.md
+++ b/docs/release-control/v6/internal/subsystems/security-privacy.md
@@ -155,6 +155,11 @@ Security-facing settings remain intentionally shared with `frontend-primitives`
because shell framing and presentation consistency still belong there, but the
meaning of those surfaces now lives here so auth posture, token controls, and
privacy toggles stop borrowing their governance only from adjacent lanes.
+That settings presentation boundary also owns trust-sensitive vocabulary around
+operator access. `frontend-modern/src/components/Settings/GeneralSettingsPanel.tsx`
+and `frontend-modern/src/components/Settings/apiTokenManagerModel.ts` must use
+monitoring/workspace wording for tours and read-only token presets instead of
+reviving Dashboard-specific labels after the Dashboard route has been retired.
The Data Handling settings surface extends that trust boundary to resource
policy posture. It may expose the canonical sensitivity, handling-boundary,
and redaction counts that Pulse already applies to resources, but it must stay
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 3cca199385..ebbd7e07fd 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -47,11 +47,7 @@ querying, and the operator-facing storage health presentation layer.
20. `frontend-modern/src/hooks/useRecoveryPointsSeries.ts`
21. `frontend-modern/src/pages/Recovery.tsx`
22. `frontend-modern/src/routing/resourceLinks.ts`
-23. `frontend-modern/src/pages/Dashboard.tsx`
-24. `frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts`
-25. `frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx`
-26. `frontend-modern/src/components/Storage/DashboardStoragePanel.tsx`
-27. `frontend-modern/src/types/recovery.ts`
+23. `frontend-modern/src/types/recovery.ts`
28. `frontend-modern/src/utils/recoverySummaryPresentation.ts`
29. `frontend-modern/src/utils/recoveryTablePresentation.ts`
30. `frontend-modern/src/utils/recoveryItemTypePresentation.ts`
@@ -84,17 +80,11 @@ querying, and the operator-facing storage health presentation layer.
protected-inventory-only state so hidden filters cannot make valid history
look empty.
3. Add or change storage page UX through `frontend-modern/src/pages/Storage.tsx`, `frontend-modern/src/components/Storage/`, `frontend-modern/src/features/storageBackups/`, and the shared storage-source contract in `frontend-modern/src/utils/storageSources.ts`
- Dashboard route composition may place storage and recovery widgets beside
- the estate summary, but estate-summary copy must not present storage or
- recovery health as resolved. Storage and recovery readiness claims remain
- owned by `DashboardStoragePanel` and `DashboardRecoveryStatusPanel`; estate
- summary anchors may focus the dashboard alerts or problem-resource sections
- but must not redirect into storage or recovery ownership. Optional dashboard
- Pulse Brief copy may summarize storage and recovery facts that are already on
- the route, but it must not become the owner of storage capacity, storage
- health, protected-item, or recovery-outcome readiness claims. The Assistant
- handoff safety mode for that brief remains an AI runtime/API contract concern
- and must not move storage or recovery readiness truth into model prose.
+ The retired dashboard route must not reintroduce storage or recovery
+ widgets as compatibility panels. Storage capacity, storage health,
+ protected-item, and recovery-outcome readiness claims belong on the Storage
+ and Recovery surfaces or their shared summary components, not in a restored
+ dashboard panel cluster or Assistant brief.
4. Route transport changes for storage and recovery endpoints through `internal/api/` and the owning `api-contracts` proof routes
That same adjacent API/security boundary owns CSRF replacement-token
concurrency for browser mutations. Storage and recovery forms may benefit
@@ -348,24 +338,13 @@ querying, and the operator-facing storage health presentation layer.
In mock mode, that same compact route must stay aggregate-only and
sampler-prewarmed; storage and recovery must not trigger per-pool chart
reconstruction on the first dashboard request after each mock refresh.
-34. Keep storage and recovery websocket reads on the neutral app-runtime boundary. `frontend-modern/src/components/Recovery/RecoveryPointDetails.tsx`, `frontend-modern/src/components/Storage/useStoragePageResources.ts`, and storage/recovery-adjacent dashboard composition may consume live websocket state only through `frontend-modern/src/contexts/appRuntime.ts`, not by importing `frontend-modern/src/App.tsx` or rebuilding shell-local providers.
- That same dashboard composition boundary also owns compact summary reads.
- When `frontend-modern/src/pages/Dashboard.tsx` renders storage and
- recovery-adjacent cards from `/api/resources/dashboard-summary` and
- `/api/charts/storage-summary`, those cards may reuse the compact payloads
- they were already given, but they must not reopen paginated
- `useUnifiedResources()` transport or reintroduce per-pool
- `/api/metrics-store/history` fan-out under the dashboard hot path.
- Any route-owned dashboard additions composed above those cards must remain
- adjacent composition only: they must not replace the recovery/storage
- dashboard panels, suppress the governed no-resources handoff, or move
- storage/recovery summary ownership out of the compact dashboard route.
- Dashboard estate-orientation additions follow that same rule: they may
- compose above the storage/recovery cards to prove Pulse sees the connected
- estate, but they must consume `appRuntime` connected-infrastructure state
- and the existing compact dashboard summary fallback rather than adding new
- storage/recovery fetches or reclassifying storage/recovery widgets as
- dashboard-owned summary panels.
+34. Keep storage and recovery websocket reads on the neutral app-runtime boundary. `frontend-modern/src/components/Recovery/RecoveryPointDetails.tsx`, `frontend-modern/src/components/Storage/useStoragePageResources.ts`, and adjacent summary/detail composition may consume live websocket state only through `frontend-modern/src/contexts/appRuntime.ts`, not by importing `frontend-modern/src/App.tsx` or rebuilding shell-local providers.
+ That same dashboard composition boundary is now a retired negative space.
+ Storage and recovery-adjacent summaries may reuse
+ `/api/charts/storage-summary` through their owning summary components, but
+ they must not restore `/api/resources/dashboard-summary`, paginated
+ `useUnifiedResources()` transport, or per-pool `/api/metrics-store/history`
+ fan-out under a dashboard hot path.
35. Keep shared `frontend-modern/src/App.tsx` public-route ownership explicit by
surface. Storage/recovery preview entrypoints such as
`/preview/setup-complete` may remain public app-shell routes, but unrelated
@@ -387,7 +366,7 @@ querying, and the operator-facing storage health presentation layer.
plane boundary.
Authenticated `/login` must follow that same shared app-shell contract:
once login succeeds, `frontend-modern/src/App.tsx` must hand the browser
- back to the governed dashboard landing route instead of leaving
+ back to the governed Infrastructure landing route instead of leaving
storage/recovery-adjacent authenticated shells on a page-local not-found
route.
Authenticated-shell demo organization suppression on `frontend-modern/src/App.tsx`
@@ -453,18 +432,17 @@ querying, and the operator-facing storage health presentation layer.
runtime as populated mock inventory, but they must not expose
`demo_fixtures`, billing identity, or alternate entitlement semantics as
recovery-local transport or operator-facing storage metadata.
-37. Keep dashboard storage summary fetches scope-owned on the shared summary
- caches. `frontend-modern/src/components/Storage/StorageSummary.tsx`,
+37. Keep storage summary fetches scope-owned on the shared summary caches.
+ `frontend-modern/src/components/Storage/StorageSummary.tsx`,
`frontend-modern/src/utils/storageSummaryCache.ts`,
- `frontend-modern/src/utils/storageSummaryTrendCache.ts`, and
- `frontend-modern/src/pages/Dashboard.tsx` may reuse cached org/range
- storage summaries for first paint, but they must not refetch the full
- `/api/storage-charts` payload once per additional dashboard resource page
- or invent a dashboard-only storage summary transport path outside the
+ and `frontend-modern/src/utils/storageSummaryTrendCache.ts` may reuse
+ cached org/range storage summaries for first paint, but they must not
+ refetch the full `/api/storage-charts` payload once per adjacent summary
+ card or invent a dashboard-only storage summary transport path outside the
canonical cache owners.
38. Keep storage and recovery route framing additive and owner-neutral.
`frontend-modern/src/components/Storage/Storage.tsx` and storage/recovery-
- adjacent dashboard composition may use the shared `PageHeader` shell for
+ adjacent route composition may use the shared `PageHeader` shell for
top-level route framing, but that header must stay additive on top of the
canonical storage page model, recovery presenters, and shared summary
caches. Header chrome must not become a second owner for storage filters,
@@ -528,19 +506,14 @@ querying, and the operator-facing storage health presentation layer.
widening it into a broad short-name collapse across distinct FQDNs.
5. Keep recovery history table width budgeting derived from the canonical column specs in `frontend-modern/src/utils/recoveryTablePresentation.ts`, not from raw visible-column counts, so normalized subject labels and optional column sets cannot drift the right-edge badges and controls off-screen
6. Keep at least one browser-level desktop recovery proof in the governed `recovery-product-surface` policy so right-edge column visibility and wrapper-fit regressions are caught at rendered layout time instead of only through unit-level width math
-7. Keep the dashboard route's no-resources state on an explicit first-session
- handoff. `frontend-modern/src/pages/Dashboard.tsx` may stay storage/recovery-
- owned for dashboard composition, but when no resources have reported yet it
- must route operators to `/settings/infrastructure/install` instead of
- leaving the dashboard as a passive dead end.
-8. Keep dashboard storage/recovery composition on the shared all-resources
- snapshot. `frontend-modern/src/pages/Dashboard.tsx` may stay
- storage/recovery-owned for dashboard widget composition, but it must reuse
- the canonical `all-resources` cache key from
- `frontend-modern/src/hooks/useUnifiedResources.ts` so storage/recovery
- widgets do not fork a dashboard-only resource snapshot and force adjacent
- infrastructure handoffs back through transient loading shells once the
- broader dashboard data is already warm.
+7. Keep the retired dashboard route from becoming a passive no-resources
+ compatibility shell. First-session handoff now belongs to Infrastructure
+ and Add infrastructure, and storage/recovery must not restore dashboard
+ composition just to route operators to setup.
+8. Keep storage/recovery summaries on their owning snapshots after dashboard
+ retirement. They may reuse the canonical `all-resources` cache key from
+ `frontend-modern/src/hooks/useUnifiedResources.ts` only through their owned
+ page or shared drawer surfaces, not as a dashboard-only resource snapshot.
9. Keep shared OIDC/SAML callback redirects on the canonical local-target
helper contract when storage- or recovery-adjacent routes inherit shared
auth browser handoff through `internal/api/`, so adjacent surfaces do not
@@ -1520,42 +1493,13 @@ boundary: raw compatibility fields such as `provider` / `providers` may be
accepted from older `/api/recovery/*` payloads, but the runtime values they
return to the rest of the recovery UI must be canonical `platform` /
`platforms` models.
-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/features/dashboardOverview/dashboardWidgets.ts`,
-`frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.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/features/dashboardOverview/dashboardWidgets.ts`, and
-`frontend-modern/src/components/Storage/DashboardStoragePanel.tsx` and
-`frontend-modern/src/utils/dashboardStoragePresentation.ts` must stay on
-explicit direct dashboard/storage proof routing instead of borrowing release-
-control coverage only from the broader storage page, component, and model
-surfaces.
-That same dashboard storage surface must also render its capacity meter through
-the shared `frontend-modern/src/components/shared/ProgressBar.tsx` primitive
-and attribute-driven fill geometry instead of owner-local inline width styles,
-so the live dashboard remains CSP-safe while still reporting the canonical
-storage summary.
-That route shell now also composes the recent-alerts widget directly from the
-alert-owned `frontend-modern/src/components/Alerts/RecentAlertsPanel.tsx`
-surface instead of via a dashboard-panels-local alert implementation, so the
-dashboard route stays storage/recovery-owned while alert widget runtime remains
-owned by the alerts subsystem. That route handoff must stay thin: the dashboard
-page should pass the live alert list into `RecentAlertsPanel` and let the
-alert-owned surface derive its own summary and acknowledgement state instead of
-rebuilding alert summary counts or alert-action runtime inside the
-storage/recovery-governed dashboard route.
-That same route shell also owns the top-of-dashboard scan order. When
-`frontend-modern/src/pages/Dashboard.tsx` renders both the KPI strip and the
-problem-resources table, the route must keep the operator snapshot above the
-detail table so the page reads as action queue, summary, then problem detail
-rather than dropping operators straight into a long exception list before the
-dashboard baseline is visible.
+The retired dashboard recovery and storage entry points must stay removed:
+`useDashboardRecovery`, `DashboardRecoveryStatusPanel`,
+`DashboardStoragePanel`, dashboard storage/recovery presentation helpers, and
+dashboard widget orchestration must not return as direct proof surfaces. New
+storage or recovery summary proof must attach to the owning Storage,
+Recovery, Infrastructure drawer, or shared summary component instead of
+borrowing coverage through a broader dashboard shell.
The shared recovery type contract must be pinned the same way:
`frontend-modern/src/types/recovery.ts` must stay on the explicit
`recovery-product-surface` proof path instead of riding indirectly on route or
@@ -2624,13 +2568,12 @@ collector, agent-id/device fallback stream, or separate "real-time" history
store once monitoring and `/api/metrics-store/history` already own the disk
timeline.
The same shell/runtime split now applies to websocket consumers:
-`frontend-modern/src/components/Recovery/RecoveryPointDetails.tsx`,
-`frontend-modern/src/components/Storage/useStoragePageResources.ts`, and
-`frontend-modern/src/pages/Dashboard.tsx` may consume websocket state only
-through `frontend-modern/src/contexts/appRuntime.ts`. They must not import
-`@/App` or create storage/recovery-local shell coupling, because provider
-placement remains app-shell-owned and storage/recovery surfaces must stay
-lazy-load safe.
+`frontend-modern/src/components/Recovery/RecoveryPointDetails.tsx` and
+`frontend-modern/src/components/Storage/useStoragePageResources.ts` may consume
+websocket state only through `frontend-modern/src/contexts/appRuntime.ts`.
+They must not import `@/App` or create storage/recovery-local shell coupling,
+because provider placement remains app-shell-owned and storage/recovery
+surfaces must stay lazy-load safe.
That same adjacent `internal/api/` boundary now also governs public-demo
commercial redaction for storage and recovery viewers. Shared storage/recovery
surfaces may run beside a demo runtime that has real internal entitlements,
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 52a8eb7ff8..3cd708adcd 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -100,8 +100,7 @@ cross-source deduplication.
74. `frontend-modern/src/components/PMG/ServiceHealthBadge.tsx`
75. `frontend-modern/src/utils/resourceIdentity.ts`
76. `frontend-modern/src/components/Infrastructure/resourceDetailDrawerIdentityModel.ts`
-77. `frontend-modern/src/hooks/useDashboardTrends.ts`
-78. `frontend-modern/src/hooks/useUnifiedResources.ts`
+77. `frontend-modern/src/hooks/useUnifiedResources.ts`
79. `frontend-modern/src/types/resource.ts`
80. `frontend-modern/src/utils/sourcePlatforms.ts`
81. `frontend-modern/src/utils/platformSupportManifest.generated.ts`
@@ -228,7 +227,7 @@ AI-only summary payloads, or page-local heuristics.
canonicalization boundary: REST may hydrate the initial snapshot and
unsupported filtered queries, but supported snapshot freshness must come
from websocket `state.resources` instead of layering confirmatory
- dashboard/infrastructure REST refetch loops over already-owned resource
+ route-local REST refetch loops over already-owned resource
updates.
That shared store/adapter/hook path must also preserve canonical row shape
across transport boundaries: thinner realtime `state.resources` payloads
@@ -243,20 +242,19 @@ AI-only summary payloads, or page-local heuristics.
explicit cluster identity such as Kubernetes context or platform cluster
labels; standalone resource names must never be repurposed as synthetic
`clusterId` values.
-10. Keep the dashboard overview shell on the compact governed summary route
- rather than the unfiltered list transport. `frontend-modern/src/pages/Dashboard.tsx`
- and `frontend-modern/src/hooks/useDashboardOverview.ts` may consume the
- canonical `/api/resources/dashboard-summary` payload for KPI cards,
- problem-resource rows, and top-resource identity, but they must not
- recreate those summaries by mounting `useUnifiedResources()` just to count
- or rank resources on the dashboard shell.
+10. Keep the retired dashboard overview shell absent from unified-resource
+ consumers. `frontend-modern/src/pages/Dashboard.tsx`,
+ `frontend-modern/src/hooks/useDashboardOverview.ts`, and
+ `/api/resources/dashboard-summary` must not be restored as compatibility
+ readers for KPI cards, problem-resource rows, or top-resource identity.
+ Infrastructure and Workloads must consume their owning unified-resource
+ projections directly.
11. Keep summary consumers on the payload they were already given.
- `frontend-modern/src/hooks/useDashboardTrends.ts` and
`frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts`
may derive chart identity, storage presence, and infrastructure rollups
- from the compact dashboard overview or resource snapshot they already own,
- but they must not reopen `useResources()` or start a second unfiltered
- unified-resource fetch path under the dashboard summary surface.
+ from the resource snapshot it already owns, but it must not reopen
+ `useResources()` or start a second unfiltered unified-resource fetch path
+ as a replacement dashboard summary surface.
12. Keep shared selector hydration visibility-bound. Reusable shells such as
`frontend-modern/src/components/shared/useInfrastructureSelectorState.ts`
may consume `frontend-modern/src/hooks/useUnifiedResources.ts`, but hidden
@@ -420,13 +418,13 @@ AI-only summary payloads, or page-local heuristics.
through the canonical frontend-to-`ResourceType` resolver before slicing
the snapshot, so compatibility values such as `disk` / `physical_disk`
stay on one cache truth instead of falling back to ad hoc filter aliases.
-18. Keep dashboard storage trend target selection on canonical unified-resource
- truth. `frontend-modern/src/hooks/useDashboardTrends.ts` may detect
- storage presence from canonical `isStorage(...)` resources and their
- shared metrics-target IDs, but once storage exists it must reuse the owned
- compact `/api/charts/storage-summary` contract instead of rebuilding
- page-local per-resource storage history fetches, storage-type aliases, or
- full storage-page `/api/storage-charts` fetches.
+18. Keep storage summary target selection on canonical unified-resource truth.
+ Storage-summary consumers may detect storage presence from canonical
+ `isStorage(...)` resources and their shared metrics-target IDs, but once
+ storage exists they must reuse the owned compact
+ `/api/charts/storage-summary` contract instead of rebuilding page-local
+ per-resource storage history fetches, storage-type aliases, or full
+ storage-page `/api/storage-charts` fetches.
19. Keep infrastructure page-header framing presentation-only on the page
shell. `frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx`
may render the shared `PageHeader`, but canonical source/status/search
@@ -584,8 +582,8 @@ Seeded unified-resource snapshots are part of that same registry ownership.
`internal/unifiedresources/registry.go` must rebuild the canonical `bySource`
index from source-owned facets already present on seeded unified resources
before manual links, overlays, or metrics-target resolution run, so
-`/api/resources/dashboard-summary`, `/api/resources`, dashboard trend joins,
-and other chart consumers keep resolving history through canonical source
+`/api/resources`, infrastructure summary joins, storage summary joins, and
+other chart consumers keep resolving history through canonical source
coordinates instead of silently falling back to hashed unified resource IDs.
That same registry/view boundary now also applies to provider-backed storage.
`internal/unifiedresources/registry.go` must attach the resolved
@@ -836,20 +834,14 @@ shape: `InfrastructureSummary.tsx` is the render shell,
org-scope lifecycle, and focused-summary state, and
`infrastructureSummaryModel.ts` owns chart matching, focused-summary display
selection, empty-state wording, and summary-series/metric derivation.
-The dashboard overview trend hook now follows that same canonical consumer
-contract for infrastructure sparklines: `frontend-modern/src/hooks/useDashboardTrends.ts`
-must consume the infrastructure summary chart cache and shared unified-resource
-series matching logic instead of issuing bespoke per-resource
-`/api/metrics-store/history` fetches for top-CPU and top-memory cards. That
-keeps dashboard summary sparklines aligned with canonical resource identity
-matching, agent-facet fallback behavior, and first-sample empty-state semantics
-already owned by the infrastructure summary surface.
-The same contract now also treats dashboard top-card sparkline hydration as a
-summary projection concern, not a per-resource history concern: top-CPU and
-top-memory selections may still come from dashboard overview ranking, but the
-series attached to those selections must be resolved through the same
-resource-to-chart matching path used by infrastructure summary cards so agent
-fallback and canonical identity aliases do not drift between the two surfaces.
+The retired dashboard overview trend hook must not return as a second
+infrastructure sparkline consumer. Infrastructure summary surfaces must consume
+the infrastructure summary chart cache and shared unified-resource series
+matching logic instead of issuing bespoke per-resource
+`/api/metrics-store/history` fetches for overview cards. That keeps summary
+sparklines aligned with canonical resource identity matching, agent-facet
+fallback behavior, and first-sample empty-state semantics already owned by the
+infrastructure summary surface.
The backend AI and Patrol context renderers now derive their canonical change
kind, source type, source adapter, actor, reason, and related-resource
fragments from `internal/unifiedresources/change_presentation.go`, so the
@@ -943,7 +935,7 @@ card, so canonical timeline wording and ordering stay governed by one
frontend feed instead of separate page-local loops.
The unified-resource detail drawer now also routes resource-tag presentation
through the shared `frontend-modern/src/components/shared/TagBadges.tsx`
-primitive instead of importing a dashboard-local badge helper into the
+primitive instead of importing a workload-local badge helper into the
resource surface. Future drawer tag presentation changes must extend through
that shared primitive boundary rather than recreating tag-dot logic inside the
drawer or pulling feature-local badge components across subsystem lines.
@@ -1033,9 +1025,9 @@ drawer, which keeps the presentation surface aligned with the governed API
contract instead of rebuilding the relationship and timeline inline.
The canonical routing owner now also lives in
`frontend-modern/src/routing/resourceLinks.ts`, including the
-workload-to-infrastructure href builder used by dashboard row and drawer
+workload-to-infrastructure href builder used by Workloads row and drawer
consumers. Future workload-to-resource navigation changes must extend through
-that shared routing contract instead of reintroducing dashboard-local path
+that shared routing contract instead of reintroducing workload-local path
builders.
That same shared routing boundary now also owns the canonical Patrol
destination used by cross-surface findings and drill-down links. Shared
@@ -1418,15 +1410,15 @@ mock-history paths, so cluster, node, pod, and deployment charts all bind to
one runtime key family instead of each layer rebuilding Kubernetes IDs from
cluster name, namespace, or surface-local aliases.
The drawer's discovery mapper also reuses that helper for pod fallback agent
-IDs, so the resource-detail path and the dashboard path stay aligned on the
+IDs, so the resource-detail path and the Workloads path stay aligned on the
same cluster-name source of truth.
-The dashboard workload projection and workloads-link route helpers also share
+The workload projection and workloads-link route helpers also share
the same Kubernetes context prefix helper in the shared agent-resource
layer, so pod grouping and cluster navigation keep the same cluster-context
prefix before any surface-specific display fallback is applied.
The unified-resource projection also reuses that same prefix helper for
projected Kubernetes `clusterId`, so the shared resource store stays aligned
-with the dashboard and detail surfaces on the same canonical cluster-context
+with the Workloads and detail surfaces on the same canonical cluster-context
source of truth.
That same contract also owns the canonical resource display-name fallback, so
name-or-ID presentation stays consistent between the unified AI adapter, the
@@ -1796,8 +1788,8 @@ Docker-routed control target.
That same contract applies to the frontend workload state boundary:
`frontend-modern/src/hooks/useWorkloads.ts`,
`frontend-modern/src/utils/workloads.ts`,
-`frontend-modern/src/components/Dashboard/workloadTopology.ts`, and
-`frontend-modern/src/components/Dashboard/useGuestRowState.ts` may reuse
+`frontend-modern/src/components/Workloads/workloadTopology.ts`, and
+`frontend-modern/src/components/Workloads/useGuestRowState.ts` may reuse
shared `DockerData` for runtime metadata, but they must keep Docker-only
action identifiers and update affordances scoped to Docker-managed
app-containers. TrueNAS-backed `app-container` workloads must still navigate
diff --git a/frontend-modern/scripts/canonical-platform-audit.mjs b/frontend-modern/scripts/canonical-platform-audit.mjs
index 2b2a83f7c6..4306765ce1 100644
--- a/frontend-modern/scripts/canonical-platform-audit.mjs
+++ b/frontend-modern/scripts/canonical-platform-audit.mjs
@@ -61,10 +61,8 @@ const ALLOWLIST = new Set([
'src/utils/agentCapabilityPresentation.ts',
'src/utils/unifiedAgentInventoryPresentation.ts',
'src/utils/unifiedAgentStatusPresentation.ts',
- 'src/utils/dashboardAlertPresentation.ts',
- 'src/utils/dashboardEmptyStatePresentation.ts',
- 'src/utils/dashboardStoragePresentation.ts',
- 'src/utils/dashboardRecoveryPresentation.ts',
+ 'src/utils/alertOverviewPresentation.ts',
+ 'src/utils/workloadEmptyStatePresentation.ts',
'src/utils/temperature.ts',
'src/utils/licensePresentation.ts',
'src/utils/k8sStatusPresentation.ts',
@@ -142,10 +140,7 @@ const ALLOWLIST = new Set([
'src/utils/k8sDeploymentPresentation.ts',
'src/utils/k8sNamespacePresentation.ts',
'src/components/shared/EnvironmentLockBadge.tsx',
- 'src/utils/dashboardCompositionPresentation.ts',
- 'src/utils/dashboardGuestPresentation.ts',
- 'src/utils/dashboardMetricPresentation.ts',
- 'src/utils/dashboardTrendPresentation.ts',
+ 'src/utils/workloadGuestPresentation.ts',
'src/utils/deployFlowPresentation.ts',
'src/utils/infrastructureEmptyStatePresentation.ts',
]);
@@ -335,11 +330,11 @@ const HELPER_RULES = [
'Do not define local infrastructure empty-state copy in page code. Use @/utils/infrastructureEmptyStatePresentation instead.',
},
{
- rule: 'canonical-dashboard/no-local-dashboard-empty-state-copy',
+ rule: 'canonical-workloads/no-local-workload-empty-state-copy',
regex:
/No infrastructure hosts connected|No guests found|Install the Pulse agent to connect a host and unlock v6 infrastructure data, or add a Proxmox connection in Settings β†’ Infrastructure β†’ Proxmox\.|No guests match your current filters|No guests match your search |Loading dashboard data\.\.\.|Connecting to monitoring service|Reconnecting to monitoring service…|Real-time data is currently unavailable\. Showing last-known state\.|Real-time data is reconnecting\. Showing last-known state\.|Dashboard unavailable|Real-time dashboard data is currently unavailable\. Reconnect to try again\.|No resources yet|Once connected platforms report resources, your dashboard overview will appear here\./g,
message:
- 'Do not define local dashboard empty-state copy in component code. Use @/utils/dashboardEmptyStatePresentation instead.',
+ 'Do not define local Workloads empty-state copy in component code. Use @/utils/workloadEmptyStatePresentation instead.',
},
{
rule: 'canonical-shared/no-local-empty-state-tone-maps',
@@ -530,16 +525,16 @@ const HELPER_RULES = [
'Do not define local recovery chart range selected-button classes in page code. Use the shared segmented button contract instead.',
},
{
- rule: 'canonical-dashboard/no-local-trend-range-selected-classes',
+ rule: 'canonical-overview/no-local-trend-range-selected-classes',
regex: /\bselectedRange\(\)\s*===\s*range\b[\s\S]{0,260}bg-blue-600\s+text-white/g,
message:
- 'Do not define local dashboard trend range selected-button classes in page code. Use the shared segmented button contract instead.',
+ 'Do not define local overview trend range selected-button classes in page code. Use the shared segmented button contract instead.',
},
{
- rule: 'canonical-dashboard/no-local-trend-error-copy',
+ rule: 'canonical-overview/no-local-trend-error-copy',
regex: /Unable to load trends/g,
message:
- 'Do not define local dashboard trend error copy in panel code. Use @/utils/dashboardTrendPresentation instead.',
+ 'Do not define local overview trend error copy in panel code. Use the governed route presentation helper instead.',
},
{
rule: 'canonical-ai/no-local-findings-filter-selected-classes',
@@ -644,30 +639,30 @@ const HELPER_RULES = [
'Do not define local unified-agent lookup status helpers in component code. Use @/utils/unifiedAgentStatusPresentation instead.',
},
{
- rule: 'canonical-dashboard/no-local-problem-status-variant',
+ rule: 'canonical-overview/no-local-problem-status-variant',
regex: /\b(?:const|function)\s+statusVariant\s*\(\s*pr\s*:\s*ProblemResource\s*\)/g,
message:
- 'Do not define local dashboard problem-resource status helpers in page code. Use @/utils/problemResourcePresentation instead.',
+ 'Do not define local problem-resource status helpers in page code. Use @/utils/problemResourcePresentation instead.',
},
{
- rule: 'canonical-dashboard/no-local-alerts-tone',
+ rule: 'canonical-alerts/no-local-alerts-tone',
regex: /\b(?:const|function)\s+alertsTone\b/g,
message:
- 'Do not define local dashboard alert summary tone helpers in page code. Use @/utils/dashboardAlertPresentation instead.',
+ 'Do not define local alert summary tone helpers in page code. Use @/utils/alertOverviewPresentation instead.',
},
{
- rule: 'canonical-dashboard/no-local-storage-recovery-or-alert-copy',
+ rule: 'canonical-overview/no-local-storage-recovery-or-alert-copy',
regex:
/No active alerts|No storage resources|No recovery data available|Last recovery point over 24 hours ago/g,
message:
- 'Do not define local dashboard storage, recovery, or alert empty-state/staleness copy in page code. Use the shared dashboard presentation utilities instead.',
+ 'Do not define local storage, recovery, or alert empty-state/staleness copy in page code. Use the owning shared presentation utilities instead.',
},
{
- rule: 'canonical-dashboard/no-local-composition-or-ai-empty-state-copy',
+ rule: 'canonical-overview/no-local-composition-or-ai-empty-state-copy',
regex:
/No resources detected|Loading usage…|No usage data yet\.|No daily USD trend yet\.|No daily token trend yet\.|No issues found/g,
message:
- 'Do not define local dashboard or AI empty-state copy in component code. Use the shared presentation utilities instead.',
+ 'Do not define local overview or AI empty-state copy in component code. Use the shared presentation utilities instead.',
},
{
rule: 'canonical-ai/no-local-chat-empty-state-copy',
@@ -789,7 +784,7 @@ const HELPER_RULES = [
'Do not define local ResourcePicker filter labels or hardcoded filter lists in component code. Use @/utils/reportableResourceTypes instead.',
},
{
- rule: 'canonical-dashboard/no-local-threshold-slider-color-map',
+ rule: 'canonical-shared/no-local-threshold-slider-color-map',
regex:
/\bconst\s+colorMap\s*:\s*Record<ThresholdSliderProps\['type'\],\s*string>\s*=\s*\{[\s\S]{0,220}cpu:[\s\S]{0,220}memory:[\s\S]{0,220}disk:[\s\S]{0,220}temperature:/g,
message:
@@ -1027,24 +1022,24 @@ const HELPER_RULES = [
'Do not define local recovery timeline chart presentation in component code. Use @/utils/recoveryTimelineChartPresentation instead.',
},
{
- rule: 'canonical-dashboard/no-local-dashboard-helper-implementations',
+ rule: 'canonical-overview/no-local-helper-implementations',
regex:
/\bexport function statusBadgeClass\b|\bexport function priorityBadgeClass\b|\bexport function deltaColorClass\b/g,
message:
- 'Do not define dashboard metric presentation functions in page-local helpers. Use @/utils/dashboardMetricPresentation instead.',
+ 'Do not define metric presentation functions in page-local helpers. Use the governed route presentation helper instead.',
},
{
- rule: 'canonical-dashboard/no-local-composition-icon-map',
+ rule: 'canonical-overview/no-local-composition-icon-map',
regex: /\bconst\s+TYPE_ICONS\s*:\s*Record<string,\s*any>\s*=/g,
message:
- 'Do not define local dashboard composition icon maps in page code. Use @/utils/dashboardCompositionPresentation instead.',
+ 'Do not define local composition icon maps in page code. Use the governed route presentation helper instead.',
},
{
- rule: 'canonical-dashboard/no-local-guest-backup-status-map',
+ rule: 'canonical-workloads/no-local-guest-backup-status-map',
regex:
/\bconst\s+BACKUP_STATUS_CONFIG\s*:\s*Record<|No backup found|No IP assigned|No filesystems found\. VM may be booting or using a Live ISO\./g,
message:
- 'Do not define local dashboard guest fallback copy or backup status maps in component code. Use @/utils/dashboardGuestPresentation instead.',
+ 'Do not define local Workloads guest fallback copy or backup status maps in component code. Use @/utils/workloadGuestPresentation instead.',
},
{
rule: 'canonical-infrastructure/no-local-deploy-flow-copy',
diff --git a/frontend-modern/src/App.tsx b/frontend-modern/src/App.tsx
index 341afab0c5..58c28f8d96 100644
--- a/frontend-modern/src/App.tsx
+++ b/frontend-modern/src/App.tsx
@@ -23,7 +23,6 @@ import { aiChatStore } from './stores/aiChat';
import { useKeyboardShortcuts } from './hooks/useKeyboardShortcuts';
import { useKioskMode } from '@/hooks/useKioskMode';
import {
- DASHBOARD_PATH,
PATROL_PATH,
buildRecoveryPath,
buildInfrastructurePath,
@@ -54,7 +53,6 @@ const AlertsPage = lazy(() =>
);
const SettingsPage = lazy(() => import('./components/Settings/Settings'));
const InfrastructurePage = lazy(() => import('./pages/Infrastructure'));
-const DashboardPage = lazy(() => import('./pages/Dashboard'));
const WorkloadsPage = lazy(() => import('./pages/Workloads'));
const AIIntelligencePage = lazy(() =>
import('./pages/AIIntelligence').then((module) => ({ default: module.AIIntelligence })),
@@ -67,7 +65,6 @@ const SetupCompletionPreviewPage = lazy(() =>
default: module.SetupCompletionPreview,
})),
);
-const ROOT_DASHBOARD_PATH = DASHBOARD_PATH;
const INFRASTRUCTURE_ROUTE_PATH = buildInfrastructurePath();
const ROOT_WORKLOADS_PATH = buildWorkloadsPath();
const STORAGE_PATH = buildStoragePath();
@@ -455,7 +452,6 @@ function App() {
<Router root={RootLayout}>
<Route path="/pricing" component={PricingHandoffPage} />
<Route path="/preview/setup-complete" component={SetupCompletionPreviewPage} />
- <Route path={ROOT_DASHBOARD_PATH} component={DashboardPage} />
<Route path="/login" component={RuntimeHomePage} />
<Route path="/" component={RuntimeHomePage} />
<Route path={ROOT_WORKLOADS_PATH} component={WorkloadsPage} />
diff --git a/frontend-modern/src/AppLayout.tsx b/frontend-modern/src/AppLayout.tsx
index 474fb82641..82b4b7194f 100644
--- a/frontend-modern/src/AppLayout.tsx
+++ b/frontend-modern/src/AppLayout.tsx
@@ -2,7 +2,6 @@ import { For, Show, Suspense, createEffect, createMemo, createSignal, onCleanup
import type { JSX } from 'solid-js';
import { useLocation, useNavigate } from '@solidjs/router';
import BoxesIcon from 'lucide-solid/icons/boxes';
-import LayoutDashboardIcon from 'lucide-solid/icons/layout-dashboard';
import ServerIcon from 'lucide-solid/icons/server';
import HardDriveIcon from 'lucide-solid/icons/hard-drive';
import ArchiveIcon from 'lucide-solid/icons/archive';
@@ -31,7 +30,6 @@ import { preloadRouteModule } from '@/routing/routePreload';
import {
buildInfrastructurePath,
buildWorkloadsPath,
- DASHBOARD_PATH,
} from '@/routing/resourceLinks';
import { buildStorageRecoveryTabSpecs } from '@/routing/platformTabs';
import { getKioskModePreference, setKioskMode } from '@/utils/url';
@@ -229,8 +227,8 @@ export function AppLayout(props: AppLayoutProps) {
!normalizedPath.startsWith('/alerts/overview/') &&
!normalizedPath.startsWith('/alerts/history/');
- if ((isBlocked || isAlertConfigTab) && normalizedPath !== DASHBOARD_PATH) {
- navigate(DASHBOARD_PATH, { replace: true });
+ if ((isBlocked || isAlertConfigTab) && normalizedPath !== ROOT_INFRASTRUCTURE_PATH) {
+ navigate(ROOT_INFRASTRUCTURE_PATH, { replace: true });
}
});
@@ -268,17 +266,6 @@ export function AppLayout(props: AppLayoutProps) {
const platformTabs = createMemo<PlatformTab[]>(() => {
const allPlatforms: PlatformTab[] = [
- {
- id: 'dashboard',
- label: 'Dashboard',
- route: DASHBOARD_PATH,
- settingsRoute: '/settings',
- tooltip: 'Environment overview and command center',
- enabled: true,
- live: true,
- icon: LayoutDashboardIcon,
- alwaysShow: true,
- },
{
id: 'infrastructure',
label: 'Infrastructure',
diff --git a/frontend-modern/src/__tests__/App.architecture.test.ts b/frontend-modern/src/__tests__/App.architecture.test.ts
index 45675fd0cc..a8706a6114 100644
--- a/frontend-modern/src/__tests__/App.architecture.test.ts
+++ b/frontend-modern/src/__tests__/App.architecture.test.ts
@@ -11,7 +11,6 @@ const appStylesSource = readFileSync(join(process.cwd(), 'src/index.css'), 'utf8
describe('App architecture', () => {
it('keeps App as the entry shell that delegates runtime and chrome ownership', () => {
- expect(appSource).toContain('DASHBOARD_PATH,');
expect(appSource).toContain("import { AppLayout } from '@/AppLayout';");
expect(appSource).toContain("import { aiChatStore } from './stores/aiChat';");
expect(appSource).toContain(
@@ -28,7 +27,7 @@ describe('App architecture', () => {
expect(appSource).toContain('setAppScrollShellRef');
expect(appSource).toContain('readPendingAppShellRestoreTop');
expect(appSource).toContain('clearPendingAppShellRestoreTop');
- expect(appSource).toContain('const ROOT_DASHBOARD_PATH = DASHBOARD_PATH;');
+ expect(appSource).toContain('const INFRASTRUCTURE_ROUTE_PATH = buildInfrastructurePath();');
expect(appSource).toContain('const ROOT_PATROL_PATH = PATROL_PATH;');
expect(appSource).toContain("import { preloadRouteModule } from '@/routing/routePreload';");
expect(appSource).toContain('const APP_SHELL_ROUTE_PRELOAD_PATHS = [');
@@ -37,7 +36,10 @@ describe('App architecture', () => {
expect(appSource).toContain('await preloadRouteModule(route);');
expect(appSource).toContain('const timeoutId = window.setTimeout(() => {');
expect(appSource).toContain('void preloadAppShellRoutes();');
- expect(appSource).toContain('<Route path={ROOT_DASHBOARD_PATH} component={DashboardPage} />');
+ expect(appSource).toContain(
+ '<Route path={INFRASTRUCTURE_ROUTE_PATH} component={InfrastructurePage} />',
+ );
+ expect(appSource).not.toContain('DashboardPage');
expect(appSource).toContain("import RuntimeHomePage from '@/pages/RuntimeHome';");
expect(appSource).toContain('<Route path="/login" component={RuntimeHomePage} />');
expect(appSource).toContain('<Route path="/" component={RuntimeHomePage} />');
@@ -67,7 +69,7 @@ describe('App architecture', () => {
"const StorageComponent = lazy(() => import('./components/Storage/Storage'));",
);
expect(appSource).not.toContain(
- "const WorkloadsView = lazy(() => import('./components/Dashboard/Dashboard'));",
+ "const WorkloadsView = lazy(() => import('./components/Workloads/WorkloadsSurface'));",
);
expect(appSource).not.toContain(
"const RecoveryRoute = lazy(() => import('./pages/RecoveryRoute'));",
@@ -244,8 +246,10 @@ describe('App architecture', () => {
expect(appRuntimeStateSource).toContain(
"eventBus.on('websocket_reconnected', handleWebSocketReconnected);",
);
- expect(appRuntimeStateSource).toContain("const ROOT_DASHBOARD_PATH = '/dashboard';");
- expect(appRuntimeStateSource).toContain('if (pathname === ROOT_DASHBOARD_PATH) return false;');
+ expect(appRuntimeStateSource).toContain(
+ 'const ROOT_INFRASTRUCTURE_PATH = buildInfrastructurePath();',
+ );
+ expect(appRuntimeStateSource).not.toContain("const ROOT_DASHBOARD_PATH = '/dashboard';");
expect(appRuntimeStateSource).not.toContain(
"import { startMetricsCollector } from '@/stores/metricsCollector';",
);
@@ -257,9 +261,10 @@ describe('App architecture', () => {
expect(routePreloadSource).toContain(
'const routePreloadCache = new Map<string, Promise<void>>();',
);
+ expect(routePreloadSource).toContain("import('@/pages/Infrastructure')");
expect(routePreloadSource).toContain("import('@/pages/Workloads')");
expect(routePreloadSource).toContain("import('@/pages/Recovery')");
- expect(routePreloadSource).not.toContain("import('@/components/Dashboard/Dashboard')");
+ expect(routePreloadSource).not.toContain("import('@/components/Workloads/WorkloadsSurface')");
expect(routePreloadSource).not.toContain("import('@/pages/RecoveryRoute')");
expect(appRuntimeContextSource).toContain(
"import { createContext, useContext } from 'solid-js';",
diff --git a/frontend-modern/src/__tests__/AppLayout.test.tsx b/frontend-modern/src/__tests__/AppLayout.test.tsx
index f35417b6a7..0a0544240e 100644
--- a/frontend-modern/src/__tests__/AppLayout.test.tsx
+++ b/frontend-modern/src/__tests__/AppLayout.test.tsx
@@ -9,7 +9,7 @@ HTMLElement.prototype.scrollIntoView = vi.fn();
describe('AppLayout navigation icons', () => {
beforeEach(() => {
- window.history.replaceState({}, '', '/dashboard');
+ window.history.replaceState({}, '', '/infrastructure');
aiChatStore.close();
aiChatStore.setEnabled(true);
});
@@ -24,7 +24,7 @@ describe('AppLayout navigation icons', () => {
render(() => (
<Router>
<Route
- path="/dashboard"
+ path="/infrastructure"
component={() => (
<AppLayout
connectionStatus={() => ({
@@ -58,7 +58,7 @@ describe('AppLayout navigation icons', () => {
showOrgSwitcher={() => false}
onSwitchOrg={() => {}}
>
- <div>Dashboard body</div>
+ <div>Infrastructure body</div>
</AppLayout>
)}
/>
@@ -96,7 +96,7 @@ describe('AppLayout navigation icons', () => {
const mobilePatrolTab = within(mobileTablist).getByRole('button', { name: 'Patrol' });
expect(mobilePatrolTab.querySelector('svg')).toBeTruthy();
- expect(container).toHaveTextContent('Dashboard body');
+ expect(container).toHaveTextContent('Infrastructure body');
});
it('keeps connected brand motion on the logo while the wordmark stays static', () => {
diff --git a/frontend-modern/src/api/__tests__/resources.test.ts b/frontend-modern/src/api/__tests__/resources.test.ts
index bafe9b7710..48126528e9 100644
--- a/frontend-modern/src/api/__tests__/resources.test.ts
+++ b/frontend-modern/src/api/__tests__/resources.test.ts
@@ -11,54 +11,6 @@ describe('ResourceAPI', () => {
vi.clearAllMocks();
});
- it('fetches the compact dashboard summary payload from the dashboard-summary endpoint', async () => {
- vi.mocked(apiFetchJSON).mockResolvedValueOnce({
- health: { totalResources: 4, byStatus: { online: 3, degraded: 1 } },
- infrastructure: {
- total: 2,
- byStatus: { online: 2 },
- byType: { agent: 1, 'docker-host': 1 },
- topCPU: [
- {
- id: 'infra-a',
- name: 'Infra A',
- percent: 91,
- metricsTarget: { resourceType: 'agent', resourceId: 'host-a' },
- },
- ],
- topMemory: [
- {
- id: 'infra-a',
- name: 'Infra A',
- percent: 82,
- metricsTarget: { resourceType: 'agent', resourceId: 'host-a' },
- },
- ],
- },
- workloads: { total: 1, running: 1, stopped: 0, byType: { vm: 1 } },
- storage: {
- total: 1,
- totalCapacity: 1_000,
- totalUsed: 850,
- warningCount: 1,
- criticalCount: 0,
- },
- problemResources: [],
- } as any);
-
- const result = await ResourceAPI.getDashboardSummary();
-
- expect(apiFetchJSON).toHaveBeenCalledWith('/api/resources/dashboard-summary', {
- cache: 'no-store',
- });
- expect(result.health.totalResources).toBe(4);
- expect(result.infrastructure.topCPU[0]?.id).toBe('infra-a');
- expect(result.infrastructure.topCPU[0]?.metricsTarget).toEqual({
- resourceType: 'agent',
- resourceId: 'host-a',
- });
- });
-
it('fetches the resource history bundle from the facet endpoint', async () => {
vi.mocked(apiFetchJSON).mockResolvedValueOnce({
resourceId: 'vm:42',
diff --git a/frontend-modern/src/api/resources.ts b/frontend-modern/src/api/resources.ts
index cae95fa8a0..dda9079c05 100644
--- a/frontend-modern/src/api/resources.ts
+++ b/frontend-modern/src/api/resources.ts
@@ -6,8 +6,6 @@ import type {
ResourceChangeSourceAdapter,
ResourceChangeSourceType,
ResourceFacetCounts,
- ResourceMetricsTarget,
- ResourcePolicy,
ResourceRelationship,
} from '@/types/resource';
@@ -32,61 +30,6 @@ export interface ResourceFacetBundle {
counts: ResourceFacetCounts;
}
-export interface DashboardOverviewSummaryTopResource {
- id: string;
- name: string;
- percent: number;
- metricsTarget?: ResourceMetricsTarget;
-}
-
-export interface DashboardOverviewSummaryProblemResource {
- id: string;
- type: string;
- name: string;
- status: string;
- lastSeen?: string;
- sources?: string[];
- aiSafeSummary?: string;
- policy?: ResourcePolicy;
- canonicalIdentity?: {
- displayName?: string;
- hostname?: string;
- platformId?: string;
- primaryId?: string;
- aliases?: string[];
- };
- problems: string[];
- worstValue: number;
-}
-
-export interface DashboardOverviewSummaryResponse {
- health: {
- totalResources: number;
- byStatus: Record<string, number>;
- };
- infrastructure: {
- total: number;
- byStatus: Record<string, number>;
- byType: Record<string, number>;
- topCPU: DashboardOverviewSummaryTopResource[];
- topMemory: DashboardOverviewSummaryTopResource[];
- };
- workloads: {
- total: number;
- running: number;
- stopped: number;
- byType: Record<string, number>;
- };
- storage: {
- total: number;
- totalCapacity: number;
- totalUsed: number;
- warningCount: number;
- criticalCount: number;
- };
- problemResources: DashboardOverviewSummaryProblemResource[];
-}
-
const normalizeResourceId = (resourceId: string): string => resourceId.trim();
const buildFacetPath = (resourceId: string, suffix: string): string =>
@@ -122,10 +65,6 @@ const fetchFacet = async <T>(url: string): Promise<T> =>
});
export class ResourceAPI {
- static async getDashboardSummary(): Promise<DashboardOverviewSummaryResponse> {
- return fetchFacet<DashboardOverviewSummaryResponse>('/api/resources/dashboard-summary');
- }
-
static async getTimeline(
resourceId: string,
options?: ResourceTimelineQueryOptions,
diff --git a/frontend-modern/src/components/Alerts/AlertResourceTableRow.tsx b/frontend-modern/src/components/Alerts/AlertResourceTableRow.tsx
index 248e2243bb..970dbb7226 100644
--- a/frontend-modern/src/components/Alerts/AlertResourceTableRow.tsx
+++ b/frontend-modern/src/components/Alerts/AlertResourceTableRow.tsx
@@ -3,7 +3,7 @@ import RotateCcw from 'lucide-solid/icons/rotate-ccw';
import { TogglePrimitive } from '@/components/shared/Toggle';
import { StatusBadge } from '@/components/shared/StatusBadge';
-import { ThresholdSlider } from '@/components/Dashboard/ThresholdSlider';
+import { ThresholdSlider } from '@/components/Workloads/ThresholdSlider';
import { TableCell, TableRow } from '@/components/shared/Table';
import {
getAlertResourceTableCustomBadgeLabel,
diff --git a/frontend-modern/src/components/Alerts/BulkEditDialog.tsx b/frontend-modern/src/components/Alerts/BulkEditDialog.tsx
index 055d3a6f69..a1753b2331 100644
--- a/frontend-modern/src/components/Alerts/BulkEditDialog.tsx
+++ b/frontend-modern/src/components/Alerts/BulkEditDialog.tsx
@@ -1,6 +1,6 @@
import { Show, For, createSignal, createEffect } from 'solid-js';
import { Dialog } from '../shared/Dialog';
-import { ThresholdSlider } from '../Dashboard/ThresholdSlider';
+import { ThresholdSlider } from '../Workloads/ThresholdSlider';
import {
ALERT_BULK_EDIT_CANCEL_LABEL,
ALERT_BULK_EDIT_CLEAR_LABEL,
diff --git a/frontend-modern/src/components/Alerts/RecentAlertsPanel.tsx b/frontend-modern/src/components/Alerts/RecentAlertsPanel.tsx
deleted file mode 100644
index c5b0e76b59..0000000000
--- a/frontend-modern/src/components/Alerts/RecentAlertsPanel.tsx
+++ /dev/null
@@ -1,178 +0,0 @@
-import { For, Show, createMemo } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { ALERTS_OVERVIEW_PATH, AI_PATROL_PATH } from '@/routing/resourceLinks';
-import { formatRelativeTime } from '@/utils/format';
-import {
- ALERTS_EMPTY_STATE,
- getDashboardAlertSummaryText,
-} from '@/utils/alertOverviewPresentation';
-import {
- getAlertSeverityBadgeClass,
- getAlertSeverityCompactLabel,
-} from '@/utils/alertSeverityPresentation';
-import type { Alert } from '@/types/api';
-import { getCanonicalAlertId } from '@/features/alerts/identity';
-import { useAlertAcknowledgementState } from '@/features/alerts/useAlertAcknowledgementState';
-import BellIcon from 'lucide-solid/icons/bell';
-
-const MAX_SHOWN = 8;
-
-interface RecentAlertsPanelProps {
- alerts: Alert[];
-}
-
-// "State-only" alerts describe a state the operator typically chose (a VM that
-// is stopped, a container that is powered off). Mixed alongside structural
-// health signals like "ZFS device /dev/sda4 has errors" they drown out the
-// signal that actually requires attention. We still surface them below
-// structural warnings of the same level so the first screen leads with real
-// problems.
-const STATE_ONLY_MESSAGE_PATTERNS: RegExp[] = [/is powered off/i, /is stopped/i, /is paused/i];
-
-function isStateOnlyAlert(alert: Alert): boolean {
- const message = alert.message ?? '';
- return STATE_ONLY_MESSAGE_PATTERNS.some((pattern) => pattern.test(message));
-}
-
-function alertRank(alert: Alert): number {
- // Lower rank = higher priority in the list.
- if (alert.level === 'critical') return 0;
- if (alert.level === 'warning') {
- return isStateOnlyAlert(alert) ? 3 : 1;
- }
- return 2;
-}
-
-function sortAlertsForDashboard(alerts: Alert[]): Alert[] {
- const sorted = [...alerts];
- sorted.sort((a, b) => {
- const rankDelta = alertRank(a) - alertRank(b);
- if (rankDelta !== 0) return rankDelta;
- const aMs = Date.parse(a.startTime) || 0;
- const bMs = Date.parse(b.startTime) || 0;
- return bMs - aMs;
- });
- return sorted;
-}
-
-export function RecentAlertsPanel(props: RecentAlertsPanelProps) {
- const {
- effectiveAlerts,
- unacknowledgedAlerts,
- processingAlerts,
- bulkAckProcessing,
- handleAlertAcknowledgement,
- handleBulkAcknowledge,
- } = useAlertAcknowledgementState({
- alerts: () => props.alerts,
- });
- const recent = createMemo(() => sortAlertsForDashboard(effectiveAlerts()).slice(0, MAX_SHOWN));
- const activeCriticalCount = createMemo(
- () =>
- effectiveAlerts().filter((alert) => !alert.acknowledged && alert.level === 'critical').length,
- );
- const activeWarningCount = createMemo(
- () =>
- effectiveAlerts().filter((alert) => !alert.acknowledged && alert.level === 'warning').length,
- );
- const alertSummaryText = createMemo(() =>
- getDashboardAlertSummaryText({
- activeCritical: activeCriticalCount(),
- activeWarning: activeWarningCount(),
- }),
- );
-
- return (
- <Card padding="none" tone="default" class="border-border-subtle overflow-hidden">
- <div class="px-4 py-3 flex items-center justify-between gap-2">
- <div class="flex items-center gap-2">
- <BellIcon class="w-4 h-4 text-muted" aria-hidden="true" />
- <h2 class="text-sm font-semibold text-base-content">Alerts</h2>
- </div>
- <div class="flex items-center gap-2">
- <Show when={unacknowledgedAlerts().length > 1}>
- <button
- type="button"
- onClick={() => {
- void handleBulkAcknowledge();
- }}
- disabled={bulkAckProcessing()}
- class="text-[10px] font-medium text-base-content bg-surface-alt hover:bg-surface-hover disabled:opacity-50 px-2 py-0.5 rounded transition-colors"
- >
- {bulkAckProcessing() ? 'Acking...' : 'Ack All'}
- </button>
- </Show>
- <a
- href={ALERTS_OVERVIEW_PATH}
- aria-label="View all alerts"
- class="text-xs font-medium text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300"
- >
- All β†’
- </a>
- <a
- href={AI_PATROL_PATH}
- aria-label="View findings"
- class="text-xs font-medium text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300"
- >
- Findings β†’
- </a>
- </div>
- </div>
-
- <div class="px-4 pb-3">
- <Show
- when={props.alerts.length > 0}
- fallback={
- <p class="text-xs font-medium text-emerald-700 dark:text-emerald-300 pt-0.5">
- {ALERTS_EMPTY_STATE}
- </p>
- }
- >
- <p class="text-xs text-muted mb-1.5">{alertSummaryText()}</p>
-
- <ul class="space-y-0.5" role="list">
- <For each={recent()}>
- {(alert) => (
- <li class="flex items-center gap-2 -mx-1 px-1 py-1 rounded hover:bg-surface-hover transition-colors">
- <span class={getAlertSeverityBadgeClass(alert.level)}>
- {getAlertSeverityCompactLabel(alert.level)}
- </span>
- <p class="min-w-0 text-xs text-base-content truncate">{alert.resourceName}</p>
- <p class="min-w-0 text-xs text-muted truncate flex-1">{alert.message}</p>
- <span class="shrink-0 ml-auto text-[10px] font-mono text-slate-400">
- {formatRelativeTime(alert.startTime, { compact: true })}
- </span>
- <Show when={!alert.acknowledged}>
- <button
- type="button"
- onClick={() => {
- void handleAlertAcknowledgement(alert);
- }}
- disabled={processingAlerts().has(getCanonicalAlertId(alert))}
- class="shrink-0 px-1.5 py-0.5 text-[10px] font-medium text-base-content bg-surface-alt hover:bg-surface-hover disabled:opacity-50 rounded transition-colors"
- >
- {processingAlerts().has(getCanonicalAlertId(alert)) ? '...' : 'Ack'}
- </button>
- </Show>
- </li>
- )}
- </For>
- </ul>
-
- <Show when={props.alerts.length > MAX_SHOWN}>
- <p class="mt-1.5 text-[11px] text-muted">
- <a
- href={ALERTS_OVERVIEW_PATH}
- class="text-blue-600 hover:underline dark:text-blue-400"
- >
- +{props.alerts.length - MAX_SHOWN} more
- </a>
- </p>
- </Show>
- </Show>
- </div>
- </Card>
- );
-}
-
-export default RecentAlertsPanel;
diff --git a/frontend-modern/src/components/Alerts/ResourceTable.test.tsx b/frontend-modern/src/components/Alerts/ResourceTable.test.tsx
index 75670a54ed..bd0a192c70 100644
--- a/frontend-modern/src/components/Alerts/ResourceTable.test.tsx
+++ b/frontend-modern/src/components/Alerts/ResourceTable.test.tsx
@@ -92,7 +92,7 @@ vi.mock('@/components/shared/SectionHeader', () => ({
SectionHeader: (props: any) => <h3 data-testid="section-header">{props.title}</h3>,
}));
-vi.mock('@/components/Dashboard/ThresholdSlider', () => ({
+vi.mock('@/components/Workloads/ThresholdSlider', () => ({
ThresholdSlider: (props: any) => (
<input
data-testid="threshold-slider"
diff --git a/frontend-modern/src/components/Alerts/__tests__/BulkEditDialog.test.tsx b/frontend-modern/src/components/Alerts/__tests__/BulkEditDialog.test.tsx
index 1e0736139f..d5c8ffd0c7 100644
--- a/frontend-modern/src/components/Alerts/__tests__/BulkEditDialog.test.tsx
+++ b/frontend-modern/src/components/Alerts/__tests__/BulkEditDialog.test.tsx
@@ -5,7 +5,7 @@ import { createSignal } from 'solid-js';
import { BulkEditDialog, normalizeMetricKey } from '../BulkEditDialog';
// Mock ThresholdSlider β€” renders a range input that calls onChange on input events
-vi.mock('../../Dashboard/ThresholdSlider', () => ({
+vi.mock('../../Workloads/ThresholdSlider', () => ({
ThresholdSlider: (props: {
type: string;
min: number;
diff --git a/frontend-modern/src/components/Alerts/__tests__/RecentAlertsPanel.test.tsx b/frontend-modern/src/components/Alerts/__tests__/RecentAlertsPanel.test.tsx
deleted file mode 100644
index 295a2184f1..0000000000
--- a/frontend-modern/src/components/Alerts/__tests__/RecentAlertsPanel.test.tsx
+++ /dev/null
@@ -1,136 +0,0 @@
-import { fireEvent, render, screen, waitFor } from '@solidjs/testing-library';
-import { beforeEach, describe, expect, it, vi } from 'vitest';
-
-import { AlertsAPI } from '@/api/alerts';
-import { notificationStore } from '@/stores/notifications';
-import { RecentAlertsPanel } from '../RecentAlertsPanel';
-import type { Alert } from '@/types/api';
-
-vi.mock('@/api/alerts', () => ({
- AlertsAPI: {
- acknowledge: vi.fn(),
- bulkAcknowledge: vi.fn(),
- },
-}));
-
-vi.mock('@/stores/notifications', () => ({
- notificationStore: {
- error: vi.fn(),
- success: vi.fn(),
- },
-}));
-
-vi.mock('@/utils/logger', () => ({
- logger: {
- error: vi.fn(),
- },
-}));
-
-function makeAlert(overrides: Partial<Alert> = {}): Alert {
- return {
- id: 'alert-1',
- level: 'critical',
- resourceName: 'tower',
- message: 'Disk failure detected',
- acknowledged: false,
- startTime: '2026-03-08T10:00:00Z',
- type: 'disk-health',
- resourceId: 'host-1',
- resourceType: 'agent',
- source: 'agent',
- ...overrides,
- } as Alert;
-}
-
-describe('RecentAlertsPanel', () => {
- beforeEach(() => {
- vi.mocked(AlertsAPI.acknowledge).mockReset();
- vi.mocked(AlertsAPI.bulkAcknowledge).mockReset();
- vi.mocked(notificationStore.success).mockReset();
- vi.mocked(notificationStore.error).mockReset();
- });
-
- it('renders summary counts when alerts exist', () => {
- render(() => (
- <RecentAlertsPanel alerts={[makeAlert(), makeAlert({ id: 'alert-2', level: 'warning' })]} />
- ));
-
- expect(screen.getByText(/critical Β·/)).toBeInTheDocument();
- expect(screen.getAllByText('tower')).toHaveLength(2);
- });
-
- it('renders empty state when there are no active alerts', () => {
- render(() => <RecentAlertsPanel alerts={[]} />);
-
- expect(screen.getByText('No active alerts')).toBeInTheDocument();
- });
-
- it('keeps structural warnings above state-only warnings of the same severity', () => {
- render(() => (
- <RecentAlertsPanel
- alerts={[
- makeAlert({
- id: 'state-only',
- level: 'warning',
- resourceName: 'tails-anon',
- message: "VM 'tails-anon' is powered off",
- startTime: '2026-03-08T12:00:00Z',
- }),
- makeAlert({
- id: 'structural',
- level: 'warning',
- resourceName: 'local-zfs',
- message: 'ZFS device /dev/sda4 has errors',
- startTime: '2026-03-08T09:00:00Z',
- }),
- ]}
- />
- ));
-
- const structuralWarning = screen.getByText('ZFS device /dev/sda4 has errors');
- const stateOnlyWarning = screen.getByText("VM 'tails-anon' is powered off");
-
- expect(structuralWarning.compareDocumentPosition(stateOnlyWarning)).toBe(
- Node.DOCUMENT_POSITION_FOLLOWING,
- );
- });
-
- it('routes single acknowledge actions through the shared alert acknowledgement owner', async () => {
- vi.mocked(AlertsAPI.acknowledge).mockResolvedValue(undefined as never);
-
- render(() => (
- <RecentAlertsPanel
- alerts={[makeAlert(), makeAlert({ id: 'alert-2', message: 'Memory high' })]}
- />
- ));
-
- await fireEvent.click(screen.getAllByText('Ack')[0]);
-
- await waitFor(() => {
- expect(AlertsAPI.acknowledge).toHaveBeenCalledWith('alert-1');
- });
- expect(notificationStore.success).toHaveBeenCalledWith('Alert acknowledged');
- });
-
- it('routes bulk acknowledge actions through the shared alert acknowledgement owner', async () => {
- vi.mocked(AlertsAPI.bulkAcknowledge).mockResolvedValue({
- results: [
- { alertIdentifier: 'alert-1', success: true },
- { alertIdentifier: 'alert-2', success: true },
- ],
- } as never);
-
- render(() => (
- <RecentAlertsPanel
- alerts={[makeAlert(), makeAlert({ id: 'alert-2', message: 'Memory high' })]}
- />
- ));
-
- await fireEvent.click(screen.getByText('Ack All'));
-
- await waitFor(() => {
- expect(AlertsAPI.bulkAcknowledge).toHaveBeenCalledWith(['alert-1', 'alert-2']);
- });
- expect(notificationStore.success).toHaveBeenCalledWith('Acknowledged 2 alerts.');
- });
-});
diff --git a/frontend-modern/src/components/Dashboard/__tests__/DashboardPanels.test.tsx b/frontend-modern/src/components/Dashboard/__tests__/DashboardPanels.test.tsx
deleted file mode 100644
index 7c74fd26a7..0000000000
--- a/frontend-modern/src/components/Dashboard/__tests__/DashboardPanels.test.tsx
+++ /dev/null
@@ -1,218 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import type { Alert } from '@/types/api';
-import type { Resource } from '@/types/resource';
-import { computeDashboardOverview } from '@/hooks/useDashboardOverview';
-
-function createResource(overrides: Partial<Resource> = {}): Resource {
- return {
- id: 'resource-1',
- type: 'agent',
- name: 'resource-1',
- displayName: 'Resource 1',
- platformId: 'platform-1',
- platformType: 'agent',
- sourceType: 'agent',
- status: 'online',
- lastSeen: Date.now(),
- ...overrides,
- };
-}
-
-describe('Dashboard panels data contract', () => {
- it('computes infrastructure and workloads summary data for dashboard panels', () => {
- const resources: Resource[] = [
- createResource({
- id: 'infra-1',
- type: 'agent',
- name: 'host-alpha',
- displayName: 'Host Alpha',
- status: 'online',
- cpu: { current: 95 },
- }),
- createResource({
- id: 'infra-2',
- type: 'agent',
- name: 'node-beta',
- displayName: 'Node Beta',
- status: 'offline',
- cpu: { current: 92 },
- }),
- createResource({
- id: 'infra-3',
- type: 'k8s-node',
- name: 'k8s-gamma',
- displayName: 'K8s Gamma',
- status: 'online',
- cpu: { current: 84 },
- }),
- createResource({
- id: 'infra-4',
- type: 'docker-host',
- name: 'docker-delta',
- displayName: 'Docker Delta',
- status: 'online',
- cpu: { current: 78 },
- }),
- createResource({
- id: 'infra-5',
- type: 'agent',
- name: 'truenas-epsilon',
- displayName: 'TrueNAS Epsilon',
- platformType: 'truenas',
- status: 'degraded',
- cpu: { current: 65 },
- }),
- createResource({
- id: 'infra-6',
- type: 'k8s-cluster',
- name: 'cluster-zeta',
- displayName: 'Cluster Zeta',
- status: 'online',
- cpu: { current: 51 },
- }),
- createResource({
- id: 'work-1',
- type: 'vm',
- status: 'running',
- }),
- createResource({
- id: 'work-2',
- type: 'system-container',
- status: 'online',
- }),
- createResource({
- id: 'work-3',
- type: 'app-container',
- status: 'stopped',
- }),
- createResource({
- id: 'work-4',
- type: 'pod',
- status: 'offline',
- }),
- ];
-
- const overview = computeDashboardOverview(resources, []);
-
- expect(overview.infrastructure.total).toBe(6);
- expect(overview.infrastructure.byStatus.online).toBe(4);
- expect(overview.infrastructure.byStatus.offline).toBe(1);
- expect(overview.infrastructure.topCPU).toHaveLength(5);
- expect(overview.infrastructure.topCPU.map((entry) => entry.id)).toEqual([
- 'infra-1',
- 'infra-2',
- 'infra-3',
- 'infra-4',
- 'infra-5',
- ]);
- expect(overview.infrastructure.topCPU.map((entry) => entry.percent)).toEqual([
- 95, 92, 84, 78, 65,
- ]);
-
- expect(overview.workloads.total).toBe(4);
- expect(overview.workloads.running).toBe(2);
- expect(overview.workloads.stopped).toBe(2);
- expect(overview.workloads.byType).toEqual({
- vm: 1,
- 'system-container': 1,
- 'app-container': 1,
- pod: 1,
- });
- });
-
- it('computes storage summary data for dashboard panels', () => {
- const resources: Resource[] = [
- createResource({
- id: 'store-1',
- type: 'storage',
- status: 'online',
- disk: { current: 40, total: 1000, used: 400 },
- }),
- createResource({
- id: 'store-2',
- type: 'datastore',
- status: 'online',
- disk: { current: 85, total: 1000, used: 850 },
- }),
- createResource({
- id: 'store-3',
- type: 'pool',
- status: 'online',
- disk: { current: 90, total: 1000, used: 900 },
- }),
- createResource({
- id: 'store-4',
- type: 'dataset',
- status: 'online',
- disk: { current: 92, total: 1000, used: 920 },
- }),
- createResource({
- id: 'infra-1',
- type: 'agent',
- status: 'online',
- disk: { current: 99, total: 1000, used: 990 },
- }),
- ];
-
- const overview = computeDashboardOverview(resources, []);
-
- expect(overview.storage.total).toBe(4);
- expect(overview.storage.totalCapacity).toBe(4000);
- expect(overview.storage.totalUsed).toBe(3070);
- expect(overview.storage.warningCount).toBe(2);
- expect(overview.storage.criticalCount).toBe(1);
- });
-
- it('computes alerts summary data for dashboard panels', () => {
- const alerts: Alert[] = [
- {
- id: 'a-1',
- type: 'cpu',
- level: 'critical',
- resourceId: 'r1',
- resourceName: 'Host 1',
- node: 'n1',
- instance: 'i1',
- message: 'CPU critical',
- value: 95,
- threshold: 90,
- startTime: '2026-02-01T00:00:00Z',
- acknowledged: false,
- },
- {
- id: 'a-2',
- type: 'memory',
- level: 'warning',
- resourceId: 'r2',
- resourceName: 'Host 2',
- node: 'n2',
- instance: 'i2',
- message: 'Memory high',
- value: 85,
- threshold: 80,
- startTime: '2026-02-01T00:00:00Z',
- acknowledged: false,
- },
- {
- id: 'a-3',
- type: 'disk',
- level: 'critical',
- resourceId: 'r3',
- resourceName: 'Host 3',
- node: 'n3',
- instance: 'i3',
- message: 'Disk full',
- value: 96,
- threshold: 90,
- startTime: '2026-02-01T00:00:00Z',
- acknowledged: false,
- },
- ];
-
- const overview = computeDashboardOverview([], alerts);
-
- expect(overview.alerts.activeCritical).toBe(2);
- expect(overview.alerts.activeWarning).toBe(1);
- expect(overview.alerts.total).toBe(3);
- });
-});
diff --git a/frontend-modern/src/components/Dashboard/dashboardFilterModel.ts b/frontend-modern/src/components/Dashboard/dashboardFilterModel.ts
deleted file mode 100644
index 7421ecfb7f..0000000000
--- a/frontend-modern/src/components/Dashboard/dashboardFilterModel.ts
+++ /dev/null
@@ -1,89 +0,0 @@
-import type { ColumnDef } from '@/hooks/useColumnVisibility';
-import type { ViewMode, WorkloadGuest } from '@/types/workloads';
-import type { JSX } from 'solid-js';
-
-export type DashboardStatusMode = 'all' | 'running' | 'degraded' | 'stopped';
-export type DashboardGroupingMode = 'grouped' | 'flat';
-export type DashboardSortKey = keyof WorkloadGuest | 'diskIo' | 'netIo';
-
-export interface DashboardFilterSelectOption {
- value: string;
- label: string;
-}
-
-export interface DashboardToolbarFilterConfig {
- id?: string;
- label?: string;
- value: string;
- options: DashboardFilterSelectOption[];
- onChange: (value: string) => void;
-}
-
-export interface DashboardFilterProps {
- search: () => string;
- setSearch: (value: string) => void;
- viewMode: () => ViewMode;
- setViewMode: (value: ViewMode) => void;
- statusMode: () => DashboardStatusMode;
- setStatusMode: (value: DashboardStatusMode) => void;
- groupingMode: () => DashboardGroupingMode;
- setGroupingMode: (value: DashboardGroupingMode) => void;
- setSortKey: (value: DashboardSortKey) => void;
- setSortDirection: (value: 'asc' | 'desc') => void;
- onBeforeAutoFocus?: () => boolean;
- columnVisibility?: {
- availableColumns: ColumnDef[];
- isColumnHidden: (id: string) => boolean;
- onColumnToggle: (id: string) => void;
- onColumnReset?: () => void;
- };
- hostFilter?: DashboardToolbarFilterConfig;
- platformFilter?: DashboardToolbarFilterConfig;
- namespaceFilter?: DashboardToolbarFilterConfig;
- containerRuntimeFilter?: DashboardToolbarFilterConfig;
- chartsCollapsed?: () => boolean;
- onChartsToggle?: () => void;
- searchTrailing?: JSX.Element;
- utilityActions?: JSX.Element;
- mobileTrailing?: JSX.Element;
-}
-
-export interface CountActiveDashboardFiltersOptions {
- search: string;
- viewMode: ViewMode;
- statusMode: DashboardStatusMode;
- hostFilterValue?: string;
- platformFilterValue?: string;
- namespaceFilterValue?: string;
-}
-
-export interface HasActiveDashboardFiltersOptions extends CountActiveDashboardFiltersOptions {
- groupingMode: DashboardGroupingMode;
-}
-
-export const DEFAULT_DASHBOARD_SORT_KEY: DashboardSortKey = 'type';
-export const DEFAULT_DASHBOARD_SORT_DIRECTION = 'asc';
-export const DEFAULT_DASHBOARD_VIEW_MODE: ViewMode = 'all';
-export const DEFAULT_DASHBOARD_STATUS_MODE: DashboardStatusMode = 'all';
-export const DEFAULT_DASHBOARD_GROUPING_MODE: DashboardGroupingMode = 'grouped';
-
-export const countActiveDashboardFilters = (
- options: CountActiveDashboardFiltersOptions,
-): number => {
- let count = 0;
-
- if (options.search.trim() !== '') count++;
- if (options.viewMode !== DEFAULT_DASHBOARD_VIEW_MODE) count++;
- if (options.statusMode !== DEFAULT_DASHBOARD_STATUS_MODE) count++;
- if ((options.hostFilterValue ?? '') !== '') count++;
- if ((options.platformFilterValue ?? '') !== '') count++;
- if ((options.namespaceFilterValue ?? '') !== '') count++;
-
- return count;
-};
-
-export const hasActiveDashboardFilters = (
- options: HasActiveDashboardFiltersOptions,
-): boolean =>
- countActiveDashboardFilters(options) > 0 ||
- options.groupingMode !== DEFAULT_DASHBOARD_GROUPING_MODE;
diff --git a/frontend-modern/src/components/Dashboard/diskListModel.ts b/frontend-modern/src/components/Dashboard/diskListModel.ts
deleted file mode 100644
index 6843fe506e..0000000000
--- a/frontend-modern/src/components/Dashboard/diskListModel.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-import type { Disk } from '@/types/api';
-
-import { formatBytes } from '@/utils/format';
-import { getMetricColorClass } from '@/utils/metricThresholds';
-
-export interface DiskListProps {
- disks: Disk[];
- diskStatusReason?: string;
-}
-
-export interface DashboardDiskPresentation {
- key: string;
- label: string;
- labelTitle?: string;
- progressClass: string;
- progressWidth: string;
- typeLabel: string;
- usageText: string;
- usagePercentLabel: string;
-}
-
-export const hasDashboardDiskCapacity = (disk: Disk): boolean =>
- typeof disk.total === 'number' && disk.total > 0;
-
-export const getDashboardDiskUsagePercent = (disk: Disk): number => {
- if (!hasDashboardDiskCapacity(disk)) {
- return 0;
- }
-
- return (disk.used / disk.total) * 100;
-};
-
-export const getDashboardDiskLabel = (disk: Disk): string =>
- disk.mountpoint || disk.device || 'Unknown';
-
-export const getDashboardDiskLabelTitle = (label: string): string | undefined =>
- label !== 'Unknown' ? label : undefined;
-
-export const getDashboardDiskUsageText = (disk: Disk): string =>
- hasDashboardDiskCapacity(disk)
- ? `${formatBytes(disk.used)}/${formatBytes(disk.total)}`
- : 'Usage unavailable';
-
-export const getDashboardDiskUsagePercentLabel = (disk: Disk): string =>
- hasDashboardDiskCapacity(disk) ? `${getDashboardDiskUsagePercent(disk).toFixed(0)}%` : 'β€”';
-
-export const getDashboardDiskProgressClass = (disk: Disk): string =>
- getMetricColorClass(getDashboardDiskUsagePercent(disk), 'disk');
-
-export const getDashboardDiskProgressWidth = (disk: Disk): string =>
- `${Math.min(getDashboardDiskUsagePercent(disk), 100)}%`;
-
-export const getDashboardDiskTypeLabel = (disk: Disk): string => disk.type?.toUpperCase() ?? '';
-
-export const buildDashboardDiskPresentation = (
- disk: Disk,
- index: number,
-): DashboardDiskPresentation => {
- const label = getDashboardDiskLabel(disk);
-
- return {
- key: `${disk.mountpoint ?? ''}:${disk.device ?? ''}:${index}`,
- label,
- labelTitle: getDashboardDiskLabelTitle(label),
- progressClass: getDashboardDiskProgressClass(disk),
- progressWidth: getDashboardDiskProgressWidth(disk),
- typeLabel: getDashboardDiskTypeLabel(disk),
- usageText: getDashboardDiskUsageText(disk),
- usagePercentLabel: getDashboardDiskUsagePercentLabel(disk),
- };
-};
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
index 7c34593abc..adc151c246 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
@@ -21,8 +21,8 @@ import {
} from '@/components/shared/Table';
import { StatusDot } from '@/components/shared/StatusDot';
import { ResponsiveMetricCell } from '@/components/shared/responsive';
-import { StackedDiskBar } from '@/components/Dashboard/StackedDiskBar';
-import { StackedMemoryBar } from '@/components/Dashboard/StackedMemoryBar';
+import { StackedDiskBar } from '@/components/Workloads/StackedDiskBar';
+import { StackedMemoryBar } from '@/components/Workloads/StackedMemoryBar';
import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';
import {
dedupeResourceBadges,
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
index b6cc0e6ff1..c7c91c8d87 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
@@ -144,7 +144,7 @@ describe('ResourceDetailDrawer change history section', () => {
expect(resourceDetailDrawerOverviewSource).not.toContain("'All sources'");
expect(resourceDetailDrawerOverviewSource).not.toContain("'All adapters'");
expect(resourceDetailDrawerOverviewSource).not.toContain(
- "from '@/components/Dashboard/TagBadges'",
+ "from '@/components/Workloads/TagBadges'",
);
expect(resourceDetailDrawerShellSource).toContain("from './ResourceDetailDrawerOverviewTab'");
expect(resourceDetailDrawerShellSource).toContain("from './ResourceDetailDrawerDebugTab'");
diff --git a/frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx b/frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx
deleted file mode 100644
index 4e95ae21a8..0000000000
--- a/frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-import { For, Show, createMemo } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { buildRecoveryPath } from '@/routing/resourceLinks';
-import { formatRelativeTime } from '@/utils/format';
-import {
- RECOVERY_OUTCOMES,
- getRecoveryOutcomeBadgeClass,
-} from '@/utils/recoveryOutcomePresentation';
-import {
- DASHBOARD_RECOVERY_EMPTY_STATE,
- DASHBOARD_RECOVERY_STALE_MESSAGE,
-} from '@/utils/dashboardRecoveryPresentation';
-import type { DashboardRecoverySummary } from '@/hooks/useDashboardRecovery';
-
-interface DashboardRecoveryStatusPanelProps {
- recovery: DashboardRecoverySummary;
-}
-
-export function DashboardRecoveryStatusPanel(props: DashboardRecoveryStatusPanelProps) {
- const latestAgeMs = createMemo(() => {
- const ts = props.recovery.latestEventTimestamp;
- if (typeof ts !== 'number' || !Number.isFinite(ts)) return null;
- return Date.now() - ts;
- });
-
- const isStale = createMemo(() => (latestAgeMs() ?? 0) > 24 * 60 * 60_000);
-
- return (
- <Card padding="none" class="px-4 py-3.5">
- <div class="flex items-center justify-between gap-3">
- <h2 class="text-sm font-semibold text-base-content">Recovery Status</h2>
- <a
- href={buildRecoveryPath()}
- aria-label="View all recovery"
- class="text-xs font-medium text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300"
- >
- View all β†’
- </a>
- </div>
- <Show
- when={props.recovery.hasData}
- fallback={<p class="text-xs text-muted mt-1">{DASHBOARD_RECOVERY_EMPTY_STATE}</p>}
- >
- <div class="space-y-1.5">
- <div class="flex items-baseline justify-between gap-4">
- <p class="text-xs text-muted">
- <span class="font-mono font-semibold text-base text-base-content">
- {props.recovery.totalProtected}
- </span>{' '}
- total
- </p>
- <p class="text-xs text-muted">
- Last:{' '}
- <span class="font-mono font-medium text-base-content">
- {formatRelativeTime(props.recovery.latestEventTimestamp ?? undefined, {
- compact: true,
- }) || 'β€”'}
- </span>
- </p>
- </div>
-
- <Show when={isStale()}>
- <p class="text-sm font-medium text-amber-700 dark:text-amber-300">
- {DASHBOARD_RECOVERY_STALE_MESSAGE}
- </p>
- </Show>
-
- <div class="flex flex-wrap gap-2">
- <For each={RECOVERY_OUTCOMES}>
- {(outcome) => {
- const count = () => props.recovery.byOutcome[outcome] ?? 0;
- return (
- <Show when={count() > 0}>
- <span class={getRecoveryOutcomeBadgeClass(outcome)}>
- <span class="font-mono">{count()}</span>
- <span class="ml-1">{outcome}</span>
- </span>
- </Show>
- );
- }}
- </For>
- </div>
- </div>
- </Show>
- </Card>
- );
-}
-
-export default DashboardRecoveryStatusPanel;
diff --git a/frontend-modern/src/components/Recovery/__tests__/DashboardRecoveryStatusPanel.test.tsx b/frontend-modern/src/components/Recovery/__tests__/DashboardRecoveryStatusPanel.test.tsx
deleted file mode 100644
index dbd67d5a20..0000000000
--- a/frontend-modern/src/components/Recovery/__tests__/DashboardRecoveryStatusPanel.test.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { render, screen } from '@solidjs/testing-library';
-import { describe, expect, it } from 'vitest';
-import { DashboardRecoveryStatusPanel } from '@/components/Recovery/DashboardRecoveryStatusPanel';
-import type { DashboardRecoverySummary } from '@/hooks/useDashboardRecovery';
-
-describe('DashboardRecoveryStatusPanel', () => {
- it('renders the empty state when no recovery data exists', () => {
- const recovery: DashboardRecoverySummary = {
- totalProtected: 0,
- byOutcome: {},
- latestEventTimestamp: null,
- hasData: false,
- };
-
- render(() => <DashboardRecoveryStatusPanel recovery={recovery} />);
-
- expect(screen.getByText('No recovery data available')).toBeInTheDocument();
- });
-
- it('renders summary counts and stale messaging for old recovery activity', () => {
- const recovery: DashboardRecoverySummary = {
- totalProtected: 3,
- byOutcome: { success: 2, failed: 1 },
- latestEventTimestamp: Date.now() - 25 * 60 * 60_000,
- hasData: true,
- };
-
- render(() => <DashboardRecoveryStatusPanel recovery={recovery} />);
-
- expect(screen.getByRole('heading', { name: 'Recovery Status' })).toBeInTheDocument();
- expect(screen.getByText('3')).toBeInTheDocument();
- expect(screen.getByText('2')).toBeInTheDocument();
- expect(screen.getByText('success')).toBeInTheDocument();
- expect(screen.getByText('failed')).toBeInTheDocument();
- expect(screen.getByText('Last recovery point over 24 hours ago')).toBeInTheDocument();
- });
-});
diff --git a/frontend-modern/src/components/Settings/GeneralSettingsPanel.tsx b/frontend-modern/src/components/Settings/GeneralSettingsPanel.tsx
index 93604f6cc8..bd0d4e91d8 100644
--- a/frontend-modern/src/components/Settings/GeneralSettingsPanel.tsx
+++ b/frontend-modern/src/components/Settings/GeneralSettingsPanel.tsx
@@ -182,8 +182,8 @@ export const GeneralSettingsPanel: Component<GeneralSettingsPanelProps> = (props
<div class="text-sm text-muted min-w-0">
<p class="font-medium text-base-content truncate">Navigation guide</p>
<p class="text-xs text-muted line-clamp-2">
- Replay the five-stop walkthrough of Dashboard, Infrastructure, Workloads, Storage,
- and Recovery.
+ Replay the four-stop walkthrough of Infrastructure, Workloads, Storage, and
+ Recovery.
</p>
</div>
</div>
diff --git a/frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx b/frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx
index 3ad5988288..d6a39f7527 100644
--- a/frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx
+++ b/frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx
@@ -613,8 +613,8 @@ export const InfrastructureInstallerSection: Component = () => {
>
{isConnected()
? state.lookupWasAutoDetected()
- ? `${agent().displayName || agent().hostname} started reporting and Pulse detected it automatically. Open the dashboard to verify your first overview, or open Inventory to inspect this host and add more infrastructure.`
- : `${agent().displayName || agent().hostname} is reporting live telemetry to Pulse. Open the dashboard to verify your first overview, or open Inventory to inspect this host and add more infrastructure.`
+ ? `${agent().displayName || agent().hostname} started reporting and Pulse detected it automatically. Open Infrastructure to inspect this host and add more infrastructure.`
+ : `${agent().displayName || agent().hostname} is reporting live telemetry to Pulse. Open Infrastructure to inspect this host and add more infrastructure.`
: `${agent().displayName || agent().hostname} has been found, but Pulse is not receiving a live check-in yet. Keep the installer running on that machine and check again.`}
</p>
</div>
@@ -650,10 +650,10 @@ export const InfrastructureInstallerSection: Component = () => {
<div class="flex flex-col gap-2 sm:flex-row">
<button
type="button"
- onClick={state.openDashboard}
+ onClick={state.openInfrastructure}
class="inline-flex items-center justify-center rounded-md bg-emerald-600 px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-emerald-700"
>
- Open dashboard
+ Open infrastructure
</button>
<button
type="button"
diff --git a/frontend-modern/src/components/Settings/InfrastructureSourceManager.tsx b/frontend-modern/src/components/Settings/InfrastructureSourceManager.tsx
index 1457205d56..612eb42c2c 100644
--- a/frontend-modern/src/components/Settings/InfrastructureSourceManager.tsx
+++ b/frontend-modern/src/components/Settings/InfrastructureSourceManager.tsx
@@ -458,7 +458,7 @@ export const InfrastructureSourceManager: Component<InfrastructureSourceManagerP
<p class="mt-1 text-sm leading-5 text-muted">
This is the source map Pulse uses to understand the estate. Confirm the API inventory,
agent telemetry, scan scope, and any pending discovery candidates before relying on
- dashboards or automation.
+ monitoring views or automation.
</p>
</div>
diff --git a/frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx b/frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx
index d811681c76..696195df8d 100644
--- a/frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx
+++ b/frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx
@@ -47,7 +47,7 @@ export const NetworkBoundarySettingsSection: Component<NetworkBoundarySettingsSe
Public URL
</h4>
<div class="space-y-2">
- <label class="text-sm font-medium text-base-content">Dashboard URL for Notifications</label>
+ <label class="text-sm font-medium text-base-content">Pulse URL for Notifications</label>
<p class="text-xs text-muted">
The URL included in email alerts to link back to Pulse. Required for Docker deployments
with custom ports.
@@ -148,7 +148,7 @@ export const NetworkBoundarySettingsSection: Component<NetworkBoundarySettingsSe
Embedding
</h4>
<p class="text-xs text-muted">
- Allow Pulse to be embedded in iframes (e.g., Homepage dashboard)
+ Allow Pulse to be embedded in iframes (e.g., Homepage)
</p>
<div class="space-y-3">
<div class="flex items-center gap-2">
@@ -183,11 +183,11 @@ export const NetworkBoundarySettingsSection: Component<NetworkBoundarySettingsSe
props.setAllowedEmbedOrigins(e.currentTarget.value);
props.setHasUnsavedChanges(true);
}}
- placeholder="https://my.domain, https://dashboard.example.com"
+ placeholder="https://my.domain, https://pulse.example.com"
class="w-full min-h-10 sm:min-h-10 px-3 py-2.5 text-sm border rounded-md border-border bg-surface"
/>
<p class="text-xs text-muted">
- Example: If Pulse is at <code>pulse.my.domain</code> and your dashboard is at{' '}
+ Example: If Pulse is at <code>pulse.my.domain</code> and your homepage is at{' '}
<code>my.domain</code>, add <code>https://my.domain</code> here.
</p>
</div>
diff --git a/frontend-modern/src/components/Settings/NodeModalBasicInfoSection.tsx b/frontend-modern/src/components/Settings/NodeModalBasicInfoSection.tsx
index 78f11105cc..530b146e26 100644
--- a/frontend-modern/src/components/Settings/NodeModalBasicInfoSection.tsx
+++ b/frontend-modern/src/components/Settings/NodeModalBasicInfoSection.tsx
@@ -34,7 +34,7 @@ export const NodeModalBasicInfoSection: Component<NodeModalBasicInfoSectionProps
type="text"
value={state.formData().name}
onInput={(event) => state.updateField('name', event.currentTarget.value)}
- placeholder="Pulse uses this label across dashboards"
+ placeholder="Pulse uses this label across monitoring views"
required
class={controlClass()}
/>
diff --git a/frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx b/frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx
index 1a4d721a07..597d448c18 100644
--- a/frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx
+++ b/frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx
@@ -75,7 +75,7 @@ export const NodeModalMonitoringSection: Component<NodeModalMonitoringSectionPro
/>
<p class="text-xs text-muted">
Control which Proxmox VE resources Pulse ingests. Disable individual collectors to
- reduce API load or trim dashboard noise.
+ reduce API load or trim workload noise.
</p>
<label class="flex items-start gap-2 text-sm text-base-content">
@@ -216,7 +216,7 @@ export const NodeModalMonitoringSection: Component<NodeModalMonitoringSectionPro
</div>
<Show when={!state.temperatureMonitoringEnabledValue()}>
<p class="mt-3 rounded border border-blue-200 bg-blue-50 p-2 text-xs text-blue-700 dark:border-blue-700 dark:bg-blue-900 dark:text-blue-200">
- Pulse will skip SSH temperature polling for this node. Existing dashboard readings
+ Pulse will skip SSH temperature polling for this node. Existing monitoring readings
will stop refreshing.
</p>
</Show>
diff --git a/frontend-modern/src/components/Settings/RecoverySettingsPanel.tsx b/frontend-modern/src/components/Settings/RecoverySettingsPanel.tsx
index 2790bc295e..c92227126b 100644
--- a/frontend-modern/src/components/Settings/RecoverySettingsPanel.tsx
+++ b/frontend-modern/src/components/Settings/RecoverySettingsPanel.tsx
@@ -64,7 +64,7 @@ export const RecoverySettingsPanel: Component<RecoverySettingsPanelProps> = (pro
<div>
<p class="text-sm font-medium text-base-content">Enable backup polling</p>
<p class="text-xs text-muted">
- Required for dashboard backup status, storage snapshots, and alerting.
+ Required for workload backup status, storage snapshots, and alerting.
</p>
</div>
<label class="relative inline-flex items-center cursor-pointer">
diff --git a/frontend-modern/src/components/Settings/__tests__/APITokenManager.test.tsx b/frontend-modern/src/components/Settings/__tests__/APITokenManager.test.tsx
index bc5ae00667..5a51d51a62 100644
--- a/frontend-modern/src/components/Settings/__tests__/APITokenManager.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/APITokenManager.test.tsx
@@ -347,7 +347,7 @@ describe('APITokenManager', () => {
fireEvent.input(screen.getByPlaceholderText('e.g. Container pipeline'), {
target: { value: 'Blocked token' },
});
- fireEvent.click(screen.getByRole('button', { name: 'Kiosk / Dashboard' }));
+ fireEvent.click(screen.getByRole('button', { name: 'Kiosk / Monitoring' }));
fireEvent.click(screen.getByRole('button', { name: 'Generate' }));
await waitFor(() => {
diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx
index cbc2bbef58..5eb4e77450 100644
--- a/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx
@@ -206,6 +206,19 @@ describe('infrastructure operations model', () => {
);
});
+ it('keeps first-host completion handoff on Infrastructure instead of the retired dashboard', async () => {
+ const installStateSource = await import('../useInfrastructureInstallState.tsx?raw').then(
+ (mod) => (mod as { default: string }).default,
+ );
+
+ expect(infrastructureInstallerSectionSource).toContain('Open infrastructure');
+ expect(infrastructureInstallerSectionSource).not.toContain('Open dashboard');
+ expect(installStateSource).toContain('const openInfrastructure = () => {');
+ expect(installStateSource).toContain('navigate(buildInfrastructureWorkspacePath())');
+ expect(installStateSource).not.toContain('openDashboard');
+ expect(installStateSource).not.toContain("navigate('/dashboard')");
+ });
+
it('does not reintroduce the retired reporting state hook on the operations state', async () => {
const operationsStateSource = await import(
'../useInfrastructureOperationsState?raw'
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index 5f264d1327..71d78fae5b 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -32,6 +32,8 @@ import connectionEditorSource from '../ConnectionEditor/ConnectionEditor.tsx?raw
import addressProbeStepSource from '../ConnectionEditor/AddressProbeStep.tsx?raw';
import connectionEditorStateSource from '../ConnectionEditor/useConnectionEditor.ts?raw';
import nodeCredentialSlotSource from '../ConnectionEditor/CredentialSlots/NodeCredentialSlot.tsx?raw';
+import networkBoundarySettingsSectionSource from '../NetworkBoundarySettingsSection.tsx?raw';
+import nodeModalBasicInfoSectionSource from '../NodeModalBasicInfoSection.tsx?raw';
import nodeModalAuthenticationSectionSource from '../NodeModalAuthenticationSection.tsx?raw';
import nodeModalMonitoringSectionSource from '../NodeModalMonitoringSection.tsx?raw';
import nodeModalSetupGuideSectionSource from '../NodeModalSetupGuideSection.tsx?raw';
@@ -231,6 +233,22 @@ describe('settings architecture guardrails', () => {
}
});
+ it('keeps settings copy aligned with Infrastructure as the default workspace', () => {
+ expect(generalSettingsPanelSource).toContain(
+ 'Replay the four-stop walkthrough of Infrastructure, Workloads, Storage, and',
+ );
+ expect(generalSettingsPanelSource).not.toContain('Dashboard, Infrastructure');
+ expect(networkBoundarySettingsSectionSource).toContain('Pulse URL for Notifications');
+ expect(networkBoundarySettingsSectionSource).not.toContain('Dashboard URL for Notifications');
+ expect(nodeModalBasicInfoSectionSource).toContain('monitoring views');
+ expect(nodeModalBasicInfoSectionSource).not.toContain('dashboards');
+ expect(nodeModalMonitoringSectionSource).toContain('trim workload noise');
+ expect(nodeModalMonitoringSectionSource).toContain('Existing monitoring readings');
+ expect(nodeModalMonitoringSectionSource).not.toContain('dashboard readings');
+ expect(recoverySettingsPanelSource).toContain('Required for workload backup status');
+ expect(recoverySettingsPanelSource).not.toContain('dashboard backup status');
+ });
+
it('keeps system AI model catalogs on the shared searchable picker boundary', () => {
expect(aiModelSelectionSectionSource).toContain(
"import { AIModelPicker } from '@/components/shared/AIModelPicker';",
diff --git a/frontend-modern/src/components/Settings/apiTokenManagerModel.ts b/frontend-modern/src/components/Settings/apiTokenManagerModel.ts
index f3750a1222..e0856eb727 100644
--- a/frontend-modern/src/components/Settings/apiTokenManagerModel.ts
+++ b/frontend-modern/src/components/Settings/apiTokenManagerModel.ts
@@ -40,7 +40,7 @@ const API_TOKEN_SCOPE_GROUP_ORDER: ScopeGroup[] = ['Monitoring', 'Agents', 'Sett
export const getAPITokenScopePresets = (): APITokenPreset[] => [
{
- label: 'Kiosk / Dashboard',
+ label: 'Kiosk / Monitoring',
scopes: [MONITORING_READ_SCOPE],
description:
'Read-only access for wall displays. Use ?token=xxx&kiosk=1 in the URL to hide navigation and filters.',
diff --git a/frontend-modern/src/components/Settings/useInfrastructureInstallState.tsx b/frontend-modern/src/components/Settings/useInfrastructureInstallState.tsx
index 6559a21598..085d55f678 100644
--- a/frontend-modern/src/components/Settings/useInfrastructureInstallState.tsx
+++ b/frontend-modern/src/components/Settings/useInfrastructureInstallState.tsx
@@ -473,8 +473,8 @@ Pulse prepares the first-host install token from setup so you can move straight
}));
});
- const openDashboard = () => {
- navigate('/dashboard');
+ const openInfrastructure = () => {
+ navigate(buildInfrastructureWorkspacePath());
};
const openInfrastructureInventory = () => {
@@ -515,7 +515,7 @@ Pulse prepares the first-host install token from setup so you can move straight
lookupResult,
lookupValue,
lookupWasAutoDetected,
- openDashboard,
+ openInfrastructure,
openInfrastructureInventory,
requiresToken,
selectedAgentUrl,
diff --git a/frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx b/frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx
index 697b6b86e5..bbee09dea5 100644
--- a/frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx
+++ b/frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx
@@ -165,7 +165,7 @@ Keep these credentials secure!
props.onComplete(AGENT_INSTALL_PATH);
};
- const handleGoToDashboard = () => {
+ const handleOpenInfrastructure = () => {
props.onComplete('/');
};
@@ -441,14 +441,14 @@ Keep these credentials secure!
<div class="mt-4 flex flex-col gap-3 sm:flex-row">
<button
onClick={() =>
- completionViewModel().primaryAction === 'dashboard'
- ? handleGoToDashboard()
+ completionViewModel().primaryAction === 'infrastructure'
+ ? handleOpenInfrastructure()
: handleOpenAddInfrastructure()
}
class="inline-flex items-center justify-center gap-2 rounded-md bg-blue-600 px-4 py-3 text-sm font-semibold text-white transition-colors hover:bg-blue-700"
>
- {completionViewModel().primaryAction === 'dashboard'
- ? 'Go to Dashboard'
+ {completionViewModel().primaryAction === 'infrastructure'
+ ? 'Open Infrastructure'
: 'Add infrastructure'}
</button>
<Show when={completionViewModel().showAddInfrastructureAction}>
diff --git a/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.guardrails.test.ts b/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.guardrails.test.ts
index eab1f0e3df..31f1e21602 100644
--- a/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.guardrails.test.ts
+++ b/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.guardrails.test.ts
@@ -100,13 +100,13 @@ describe('SetupCompletionPanel guardrails', () => {
);
expect(setupCompletionPanelSource).toContain('Recommended next step');
expect(setupCompletionPanelSource).toContain('aria-label="Setup next step"');
- expect(setupCompletionPanelSource).toContain('Go to Dashboard');
+ expect(setupCompletionPanelSource).toContain('Open Infrastructure');
expect(setupCompletionModelSource).toContain("heroTitle: 'First monitored system connected'");
expect(setupCompletionModelSource).toContain(
"heroTitle: 'Choose your first infrastructure source'",
);
expect(setupCompletionPanelSource).toContain(
- "completionViewModel().primaryAction === 'dashboard'",
+ "completionViewModel().primaryAction === 'infrastructure'",
);
expect(setupCompletionPanelSource).toContain(
'completionViewModel().showAddInfrastructureAction',
diff --git a/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.test.tsx b/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.test.tsx
index 60960a5cee..1a46dee7d9 100644
--- a/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.test.tsx
+++ b/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.test.tsx
@@ -176,7 +176,7 @@ describe('SetupCompletionPanel', () => {
expect(screen.queryByText('password')).not.toBeInTheDocument();
});
- it('still shows connected systems from polled resources and allows dashboard handoff', async () => {
+ it('still shows connected systems from polled resources and allows Infrastructure handoff', async () => {
const onComplete = vi.fn();
apiFetchJSONMock.mockResolvedValue({
resources: [
@@ -199,18 +199,18 @@ describe('SetupCompletionPanel', () => {
expect(screen.getByText('First monitored system connected')).toBeInTheDocument();
expect(
screen.getByText(
- 'Your admin account is ready and Pulse is already receiving telemetry. Open the dashboard to verify the first overview, then return to Add infrastructure when you want another Pulse Agent or platform API source.',
+ 'Your admin account is ready and Pulse is already receiving telemetry. Open Infrastructure to inspect the first system, then return to Add infrastructure when you want another Pulse Agent or platform API source.',
),
).toBeInTheDocument();
expect(
- screen.getByText('Open the dashboard to review your first connected system.'),
+ screen.getByText('Open Infrastructure to review your first connected system.'),
).toBeInTheDocument();
expect(
screen.getByText(
'Add infrastructure stays available for more Pulse Agent systems or platform API inventory when a platform manages the estate.',
),
).toBeInTheDocument();
- expect(screen.getAllByRole('button', { name: 'Go to Dashboard' }).length).toBeGreaterThan(0);
+ expect(screen.getAllByRole('button', { name: 'Open Infrastructure' }).length).toBeGreaterThan(0);
expect(screen.getAllByRole('button', { name: 'Add infrastructure' }).length).toBeGreaterThan(0);
expect(screen.queryByRole('button', { name: 'Install Pulse Agent' })).not.toBeInTheDocument();
expect(trackAgentFirstConnectedMock).toHaveBeenCalledWith(
@@ -218,12 +218,12 @@ describe('SetupCompletionPanel', () => {
'first_agent',
);
- const nextStepHeading = screen.getByRole('heading', { name: 'Open your first dashboard view' });
+ const nextStepHeading = screen.getByRole('heading', { name: 'Open Infrastructure' });
const nextStepCard = nextStepHeading.closest('[aria-label="Setup next step"]');
expect(nextStepCard).not.toBeNull();
fireEvent.click(
- within(nextStepCard as HTMLElement).getByRole('button', { name: 'Go to Dashboard' }),
+ within(nextStepCard as HTMLElement).getByRole('button', { name: 'Open Infrastructure' }),
);
expect(onComplete).toHaveBeenCalledWith('/');
});
@@ -260,7 +260,7 @@ describe('SetupCompletionPanel', () => {
expect(screen.getByText('First monitored system connected')).toBeInTheDocument();
expect(
screen.getByText(
- 'Your admin account is ready and Pulse is already receiving telemetry. Open the dashboard to verify the first overview, then return to Add infrastructure when you want another platform API or Pulse Agent source.',
+ 'Your admin account is ready and Pulse is already receiving telemetry. Open Infrastructure to inspect the first system, then return to Add infrastructure when you want another platform API or Pulse Agent source.',
),
).toBeInTheDocument();
expect(
@@ -268,12 +268,12 @@ describe('SetupCompletionPanel', () => {
'Add infrastructure stays available for more API-backed systems or Pulse Agent telemetry when a system needs node-local coverage.',
),
).toBeInTheDocument();
- expect(screen.getByRole('button', { name: 'Go to Dashboard' })).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: 'Open Infrastructure' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Add infrastructure' })).toBeInTheDocument();
expect(screen.queryByRole('button', { name: 'Install Pulse Agent' })).not.toBeInTheDocument();
expect(trackAgentFirstConnectedMock).not.toHaveBeenCalled();
- const nextStepHeading = screen.getByRole('heading', { name: 'Open your first dashboard view' });
+ const nextStepHeading = screen.getByRole('heading', { name: 'Open Infrastructure' });
const nextStepCard = nextStepHeading.closest('[aria-label="Setup next step"]');
expect(nextStepCard).not.toBeNull();
@@ -316,7 +316,7 @@ describe('SetupCompletionPanel', () => {
expect(screen.getByText('VMware vSphere')).toBeInTheDocument();
expect(
screen.getByText(
- 'Your admin account is ready and Pulse is already receiving telemetry. Open the dashboard to verify the first overview, then return to Add infrastructure when you want another platform API or Pulse Agent source.',
+ 'Your admin account is ready and Pulse is already receiving telemetry. Open Infrastructure to inspect the first system, then return to Add infrastructure when you want another platform API or Pulse Agent source.',
),
).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Add infrastructure' })).toBeInTheDocument();
@@ -365,7 +365,7 @@ describe('SetupCompletionPanel', () => {
expect(
screen.getByText(
- 'Your admin account is ready and Pulse is already receiving telemetry. Open the dashboard to verify the first overview, then return to Add infrastructure when you want another platform API or Agent source.',
+ 'Your admin account is ready and Pulse is already receiving telemetry. Open Infrastructure to inspect the first system, then return to Add infrastructure when you want another platform API or Agent source.',
),
).toBeInTheDocument();
expect(
diff --git a/frontend-modern/src/components/SetupWizard/setupCompletionModel.ts b/frontend-modern/src/components/SetupWizard/setupCompletionModel.ts
index e97bad283b..ee05ee3051 100644
--- a/frontend-modern/src/components/SetupWizard/setupCompletionModel.ts
+++ b/frontend-modern/src/components/SetupWizard/setupCompletionModel.ts
@@ -15,7 +15,7 @@ import {
} from '@/utils/resourceIdentity';
export type SetupCompletionConnectionPath = 'agent' | 'api';
-export type SetupCompletionPrimaryAction = 'dashboard' | 'sources';
+export type SetupCompletionPrimaryAction = 'infrastructure' | 'sources';
export interface ConnectedSetupSystem {
id: string;
@@ -149,7 +149,7 @@ const buildConnectedHeroDescription = (
hasApiConnectedSystems: boolean,
): string => {
const prefix =
- 'Your admin account is ready and Pulse is already receiving telemetry. Open the dashboard to verify the first overview';
+ 'Your admin account is ready and Pulse is already receiving telemetry. Open Infrastructure to inspect the first system';
if (hasAgentConnectedSystems && hasApiConnectedSystems) {
return `${prefix}, then return to Add infrastructure when you want another platform API or Agent source.`;
@@ -164,7 +164,7 @@ const buildCredentialsContinuationText = (
_hasAgentConnectedSystems: boolean,
_hasApiConnectedSystems: boolean,
): string => {
- return 'the dashboard or Add infrastructure.';
+ return 'Infrastructure or Add infrastructure.';
};
const buildConnectedNextStepDetail = (
@@ -192,8 +192,8 @@ export function buildSetupCompletionViewModel(
const connectedSystemNoun = connectedSystems.length === 1 ? 'system' : 'systems';
const nextStepSummary =
connectedSystems.length === 1
- ? 'Open the dashboard to review your first connected system.'
- : 'Open the dashboard to review your connected systems.';
+ ? 'Open Infrastructure to review your first connected system.'
+ : 'Open Infrastructure to review your connected systems.';
if (!hasConnectedSystems) {
return {
@@ -231,8 +231,8 @@ export function buildSetupCompletionViewModel(
heroTitle: 'First monitored system connected',
nextStepDetail: buildConnectedNextStepDetail(hasAgentConnectedSystems, hasApiConnectedSystems),
nextStepSummary,
- nextStepTitle: 'Open your first dashboard view',
- primaryAction: 'dashboard',
+ nextStepTitle: 'Open Infrastructure',
+ primaryAction: 'infrastructure',
showAddInfrastructureAction: hasConnectedSystems,
showAgentInstallAction: false,
};
diff --git a/frontend-modern/src/components/SetupWizard/steps/SecurityStep.tsx b/frontend-modern/src/components/SetupWizard/steps/SecurityStep.tsx
index 32e0989346..65865b8e3c 100644
--- a/frontend-modern/src/components/SetupWizard/steps/SecurityStep.tsx
+++ b/frontend-modern/src/components/SetupWizard/steps/SecurityStep.tsx
@@ -117,7 +117,7 @@ export const SecurityStep: Component<SecurityStepProps> = (props) => {
<div class="max-w-lg mx-auto bg-surface border border-border overflow-hidden animate-fade-in relative rounded-md">
{' '}
<div class="p-8 border-b border-border relative z-10 text-center">
- <h2 class="text-3xl font-bold tracking-tight text-base-content">Secure Your Dashboard</h2>
+ <h2 class="text-3xl font-bold tracking-tight text-base-content">Secure Pulse</h2>
<p class="text-slate-500 dark:text-blue-200 mt-2 font-light">
Create your root administrator account, then choose the first infrastructure source.
</p>
diff --git a/frontend-modern/src/components/Storage/DashboardStoragePanel.tsx b/frontend-modern/src/components/Storage/DashboardStoragePanel.tsx
deleted file mode 100644
index 05e98dd222..0000000000
--- a/frontend-modern/src/components/Storage/DashboardStoragePanel.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-import { Match, Switch } from 'solid-js';
-import { ProgressBar } from '@/components/shared/ProgressBar';
-import { Card } from '@/components/shared/Card';
-import { buildStoragePath } from '@/routing/resourceLinks';
-import {
- formatDashboardDelta,
- formatDashboardPercent,
- getDashboardDeltaColorClass,
-} from '@/utils/dashboardMetricPresentation';
-import { formatBytes } from '@/utils/format';
-import type { DashboardOverview } from '@/hooks/useDashboardOverview';
-import type { TrendData } from '@/hooks/useDashboardTrends';
-import {
- computeDashboardStorageCapacityPercent,
- DASHBOARD_STORAGE_EMPTY_STATE,
- getDashboardStorageCapacityBarClass,
- getDashboardStorageIssueBadges,
-} from '@/utils/dashboardStoragePresentation';
-
-interface DashboardStoragePanelProps {
- storage: DashboardOverview['storage'];
- storageTrend: TrendData | null;
- loading: boolean;
-}
-
-export function DashboardStoragePanel(props: DashboardStoragePanelProps) {
- const capacityPercent = () =>
- computeDashboardStorageCapacityPercent(props.storage.totalUsed, props.storage.totalCapacity);
- const hasTrend = () => !!props.storageTrend && props.storageTrend.points.length >= 2;
-
- return (
- <Card padding="none" class="px-4 py-3.5" aria-busy={props.loading}>
- <div class="flex items-center justify-between gap-3">
- <h2 class="text-sm font-semibold text-base-content">
- Storage <span class="font-normal text-xs text-muted">({props.storage.total} pools)</span>
- </h2>
- <a
- href={buildStoragePath()}
- aria-label="View all storage"
- class="text-xs font-medium text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300"
- >
- View all β†’
- </a>
- </div>
-
- <Switch>
- <Match when={props.storage.total === 0}>
- <p class="text-xs text-muted mt-1">{DASHBOARD_STORAGE_EMPTY_STATE}</p>
- </Match>
- <Match when={props.storage.total > 0}>
- <div class="mt-1.5 space-y-1.5">
- <div class="flex items-center justify-between gap-3">
- <p class="text-xs text-muted">
- {formatBytes(props.storage.totalUsed)} / {formatBytes(props.storage.totalCapacity)}
- </p>
- <span class="text-xs font-mono font-semibold text-base-content">
- {formatDashboardPercent(capacityPercent())}
- </span>
- </div>
-
- <ProgressBar
- value={capacityPercent()}
- class="h-2"
- fillClass={getDashboardStorageCapacityBarClass(capacityPercent())}
- />
-
- <div class="flex flex-wrap items-center gap-3 text-xs">
- {getDashboardStorageIssueBadges(props.storage).map((badge) => (
- <span class={badge.className}>{badge.label}</span>
- ))}
- {hasTrend() && (
- <span
- class={`font-mono font-medium ${getDashboardDeltaColorClass(props.storageTrend?.delta ?? null)}`}
- >
- 24h: {formatDashboardDelta(props.storageTrend?.delta ?? null) ?? 'β€”'}
- </span>
- )}
- </div>
- </div>
- </Match>
- </Switch>
- </Card>
- );
-}
-
-export default DashboardStoragePanel;
diff --git a/frontend-modern/src/components/Storage/__tests__/DashboardStoragePanel.test.tsx b/frontend-modern/src/components/Storage/__tests__/DashboardStoragePanel.test.tsx
deleted file mode 100644
index d8418a4a42..0000000000
--- a/frontend-modern/src/components/Storage/__tests__/DashboardStoragePanel.test.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-import { render, screen } from '@solidjs/testing-library';
-import { describe, expect, it } from 'vitest';
-import { DashboardStoragePanel } from '@/components/Storage/DashboardStoragePanel';
-import type { DashboardOverview } from '@/hooks/useDashboardOverview';
-import type { TrendData } from '@/hooks/useDashboardTrends';
-
-describe('DashboardStoragePanel', () => {
- it('renders the empty state when no storage resources exist', () => {
- const storage: DashboardOverview['storage'] = {
- total: 0,
- totalCapacity: 0,
- totalUsed: 0,
- warningCount: 0,
- criticalCount: 0,
- };
-
- render(() => <DashboardStoragePanel storage={storage} storageTrend={null} loading={false} />);
-
- expect(screen.getByText('No storage resources')).toBeInTheDocument();
- });
-
- it('renders storage usage, issue badges, and the 24h delta', () => {
- const storage: DashboardOverview['storage'] = {
- total: 2,
- totalCapacity: 4000,
- totalUsed: 2000,
- warningCount: 1,
- criticalCount: 1,
- };
- const storageTrend: TrendData = {
- points: [
- { timestamp: 1, value: 40 },
- { timestamp: 2, value: 50 },
- ],
- delta: 10,
- currentValue: 50,
- };
-
- render(() => (
- <DashboardStoragePanel storage={storage} storageTrend={storageTrend} loading={false} />
- ));
-
- expect(screen.getByRole('heading', { name: /Storage/i })).toBeInTheDocument();
- expect(screen.getByText('50%')).toBeInTheDocument();
- expect(screen.getByText('1 warnings')).toBeInTheDocument();
- expect(screen.getByText('1 critical')).toBeInTheDocument();
- expect(screen.getByText('24h: +10.0%')).toBeInTheDocument();
- });
-
- it('renders the capacity bar through the shared progress primitive without inline styles', () => {
- const storage: DashboardOverview['storage'] = {
- total: 1,
- totalCapacity: 4000,
- totalUsed: 1540,
- warningCount: 0,
- criticalCount: 0,
- };
-
- const result = render(() => (
- <DashboardStoragePanel storage={storage} storageTrend={null} loading={false} />
- ));
-
- const fill = result.container.querySelector('[data-progress-fill="true"]');
- expect(fill).toHaveAttribute('width', '38.5');
- expect(result.container.querySelector('[style]')).toBeNull();
- });
-});
diff --git a/frontend-modern/src/components/Dashboard/DiskList.tsx b/frontend-modern/src/components/Workloads/DiskList.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/DiskList.tsx
rename to frontend-modern/src/components/Workloads/DiskList.tsx
diff --git a/frontend-modern/src/components/Dashboard/EnhancedCPUBar.tsx b/frontend-modern/src/components/Workloads/EnhancedCPUBar.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/EnhancedCPUBar.tsx
rename to frontend-modern/src/components/Workloads/EnhancedCPUBar.tsx
diff --git a/frontend-modern/src/components/Dashboard/GuestDrawer.test.tsx b/frontend-modern/src/components/Workloads/GuestDrawer.test.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/GuestDrawer.test.tsx
rename to frontend-modern/src/components/Workloads/GuestDrawer.test.tsx
diff --git a/frontend-modern/src/components/Dashboard/GuestDrawer.tsx b/frontend-modern/src/components/Workloads/GuestDrawer.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/GuestDrawer.tsx
rename to frontend-modern/src/components/Workloads/GuestDrawer.tsx
diff --git a/frontend-modern/src/components/Dashboard/GuestDrawerOverview.tsx b/frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/GuestDrawerOverview.tsx
rename to frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx
diff --git a/frontend-modern/src/components/Dashboard/GuestRow.tsx b/frontend-modern/src/components/Workloads/GuestRow.tsx
similarity index 99%
rename from frontend-modern/src/components/Dashboard/GuestRow.tsx
rename to frontend-modern/src/components/Workloads/GuestRow.tsx
index d38fbd6485..ad207a9bcd 100644
--- a/frontend-modern/src/components/Dashboard/GuestRow.tsx
+++ b/frontend-modern/src/components/Workloads/GuestRow.tsx
@@ -16,14 +16,14 @@ import {
import { StatusDot } from '@/components/shared/StatusDot';
import { TagBadges } from '@/components/shared/TagBadges';
import { resolveWorkloadType } from '@/utils/workloads';
-import { EnhancedCPUBar } from '@/components/Dashboard/EnhancedCPUBar';
+import { EnhancedCPUBar } from '@/components/Workloads/EnhancedCPUBar';
import { UpdateButton } from '@/components/shared/ContainerUpdateBadge';
import {
buildSummaryDisclosureControlsId,
createSummaryInteractiveRowPreviewHandlers,
} from '@/components/shared/summaryInteractionA11y';
import { SummaryRowActionButton } from '@/components/shared/SummaryRowActionButton';
-import { getDashboardGuestDiskStatusMessage } from '@/utils/dashboardGuestPresentation';
+import { getWorkloadGuestDiskStatusMessage } from '@/utils/workloadGuestPresentation';
import type { GuestRowProps } from './guestRowModel';
import { useGuestRowState } from './useGuestRowState';
@@ -95,7 +95,7 @@ export function GuestRow(props: GuestRowProps) {
if (!isVM(props.guest)) return 'Disk stats unavailable';
const vm = props.guest as VM;
- return getDashboardGuestDiskStatusMessage(vm.diskStatusReason);
+ return getWorkloadGuestDiskStatusMessage(vm.diskStatusReason);
};
const interactiveRowHandlers =
props.onClick || props.onHoverChange
diff --git a/frontend-modern/src/components/Dashboard/GuestRowCells.tsx b/frontend-modern/src/components/Workloads/GuestRowCells.tsx
similarity index 96%
rename from frontend-modern/src/components/Dashboard/GuestRowCells.tsx
rename to frontend-modern/src/components/Workloads/GuestRowCells.tsx
index 41b9d6d1e9..0b52bc78c9 100644
--- a/frontend-modern/src/components/Dashboard/GuestRowCells.tsx
+++ b/frontend-modern/src/components/Workloads/GuestRowCells.tsx
@@ -6,10 +6,10 @@ import { useAlertsActivation } from '@/stores/alertsActivation';
import type { GuestNetworkInterface } from '@/types/api';
import { formatBytes, getBackupInfo } from '@/utils/format';
import {
- getDashboardGuestBackupStatusPresentation,
- getDashboardGuestBackupTooltip,
- getDashboardGuestNetworkEmptyState,
-} from '@/utils/dashboardGuestPresentation';
+ getWorkloadsGuestBackupStatusPresentation,
+ getWorkloadsGuestBackupTooltip,
+ getWorkloadsGuestNetworkEmptyState,
+} from '@/utils/workloadGuestPresentation';
function BackupIndicator(props: {
lastBackup: string | number | null | undefined;
@@ -21,7 +21,7 @@ function BackupIndicator(props: {
const backupInfo = createMemo(() =>
getBackupInfo(props.lastBackup, alertsActivation.getBackupThresholds()),
);
- const config = createMemo(() => getDashboardGuestBackupStatusPresentation(backupInfo().status));
+ const config = createMemo(() => getWorkloadsGuestBackupStatusPresentation(backupInfo().status));
const shouldShow = createMemo(() => {
const status = backupInfo().status;
@@ -30,7 +30,7 @@ function BackupIndicator(props: {
const tooltipText = createMemo(() => {
const info = backupInfo();
- return getDashboardGuestBackupTooltip(info.status, info.ageFormatted);
+ return getWorkloadsGuestBackupTooltip(info.status, info.ageFormatted);
});
return (
@@ -139,7 +139,7 @@ function NetworkInfoCell(props: {
</Show>
<Show when={!iface.addresses || iface.addresses.length === 0}>
<span class="text-slate-500 text-[9px]">
- {getDashboardGuestNetworkEmptyState()}
+ {getWorkloadsGuestNetworkEmptyState()}
</span>
</Show>
<Show when={(iface.rxBytes || 0) > 0 || (iface.txBytes || 0) > 0}>
@@ -275,7 +275,7 @@ function BackupStatusCell(props: { lastBackup: string | number | null | undefine
const info = createMemo(() =>
getBackupInfo(props.lastBackup, alertsActivation.getBackupThresholds()),
);
- const config = createMemo(() => getDashboardGuestBackupStatusPresentation(info().status));
+ const config = createMemo(() => getWorkloadsGuestBackupStatusPresentation(info().status));
return (
<>
diff --git a/frontend-modern/src/components/Dashboard/MetricBar.test.tsx b/frontend-modern/src/components/Workloads/MetricBar.test.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/MetricBar.test.tsx
rename to frontend-modern/src/components/Workloads/MetricBar.test.tsx
diff --git a/frontend-modern/src/components/Dashboard/MetricBar.tsx b/frontend-modern/src/components/Workloads/MetricBar.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/MetricBar.tsx
rename to frontend-modern/src/components/Workloads/MetricBar.tsx
diff --git a/frontend-modern/src/components/Dashboard/StackedDiskBar.tsx b/frontend-modern/src/components/Workloads/StackedDiskBar.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/StackedDiskBar.tsx
rename to frontend-modern/src/components/Workloads/StackedDiskBar.tsx
diff --git a/frontend-modern/src/components/Dashboard/StackedMemoryBar.test.tsx b/frontend-modern/src/components/Workloads/StackedMemoryBar.test.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/StackedMemoryBar.test.tsx
rename to frontend-modern/src/components/Workloads/StackedMemoryBar.test.tsx
diff --git a/frontend-modern/src/components/Dashboard/StackedMemoryBar.tsx b/frontend-modern/src/components/Workloads/StackedMemoryBar.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/StackedMemoryBar.tsx
rename to frontend-modern/src/components/Workloads/StackedMemoryBar.tsx
diff --git a/frontend-modern/src/components/Dashboard/ThresholdSlider.test.tsx b/frontend-modern/src/components/Workloads/ThresholdSlider.test.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/ThresholdSlider.test.tsx
rename to frontend-modern/src/components/Workloads/ThresholdSlider.test.tsx
diff --git a/frontend-modern/src/components/Dashboard/ThresholdSlider.tsx b/frontend-modern/src/components/Workloads/ThresholdSlider.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/ThresholdSlider.tsx
rename to frontend-modern/src/components/Workloads/ThresholdSlider.tsx
diff --git a/frontend-modern/src/components/Dashboard/WorkloadPanel.tsx b/frontend-modern/src/components/Workloads/WorkloadPanel.tsx
similarity index 99%
rename from frontend-modern/src/components/Dashboard/WorkloadPanel.tsx
rename to frontend-modern/src/components/Workloads/WorkloadPanel.tsx
index 4eb1fb4a98..30140635e8 100644
--- a/frontend-modern/src/components/Dashboard/WorkloadPanel.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadPanel.tsx
@@ -21,10 +21,10 @@ import {
import { GuestDrawer } from './GuestDrawer';
import { GuestRow } from './GuestRow';
import { buildWorkloadSummaryGroupScope } from './workloadSelectors';
-import type { DashboardState } from './useDashboardState';
+import type { WorkloadsState } from './useWorkloadsState';
type WorkloadPanelProps = Pick<
- DashboardState,
+ WorkloadsState,
| 'activeAlerts'
| 'alertsEnabled'
| 'bottomSpacerHeight'
diff --git a/frontend-modern/src/components/Dashboard/WorkloadTableHeader.tsx b/frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx
similarity index 96%
rename from frontend-modern/src/components/Dashboard/WorkloadTableHeader.tsx
rename to frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx
index a9d7d91624..9bbc8f6113 100644
--- a/frontend-modern/src/components/Dashboard/WorkloadTableHeader.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx
@@ -3,10 +3,10 @@ import { For } from 'solid-js';
import { TableHead, TableHeader, TableRow } from '@/components/shared/Table';
import { getGuestColumnStyle } from './guestRowModel';
-import type { DashboardState, WorkloadSortKey } from './useDashboardState';
+import type { WorkloadsState, WorkloadSortKey } from './useWorkloadsState';
type WorkloadTableHeaderProps = Pick<
- DashboardState,
+ WorkloadsState,
| 'handleSort'
| 'isMobile'
| 'sortDirection'
diff --git a/frontend-modern/src/components/Dashboard/DashboardFilter.tsx b/frontend-modern/src/components/Workloads/WorkloadsFilter.tsx
similarity index 88%
rename from frontend-modern/src/components/Dashboard/DashboardFilter.tsx
rename to frontend-modern/src/components/Workloads/WorkloadsFilter.tsx
index 701fe2a941..f5f57f9228 100644
--- a/frontend-modern/src/components/Dashboard/DashboardFilter.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadsFilter.tsx
@@ -5,11 +5,11 @@ import { GroupedTableModeSegmentedControl } from '@/components/shared/GroupedTab
import { PageControls } from '@/components/shared/PageControls';
import { SearchInput } from '@/components/shared/SearchInput';
import { STORAGE_KEYS } from '@/utils/localStorage';
-import type { DashboardFilterProps } from './dashboardFilterModel';
-import { DASHBOARD_WORKLOAD_TYPE_OPTIONS } from './dashboardWorkloadFilterConfigModel';
-import { useDashboardFilterState } from './useDashboardFilterState';
+import type { WorkloadsFilterProps } from './workloadsFilterModel';
+import { WORKLOAD_TYPE_OPTIONS } from './workloadFilterConfigModel';
+import { useWorkloadsFilterState } from './useWorkloadsFilterState';
-export const DashboardFilter: Component<DashboardFilterProps> = (props) => {
+export const WorkloadsFilter: Component<WorkloadsFilterProps> = (props) => {
const {
activeFilterCount,
isMobile,
@@ -18,10 +18,10 @@ export const DashboardFilter: Component<DashboardFilterProps> = (props) => {
showReset,
showToolbarFilters,
toggleFilters,
- } = useDashboardFilterState(props);
+ } = useWorkloadsFilterState(props);
return (
- <Card class="dashboard-filter mb-4" padding="sm">
+ <Card class="workloads-filter mb-4" padding="sm">
<PageControls
search={
<SearchInput
@@ -31,7 +31,7 @@ export const DashboardFilter: Component<DashboardFilterProps> = (props) => {
class="w-full"
onBeforeAutoFocus={props.onBeforeAutoFocus}
typeToSearch
- history={{ storageKey: STORAGE_KEYS.DASHBOARD_SEARCH_HISTORY }}
+ history={{ storageKey: STORAGE_KEYS.WORKLOADS_SEARCH_HISTORY }}
/>
}
searchTrailing={props.searchTrailing}
@@ -68,7 +68,7 @@ export const DashboardFilter: Component<DashboardFilterProps> = (props) => {
<Show when={props.hostFilter}>
{(hostFilter) => (
<LabeledFilterSelect
- id={hostFilter().id ?? 'dashboard-host-filter'}
+ id={hostFilter().id ?? 'workloads-host-filter'}
label={hostFilter().label ?? 'Agent'}
value={hostFilter().value}
onChange={(e) => hostFilter().onChange(e.currentTarget.value)}
@@ -84,7 +84,7 @@ export const DashboardFilter: Component<DashboardFilterProps> = (props) => {
<Show when={props.platformFilter}>
{(platformFilter) => (
<LabeledFilterSelect
- id={platformFilter().id ?? 'dashboard-platform-filter'}
+ id={platformFilter().id ?? 'workloads-platform-filter'}
label={platformFilter().label ?? 'Platform'}
value={platformFilter().value}
onChange={(e) => platformFilter().onChange(e.currentTarget.value)}
@@ -100,7 +100,7 @@ export const DashboardFilter: Component<DashboardFilterProps> = (props) => {
<Show when={props.namespaceFilter}>
{(namespaceFilter) => (
<LabeledFilterSelect
- id={namespaceFilter().id ?? 'dashboard-namespace-filter'}
+ id={namespaceFilter().id ?? 'workloads-namespace-filter'}
label={namespaceFilter().label ?? 'Namespace'}
value={namespaceFilter().value}
onChange={(e) => namespaceFilter().onChange(e.currentTarget.value)}
@@ -118,7 +118,7 @@ export const DashboardFilter: Component<DashboardFilterProps> = (props) => {
>
{(runtimeFilter) => (
<LabeledFilterSelect
- id={runtimeFilter().id ?? 'dashboard-runtime-filter'}
+ id={runtimeFilter().id ?? 'workloads-runtime-filter'}
label={runtimeFilter().label ?? 'Runtime'}
value={runtimeFilter().value}
onChange={(e) => runtimeFilter().onChange(e.currentTarget.value)}
@@ -132,7 +132,7 @@ export const DashboardFilter: Component<DashboardFilterProps> = (props) => {
</Show>
<LabeledFilterSelect
- id="dashboard-type-filter"
+ id="workloads-type-filter"
label="Type"
value={props.viewMode()}
onChange={(event) =>
@@ -147,13 +147,13 @@ export const DashboardFilter: Component<DashboardFilterProps> = (props) => {
}
selectClass="min-w-[7rem]"
>
- <For each={DASHBOARD_WORKLOAD_TYPE_OPTIONS}>
+ <For each={WORKLOAD_TYPE_OPTIONS}>
{(option) => <option value={option.value}>{option.label}</option>}
</For>
</LabeledFilterSelect>
<LabeledFilterSelect
- id="dashboard-status-filter"
+ id="workloads-status-filter"
label="Status"
value={props.statusMode()}
onChange={(event) =>
diff --git a/frontend-modern/src/components/Dashboard/DashboardStateCards.tsx b/frontend-modern/src/components/Workloads/WorkloadsStateCards.tsx
similarity index 81%
rename from frontend-modern/src/components/Dashboard/DashboardStateCards.tsx
rename to frontend-modern/src/components/Workloads/WorkloadsStateCards.tsx
index 71e4e2d2d2..f206831146 100644
--- a/frontend-modern/src/components/Dashboard/DashboardStateCards.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadsStateCards.tsx
@@ -4,16 +4,16 @@ import { buildInfrastructureOnboardingPath } from '@/components/Settings/infrast
import { Card } from '@/components/shared/Card';
import { EmptyState } from '@/components/shared/EmptyState';
-import type { DashboardState } from './useDashboardState';
+import type { WorkloadsState } from './useWorkloadsState';
-type DashboardStateCardsProps = Pick<
- DashboardState,
+type WorkloadsStateCardsProps = Pick<
+ WorkloadsState,
| 'allGuests'
| 'connected'
- | 'dashboardDisconnectedState'
- | 'dashboardGuestsEmptyState'
- | 'dashboardInfrastructureEmptyState'
- | 'dashboardLoadingState'
+ | 'workloadsDisconnectedState'
+ | 'workloadsGuestsEmptyState'
+ | 'workloadsInfrastructureEmptyState'
+ | 'workloadsLoadingState'
| 'filteredGuests'
| 'initialDataReceived'
| 'kioskMode'
@@ -24,7 +24,7 @@ type DashboardStateCardsProps = Pick<
nodeCount: number;
};
-export function DashboardStateCards(props: DashboardStateCardsProps) {
+export function WorkloadsStateCards(props: WorkloadsStateCardsProps) {
return (
<>
<Show when={props.connected() && !props.initialDataReceived()}>
@@ -51,8 +51,8 @@ export function DashboardStateCards(props: DashboardStateCardsProps) {
/>
</svg>
}
- title={props.dashboardLoadingState().title}
- description={props.dashboardLoadingState().description}
+ title={props.workloadsLoadingState().title}
+ description={props.workloadsLoadingState().description}
/>
</Card>
</Show>
@@ -83,8 +83,8 @@ export function DashboardStateCards(props: DashboardStateCardsProps) {
/>
</svg>
}
- title={props.dashboardInfrastructureEmptyState().title}
- description={props.dashboardInfrastructureEmptyState().description}
+ title={props.workloadsInfrastructureEmptyState().title}
+ description={props.workloadsInfrastructureEmptyState().description}
actions={
!props.kioskMode() ? (
<button
@@ -92,7 +92,7 @@ export function DashboardStateCards(props: DashboardStateCardsProps) {
onClick={() => props.navigate(buildInfrastructureOnboardingPath('pick'))}
class="inline-flex items-center px-3 py-1.5 border border-transparent text-xs font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
>
- {props.dashboardInfrastructureEmptyState().actionLabel}
+ {props.workloadsInfrastructureEmptyState().actionLabel}
</button>
) : undefined
}
@@ -118,16 +118,16 @@ export function DashboardStateCards(props: DashboardStateCardsProps) {
/>
</svg>
}
- title={props.dashboardDisconnectedState().title}
- description={props.dashboardDisconnectedState().description}
+ title={props.workloadsDisconnectedState().title}
+ description={props.workloadsDisconnectedState().description}
tone="danger"
actions={
- props.dashboardDisconnectedState().actionLabel ? (
+ props.workloadsDisconnectedState().actionLabel ? (
<button
onClick={() => props.reconnect()}
class="mt-2 inline-flex items-center px-4 py-2 text-xs font-medium rounded bg-red-600 text-white hover:bg-red-700 transition-colors"
>
- {props.dashboardDisconnectedState().actionLabel}
+ {props.workloadsDisconnectedState().actionLabel}
</button>
) : undefined
}
@@ -160,8 +160,8 @@ export function DashboardStateCards(props: DashboardStateCardsProps) {
/>
</svg>
}
- title={props.dashboardGuestsEmptyState().title}
- description={props.dashboardGuestsEmptyState().description}
+ title={props.workloadsGuestsEmptyState().title}
+ description={props.workloadsGuestsEmptyState().description}
/>
</Card>
</Show>
diff --git a/frontend-modern/src/components/Dashboard/DashboardStatsStrip.tsx b/frontend-modern/src/components/Workloads/WorkloadsStatsStrip.tsx
similarity index 86%
rename from frontend-modern/src/components/Dashboard/DashboardStatsStrip.tsx
rename to frontend-modern/src/components/Workloads/WorkloadsStatsStrip.tsx
index 0f9ca817f0..f433dd0069 100644
--- a/frontend-modern/src/components/Dashboard/DashboardStatsStrip.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadsStatsStrip.tsx
@@ -1,13 +1,13 @@
import { Show } from 'solid-js';
-import type { DashboardState } from './useDashboardState';
+import type { WorkloadsState } from './useWorkloadsState';
-type DashboardStatsStripProps = Pick<
- DashboardState,
+type WorkloadsStatsStripProps = Pick<
+ WorkloadsState,
'connected' | 'initialDataReceived' | 'totalStats'
>;
-export function DashboardStatsStrip(props: DashboardStatsStripProps) {
+export function WorkloadsStatsStrip(props: WorkloadsStatsStripProps) {
return (
<Show when={props.connected() && props.initialDataReceived()}>
<div class="mb-4">
diff --git a/frontend-modern/src/components/Dashboard/Dashboard.tsx b/frontend-modern/src/components/Workloads/WorkloadsSurface.tsx
similarity index 88%
rename from frontend-modern/src/components/Dashboard/Dashboard.tsx
rename to frontend-modern/src/components/Workloads/WorkloadsSurface.tsx
index c4e8734c38..69ed22cca1 100644
--- a/frontend-modern/src/components/Dashboard/Dashboard.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadsSurface.tsx
@@ -1,17 +1,17 @@
import { Show } from 'solid-js';
import { InfrastructureSelector } from '@/components/shared/InfrastructureSelector';
import { PageHeader } from '@/components/shared/PageHeader';
-import { DashboardFilter } from './DashboardFilter';
+import { WorkloadsFilter } from './WorkloadsFilter';
import { WorkloadsSummary } from '@/components/Workloads/WorkloadsSummary';
import { ScrollToTopButton } from '@/components/shared/ScrollToTopButton';
import { StickySummarySection } from '@/components/shared/StickySummarySection';
-import { DashboardStateCards } from './DashboardStateCards';
-import { DashboardStatsStrip } from './DashboardStatsStrip';
-import { DashboardWorkloadTable } from './DashboardWorkloadTable';
-import { useDashboardState, type DashboardProps } from './useDashboardState';
+import { WorkloadsStateCards } from './WorkloadsStateCards';
+import { WorkloadsStatsStrip } from './WorkloadsStatsStrip';
+import { WorkloadsTable } from './WorkloadsTable';
+import { useWorkloadsState, type WorkloadsSurfaceProps } from './useWorkloadsState';
-export function Dashboard(props: DashboardProps) {
- const state = useDashboardState(props);
+export function WorkloadsSurface(props: WorkloadsSurfaceProps) {
+ const state = useWorkloadsState(props);
return (
<div
@@ -46,7 +46,7 @@ export function Dashboard(props: DashboardProps) {
</Show>
<InfrastructureSelector
- currentTab="dashboard"
+ currentTab="workloads"
globalTemperatureMonitoringEnabled={state.ws.state.temperatureMonitoringEnabled}
onNodeSelect={state.handleNodeSelect}
nodes={props.nodes}
@@ -54,13 +54,13 @@ export function Dashboard(props: DashboardProps) {
showNodeSummary={!state.isWorkloadsRoute()}
/>
- <DashboardStateCards
+ <WorkloadsStateCards
allGuests={state.allGuests}
connected={state.surfaceConnected}
- dashboardDisconnectedState={state.dashboardDisconnectedState}
- dashboardGuestsEmptyState={state.dashboardGuestsEmptyState}
- dashboardInfrastructureEmptyState={state.dashboardInfrastructureEmptyState}
- dashboardLoadingState={state.dashboardLoadingState}
+ workloadsDisconnectedState={state.workloadsDisconnectedState}
+ workloadsGuestsEmptyState={state.workloadsGuestsEmptyState}
+ workloadsInfrastructureEmptyState={state.workloadsInfrastructureEmptyState}
+ workloadsLoadingState={state.workloadsLoadingState}
filteredGuests={state.filteredGuests}
initialDataReceived={state.surfaceInitialDataReceived}
kioskMode={state.kioskMode}
@@ -80,7 +80,7 @@ export function Dashboard(props: DashboardProps) {
}
>
<div data-summary-clear-ignore>
- <DashboardFilter
+ <WorkloadsFilter
search={state.search}
setSearch={state.setSearch}
viewMode={state.viewMode}
@@ -92,7 +92,7 @@ export function Dashboard(props: DashboardProps) {
setSortKey={state.setSortKey}
setSortDirection={state.setSortDirection}
onBeforeAutoFocus={state.handleBeforeAutoFocus}
- columnVisibility={state.dashboardFilterColumnVisibility()}
+ columnVisibility={state.workloadsFilterColumnVisibility()}
chartsCollapsed={state.isWorkloadsRoute() ? state.workloadsSummaryCollapsed : undefined}
onChartsToggle={
state.isWorkloadsRoute()
@@ -114,7 +114,7 @@ export function Dashboard(props: DashboardProps) {
state.filteredGuests().length > 0
}
>
- <DashboardWorkloadTable
+ <WorkloadsTable
activeAlerts={state.activeAlerts}
alertsEnabled={state.alertsEnabled}
bottomSpacerHeight={state.bottomSpacerHeight}
@@ -159,7 +159,7 @@ export function Dashboard(props: DashboardProps) {
</Show>
</div>
- <DashboardStatsStrip
+ <WorkloadsStatsStrip
connected={state.surfaceConnected}
initialDataReceived={state.surfaceInitialDataReceived}
totalStats={state.totalStats}
diff --git a/frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx b/frontend-modern/src/components/Workloads/WorkloadsTable.tsx
similarity index 96%
rename from frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx
rename to frontend-modern/src/components/Workloads/WorkloadsTable.tsx
index d942ebb07b..f7fc456712 100644
--- a/frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadsTable.tsx
@@ -6,12 +6,12 @@ import { Table } from '@/components/shared/Table';
import { TableCard } from '@/components/shared/TableCard';
import { getGuestColumnWidthStyle } from './guestRowModel';
-import type { DashboardState } from './useDashboardState';
+import type { WorkloadsState } from './useWorkloadsState';
import { WorkloadPanel } from './WorkloadPanel';
import { WorkloadTableHeader } from './WorkloadTableHeader';
-type DashboardWorkloadTableProps = Pick<
- DashboardState,
+type WorkloadsTableProps = Pick<
+ WorkloadsState,
| 'activeAlerts'
| 'alertsEnabled'
| 'bottomSpacerHeight'
@@ -54,7 +54,7 @@ type DashboardWorkloadTableProps = Pick<
| 'workloadTableVisibleColumns'
>;
-export function DashboardWorkloadTable(props: DashboardWorkloadTableProps) {
+export function WorkloadsTable(props: WorkloadsTableProps) {
const showClearSelection = () =>
Boolean(props.selectedGuestId() || props.focusedSummaryWorkloadGroupId());
diff --git a/frontend-modern/src/components/Dashboard/__tests__/DiskList.test.tsx b/frontend-modern/src/components/Workloads/__tests__/DiskList.test.tsx
similarity index 98%
rename from frontend-modern/src/components/Dashboard/__tests__/DiskList.test.tsx
rename to frontend-modern/src/components/Workloads/__tests__/DiskList.test.tsx
index 30cca0e3fc..3fe6bec86e 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/DiskList.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/DiskList.test.tsx
@@ -2,8 +2,8 @@ import { describe, it, expect, afterEach } from 'vitest';
import { render, screen, cleanup } from '@solidjs/testing-library';
import { DiskList } from '../DiskList';
import {
- buildDashboardDiskPresentation,
- getDashboardDiskUsagePercent,
+ buildWorkloadsDiskPresentation,
+ getWorkloadsDiskUsagePercent,
} from '../diskListModel';
import type { Disk } from '@/types/api';
@@ -135,7 +135,7 @@ describe('DiskList', () => {
describe('usage calculation', () => {
it('derives usage percent through the canonical disk-list model', () => {
const disk = makeDisk({ used: 26843545600, total: 107374182400 });
- expect(getDashboardDiskUsagePercent(disk)).toBe(25);
+ expect(getWorkloadsDiskUsagePercent(disk)).toBe(25);
});
it('calculates usage percent correctly', () => {
@@ -282,7 +282,7 @@ describe('DiskList', () => {
describe('disk type display', () => {
it('builds disk presentation through the canonical disk-list model', () => {
- const presentation = buildDashboardDiskPresentation(
+ const presentation = buildWorkloadsDiskPresentation(
makeDisk({ mountpoint: undefined, device: undefined, type: 'ext4' }),
0,
);
diff --git a/frontend-modern/src/components/Dashboard/__tests__/EnhancedCPUBar.test.tsx b/frontend-modern/src/components/Workloads/__tests__/EnhancedCPUBar.test.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/__tests__/EnhancedCPUBar.test.tsx
rename to frontend-modern/src/components/Workloads/__tests__/EnhancedCPUBar.test.tsx
diff --git a/frontend-modern/src/components/Dashboard/__tests__/GuestRow.test.tsx b/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx
similarity index 99%
rename from frontend-modern/src/components/Dashboard/__tests__/GuestRow.test.tsx
rename to frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx
index a3622cd0f5..d53656dd13 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/GuestRow.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx
@@ -66,7 +66,7 @@ vi.mock('@/components/shared/StatusDot', () => ({
),
}));
-vi.mock('@/components/Dashboard/EnhancedCPUBar', () => ({
+vi.mock('@/components/Workloads/EnhancedCPUBar', () => ({
EnhancedCPUBar: (props: { usage: number; cores?: number }) => (
<div data-testid="cpu-bar" data-usage={props.usage} data-cores={props.cores} />
),
diff --git a/frontend-modern/src/components/Dashboard/__tests__/StackedDiskBar.test.tsx b/frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/__tests__/StackedDiskBar.test.tsx
rename to frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx
diff --git a/frontend-modern/src/components/Dashboard/__tests__/DashboardFilter.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx
similarity index 88%
rename from frontend-modern/src/components/Dashboard/__tests__/DashboardFilter.test.tsx
rename to frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx
index 0d7d688d08..4f8264bbf3 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/DashboardFilter.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx
@@ -1,11 +1,11 @@
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { render, screen, cleanup, fireEvent } from '@solidjs/testing-library';
import { createSignal } from 'solid-js';
-import { DashboardFilter } from '../DashboardFilter';
+import { WorkloadsFilter } from '../WorkloadsFilter';
import {
- DEFAULT_DASHBOARD_SORT_KEY,
- type DashboardFilterProps,
-} from '../dashboardFilterModel';
+ DEFAULT_WORKLOADS_SORT_KEY,
+ type WorkloadsFilterProps,
+} from '../workloadsFilterModel';
// Mock useBreakpoint β€” hoist so tests can control isMobile
const { isMobileMock } = vi.hoisted(() => {
@@ -42,7 +42,7 @@ vi.mock('@/components/shared/ColumnPicker', () => ({
}));
/** Helper to build default required props, with optional overrides. */
-function makeProps(overrides: Partial<DashboardFilterProps> = {}): DashboardFilterProps {
+function makeProps(overrides: Partial<WorkloadsFilterProps> = {}): WorkloadsFilterProps {
return {
search: vi.fn(() => ''),
setSearch: vi.fn(),
@@ -58,7 +58,7 @@ function makeProps(overrides: Partial<DashboardFilterProps> = {}): DashboardFilt
};
}
-describe('DashboardFilter', () => {
+describe('WorkloadsFilter', () => {
beforeEach(() => {
vi.clearAllMocks();
isMobileMock.mockReturnValue(false);
@@ -73,13 +73,13 @@ describe('DashboardFilter', () => {
describe('rendering', () => {
it('renders the search input', () => {
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByTestId('search-input')).toBeInTheDocument();
});
it('renders the Type filter select with all options', () => {
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
const typeSelect = screen.getByLabelText('Type');
expect(typeSelect).toBeInTheDocument();
expect(typeSelect).toHaveValue('all');
@@ -93,7 +93,7 @@ describe('DashboardFilter', () => {
it('renders the Status filter select with all options', () => {
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
const statusSelect = screen.getByLabelText('Status');
expect(statusSelect).toBeInTheDocument();
expect(statusSelect).toHaveValue('all');
@@ -105,7 +105,7 @@ describe('DashboardFilter', () => {
it('renders Grouped and List buttons', () => {
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByLabelText('Group by')).toBeInTheDocument();
expect(screen.getByText('Grouped')).toBeInTheDocument();
expect(screen.getByText('List')).toBeInTheDocument();
@@ -140,11 +140,11 @@ describe('DashboardFilter', () => {
chartsCollapsed: vi.fn(() => false),
onChartsToggle: vi.fn(),
});
- const { container } = render(() => <DashboardFilter {...props} />);
+ const { container } = render(() => <WorkloadsFilter {...props} />);
expect(screen.getByTestId('column-picker')).toBeInTheDocument();
expect(
- Array.from(container.querySelectorAll('.dashboard-filter *')).some((element) =>
+ Array.from(container.querySelectorAll('.workloads-filter *')).some((element) =>
(element.getAttribute('class') ?? '').includes('lg:flex-nowrap'),
),
).toBe(false);
@@ -152,7 +152,7 @@ describe('DashboardFilter', () => {
it('does not show the Reset button when all filters are at defaults', () => {
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.queryByText('Reset')).not.toBeInTheDocument();
});
});
@@ -162,7 +162,7 @@ describe('DashboardFilter', () => {
describe('type filter', () => {
it('calls setViewMode when a different type is selected', () => {
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
const typeSelect = screen.getByLabelText('Type');
fireEvent.change(typeSelect, { target: { value: 'vm' } });
expect(props.setViewMode).toHaveBeenCalledWith('vm');
@@ -174,7 +174,7 @@ describe('DashboardFilter', () => {
describe('status filter', () => {
it('calls setStatusMode when a different status is selected', () => {
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
const statusSelect = screen.getByLabelText('Status');
fireEvent.change(statusSelect, { target: { value: 'running' } });
expect(props.setStatusMode).toHaveBeenCalledWith('running');
@@ -186,7 +186,7 @@ describe('DashboardFilter', () => {
describe('grouping mode', () => {
it('uses the canonical grouped/list table-mode titles', () => {
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByRole('button', { name: 'Grouped' })).toHaveAttribute(
'title',
'Grouped table view',
@@ -199,14 +199,14 @@ describe('DashboardFilter', () => {
it('calls setGroupingMode("flat") when List button is clicked', () => {
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
fireEvent.click(screen.getByText('List'));
expect(props.setGroupingMode).toHaveBeenCalledWith('flat');
});
it('calls setGroupingMode("grouped") when Grouped button is clicked', () => {
const props = makeProps({ groupingMode: vi.fn(() => 'flat' as const) });
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
fireEvent.click(screen.getByText('Grouped'));
expect(props.setGroupingMode).toHaveBeenCalledWith('grouped');
});
@@ -217,25 +217,25 @@ describe('DashboardFilter', () => {
describe('reset button', () => {
it('shows when search is non-empty', () => {
const props = makeProps({ search: vi.fn(() => 'hello') });
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByText('Reset')).toBeInTheDocument();
});
it('shows when viewMode is not "all"', () => {
const props = makeProps({ viewMode: vi.fn(() => 'vm' as const) });
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByText('Reset')).toBeInTheDocument();
});
it('shows when statusMode is not "all"', () => {
const props = makeProps({ statusMode: vi.fn(() => 'running' as const) });
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByText('Reset')).toBeInTheDocument();
});
it('shows when groupingMode is "flat"', () => {
const props = makeProps({ groupingMode: vi.fn(() => 'flat' as const) });
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByText('Reset')).toBeInTheDocument();
});
@@ -250,7 +250,7 @@ describe('DashboardFilter', () => {
onChange: vi.fn(),
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByText('Reset')).toBeInTheDocument();
});
@@ -288,12 +288,12 @@ describe('DashboardFilter', () => {
onChange: namespaceOnChange,
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
fireEvent.click(screen.getByText('Reset'));
expect(props.setSearch).toHaveBeenCalledWith('');
- expect(props.setSortKey).toHaveBeenCalledWith(DEFAULT_DASHBOARD_SORT_KEY);
+ expect(props.setSortKey).toHaveBeenCalledWith(DEFAULT_WORKLOADS_SORT_KEY);
expect(props.setSortDirection).toHaveBeenCalledWith('asc');
expect(props.setViewMode).toHaveBeenCalledWith('all');
expect(props.setStatusMode).toHaveBeenCalledWith('all');
@@ -317,7 +317,7 @@ describe('DashboardFilter', () => {
onChange: runtimeOnChange,
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
fireEvent.click(screen.getByText('Reset'));
@@ -336,7 +336,7 @@ describe('DashboardFilter', () => {
onChange: vi.fn(),
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByText('Reset')).toBeInTheDocument();
});
});
@@ -355,13 +355,13 @@ describe('DashboardFilter', () => {
onChange: vi.fn(),
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByLabelText('Agent')).toBeInTheDocument();
});
it('does not render when hostFilter prop is absent', () => {
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.queryByLabelText('Agent')).not.toBeInTheDocument();
});
@@ -377,7 +377,7 @@ describe('DashboardFilter', () => {
onChange,
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
fireEvent.change(screen.getByLabelText('Agent'), { target: { value: 'host-1' } });
expect(onChange).toHaveBeenCalledWith('host-1');
});
@@ -391,7 +391,7 @@ describe('DashboardFilter', () => {
onChange: vi.fn(),
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByText('Node')).toBeInTheDocument();
});
});
@@ -408,7 +408,7 @@ describe('DashboardFilter', () => {
onChange: vi.fn(),
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByLabelText('Platform')).toBeInTheDocument();
});
@@ -424,7 +424,7 @@ describe('DashboardFilter', () => {
onChange,
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
fireEvent.change(screen.getByLabelText('Platform'), { target: { value: 'truenas' } });
expect(onChange).toHaveBeenCalledWith('truenas');
});
@@ -436,7 +436,7 @@ describe('DashboardFilter', () => {
]);
render(() => (
- <DashboardFilter
+ <WorkloadsFilter
{...baseProps}
platformFilter={{
value: 'truenas',
@@ -470,7 +470,7 @@ describe('DashboardFilter', () => {
onChange: vi.fn(),
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByLabelText('Namespace')).toBeInTheDocument();
});
@@ -486,7 +486,7 @@ describe('DashboardFilter', () => {
onChange,
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
fireEvent.change(screen.getByLabelText('Namespace'), { target: { value: 'kube-system' } });
expect(onChange).toHaveBeenCalledWith('kube-system');
});
@@ -507,7 +507,7 @@ describe('DashboardFilter', () => {
onChange: vi.fn(),
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByLabelText('Runtime')).toBeInTheDocument();
});
@@ -523,7 +523,7 @@ describe('DashboardFilter', () => {
onChange: vi.fn(),
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.queryByLabelText('Runtime')).not.toBeInTheDocument();
});
@@ -540,7 +540,7 @@ describe('DashboardFilter', () => {
onChange,
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
fireEvent.change(screen.getByLabelText('Runtime'), { target: { value: 'podman' } });
expect(onChange).toHaveBeenCalledWith('podman');
});
@@ -554,13 +554,13 @@ describe('DashboardFilter', () => {
chartsCollapsed: vi.fn(() => false),
onChartsToggle: vi.fn(),
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByText('Charts')).toBeInTheDocument();
});
it('does not render Charts button when onChartsToggle is not provided', () => {
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.queryByText('Charts')).not.toBeInTheDocument();
});
@@ -570,7 +570,7 @@ describe('DashboardFilter', () => {
chartsCollapsed: vi.fn(() => false),
onChartsToggle,
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
fireEvent.click(screen.getByText('Charts'));
expect(onChartsToggle).toHaveBeenCalled();
});
@@ -587,13 +587,13 @@ describe('DashboardFilter', () => {
onColumnToggle: vi.fn(),
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByTestId('column-picker')).toBeInTheDocument();
});
it('does not render ColumnPicker when column props are missing', () => {
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.queryByTestId('column-picker')).not.toBeInTheDocument();
});
});
@@ -604,14 +604,14 @@ describe('DashboardFilter', () => {
it('shows the Filters toggle button on mobile', () => {
isMobileMock.mockReturnValue(true);
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByText('Filters')).toBeInTheDocument();
});
it('hides filter controls on mobile by default', () => {
isMobileMock.mockReturnValue(true);
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
// The Type filter should not be visible until Filters is toggled
expect(screen.queryByLabelText('Type')).not.toBeInTheDocument();
});
@@ -619,7 +619,7 @@ describe('DashboardFilter', () => {
it('shows filter controls when Filters toggle is clicked on mobile', () => {
isMobileMock.mockReturnValue(true);
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
fireEvent.click(screen.getByText('Filters'));
expect(screen.getByLabelText('Type')).toBeInTheDocument();
expect(screen.getByLabelText('Status')).toBeInTheDocument();
@@ -628,7 +628,7 @@ describe('DashboardFilter', () => {
it('hides filter controls when Filters toggle is clicked again', () => {
isMobileMock.mockReturnValue(true);
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
const toggle = screen.getByText('Filters');
fireEvent.click(toggle);
expect(screen.getByLabelText('Type')).toBeInTheDocument();
@@ -642,7 +642,7 @@ describe('DashboardFilter', () => {
search: vi.fn(() => 'test'),
viewMode: vi.fn(() => 'vm' as const),
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
// The badge should show "2" (search + viewMode)
expect(screen.getByText('2')).toBeInTheDocument();
});
@@ -650,7 +650,7 @@ describe('DashboardFilter', () => {
it('does not show filter count badge when no filters are active', () => {
isMobileMock.mockReturnValue(true);
const props = makeProps();
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
// The badge is a span inside the Filters button β€” when count is 0, no badge renders.
// Verify no numeric badge appears near the Filters button.
const filtersButton = screen.getByText('Filters');
@@ -685,7 +685,7 @@ describe('DashboardFilter', () => {
onChange: vi.fn(),
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
// 5 active: search, viewMode, statusMode, host, namespace
expect(screen.getByText('5')).toBeInTheDocument();
});
@@ -703,14 +703,14 @@ describe('DashboardFilter', () => {
onChange: vi.fn(),
},
});
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.getByText('1')).toBeInTheDocument();
});
it('does not count whitespace-only search as active', () => {
isMobileMock.mockReturnValue(true);
const props = makeProps({ search: vi.fn(() => ' ') });
- render(() => <DashboardFilter {...props} />);
+ render(() => <WorkloadsFilter {...props} />);
expect(screen.queryByText('1')).not.toBeInTheDocument();
});
});
diff --git a/frontend-modern/src/components/Dashboard/__tests__/DashboardStateCards.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsStateCards.test.tsx
similarity index 82%
rename from frontend-modern/src/components/Dashboard/__tests__/DashboardStateCards.test.tsx
rename to frontend-modern/src/components/Workloads/__tests__/WorkloadsStateCards.test.tsx
index 65c34dd654..ef7229b0a8 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/DashboardStateCards.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsStateCards.test.tsx
@@ -1,32 +1,32 @@
import { fireEvent, render, screen } from '@solidjs/testing-library';
import { describe, expect, it, vi } from 'vitest';
-import { DashboardStateCards } from '../DashboardStateCards';
+import { WorkloadsStateCards } from '../WorkloadsStateCards';
-describe('DashboardStateCards', () => {
+describe('WorkloadsStateCards', () => {
it('routes the empty-state action directly to infrastructure setup', () => {
const navigate = vi.fn();
render(() => (
- <DashboardStateCards
+ <WorkloadsStateCards
allGuests={() => []}
connected={() => true}
- dashboardDisconnectedState={() => ({
+ workloadsDisconnectedState={() => ({
title: 'Connection lost',
description: 'Unable to connect to the backend server',
actionLabel: 'Reconnect now',
})}
- dashboardGuestsEmptyState={() => ({
+ workloadsGuestsEmptyState={() => ({
title: 'No guests found',
description: 'No guests match your current filters',
})}
- dashboardInfrastructureEmptyState={() => ({
+ workloadsInfrastructureEmptyState={() => ({
title: 'No infrastructure sources connected',
description:
'Start in Settings β†’ Infrastructure by choosing a source strategy. Connect a platform API for inventory and health, install Pulse Agent for host telemetry, or use both when you want full coverage.',
actionLabel: 'Add infrastructure source',
})}
- dashboardLoadingState={() => ({
- title: 'Loading dashboard data...',
+ workloadsLoadingState={() => ({
+ title: 'Loading workloads...',
description: 'Connecting to monitoring service',
})}
filteredGuests={() => []}
diff --git a/frontend-modern/src/components/Dashboard/__tests__/Dashboard.k8s.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.k8s.test.tsx
similarity index 94%
rename from frontend-modern/src/components/Dashboard/__tests__/Dashboard.k8s.test.tsx
rename to frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.k8s.test.tsx
index 2aef4e37d5..c41e6f9bf3 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/Dashboard.k8s.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.k8s.test.tsx
@@ -1,7 +1,7 @@
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { render, waitFor } from '@solidjs/testing-library';
import { createEffect } from 'solid-js';
-import { Dashboard } from '../Dashboard';
+import { WorkloadsSurface } from '../WorkloadsSurface';
import type { State } from '@/types/api';
const mockWebSocketState: State = {
@@ -127,13 +127,13 @@ vi.mock('@/components/shared/InfrastructureSelector', () => ({
),
}));
-vi.mock('../DashboardFilter', () => ({
- DashboardFilter: (props: { hostFilter?: HostFilterMock }) => {
+vi.mock('../WorkloadsFilter', () => ({
+ WorkloadsFilter: (props: { hostFilter?: HostFilterMock }) => {
createEffect(() => {
lastHostFilter = props.hostFilter;
});
return (
- <div data-testid="dashboard-filter">
+ <div data-testid="workloads-filter">
{props.hostFilter ? 'host-filter-enabled' : 'host-filter-disabled'}
</div>
);
@@ -171,7 +171,7 @@ vi.mock('../GuestRow', () => {
};
});
-describe('Dashboard pod workloads integration', () => {
+describe('Workloads pod workloads integration', () => {
beforeEach(() => {
navigateSpy.mockReset();
localStorage.clear();
@@ -209,14 +209,14 @@ describe('Dashboard pod workloads integration', () => {
];
mockLocationSearch = '?type=pod';
const { getByText, getByTestId } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
expect(getByText('api-6c4d8')).toBeInTheDocument();
});
- expect(getByTestId('dashboard-filter')).toHaveTextContent('host-filter-enabled');
+ expect(getByTestId('workloads-filter')).toHaveTextContent('host-filter-enabled');
});
it('does not let preselected host filtering suppress pod workloads', async () => {
@@ -251,7 +251,7 @@ describe('Dashboard pod workloads integration', () => {
mockLocationSearch = '?type=pod&resource=legacy:pve1:101';
const { getByText } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
@@ -291,7 +291,7 @@ describe('Dashboard pod workloads integration', () => {
];
const { getByText, queryByText } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
@@ -360,7 +360,7 @@ describe('Dashboard pod workloads integration', () => {
];
const { getByText, queryByText } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
@@ -440,7 +440,7 @@ describe('Dashboard pod workloads integration', () => {
];
const { getByText, queryByText } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
@@ -504,7 +504,7 @@ describe('Dashboard pod workloads integration', () => {
];
const { getByText, queryByText } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
@@ -596,7 +596,7 @@ describe('Dashboard pod workloads integration', () => {
];
const { queryByText, getByTestId } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
@@ -668,7 +668,7 @@ describe('Dashboard pod workloads integration', () => {
];
const { getByText, getAllByText } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
@@ -685,7 +685,7 @@ describe('Dashboard pod workloads integration', () => {
mockLocationSearch = '?type=all';
mockWorkloads = [];
- render(() => <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />);
+ render(() => <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />);
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalled();
@@ -701,7 +701,7 @@ describe('Dashboard pod workloads integration', () => {
mockLocationSearch = '?type=all&context=cluster-a';
mockWorkloads = [];
- render(() => <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />);
+ render(() => <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />);
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalled();
diff --git a/frontend-modern/src/components/Dashboard/__tests__/Dashboard.performance.contract.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
similarity index 67%
rename from frontend-modern/src/components/Dashboard/__tests__/Dashboard.performance.contract.test.tsx
rename to frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
index 00e3b0e8f7..89b76d600d 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/Dashboard.performance.contract.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
@@ -2,30 +2,30 @@ import { beforeEach, describe, expect, it, vi } from 'vitest';
import { render, waitFor } from '@solidjs/testing-library';
import { createSignal, onCleanup, onMount } from 'solid-js';
import type { Resource } from '@/types/resource';
-import { Dashboard } from '../Dashboard';
-import dashboardSource from '../Dashboard.tsx?raw';
-import dashboardStateCardsSource from '../DashboardStateCards.tsx?raw';
-import dashboardStatsStripSource from '../DashboardStatsStrip.tsx?raw';
-import dashboardFilterSource from '../DashboardFilter.tsx?raw';
-import dashboardWorkloadTableSource from '../DashboardWorkloadTable.tsx?raw';
+import { WorkloadsSurface } from '../WorkloadsSurface';
+import workloadsSource from '../WorkloadsSurface.tsx?raw';
+import workloadsStateCardsSource from '../WorkloadsStateCards.tsx?raw';
+import workloadsStatsStripSource from '../WorkloadsStatsStrip.tsx?raw';
+import workloadsFilterSource from '../WorkloadsFilter.tsx?raw';
+import workloadsWorkloadTableSource from '../WorkloadsTable.tsx?raw';
import workloadPanelSource from '../WorkloadPanel.tsx?raw';
import workloadTableHeaderSource from '../WorkloadTableHeader.tsx?raw';
-import dashboardFilterModelSource from '../dashboardFilterModel.ts?raw';
-import dashboardControlsStateSource from '../useDashboardControlsState.ts?raw';
-import dashboardGuestMetadataStateSource from '../useDashboardGuestMetadataState.ts?raw';
-import dashboardSelectionModelSource from '../dashboardSelectionModel.ts?raw';
-import dashboardSelectionStateSource from '../useDashboardSelectionState.ts?raw';
-import dashboardWorkloadDerivedStateSource from '../useDashboardWorkloadDerivedState.ts?raw';
-import dashboardWorkloadFilterOptionsSource from '../useDashboardWorkloadFilterOptions.ts?raw';
-import dashboardWorkloadFilterConfigModelSource from '../dashboardWorkloadFilterConfigModel.ts?raw';
-import dashboardWorkloadRouteModelSource from '../dashboardWorkloadRouteModel.ts?raw';
-import dashboardWorkloadRouteStateModelSource from '../dashboardWorkloadRouteStateModel.ts?raw';
-import dashboardWorkloadUrlSyncModelSource from '../dashboardWorkloadUrlSyncModel.ts?raw';
-import dashboardWorkloadViewportSyncSource from '../useDashboardWorkloadViewportSync.ts?raw';
-import dashboardWorkloadRouteStateSource from '../useDashboardWorkloadRouteState.ts?raw';
-import dashboardWorkloadUrlSyncSource from '../useDashboardWorkloadUrlSync.ts?raw';
-import dashboardStateSource from '../useDashboardState.ts?raw';
-import dashboardFilterStateSource from '../useDashboardFilterState.ts?raw';
+import workloadsFilterModelSource from '../workloadsFilterModel.ts?raw';
+import workloadsControlsStateSource from '../useWorkloadsControlsState.ts?raw';
+import workloadsGuestMetadataStateSource from '../useWorkloadGuestMetadataState.ts?raw';
+import workloadSelectionModelSource from '../workloadSelectionModel.ts?raw';
+import workloadsSelectionStateSource from '../useWorkloadSelectionState.ts?raw';
+import workloadsWorkloadDerivedStateSource from '../useWorkloadsDerivedState.ts?raw';
+import workloadsWorkloadFilterOptionsSource from '../useWorkloadFilterOptions.ts?raw';
+import workloadFilterConfigModelSource from '../workloadFilterConfigModel.ts?raw';
+import workloadRouteModelSource from '../workloadRouteModel.ts?raw';
+import workloadRouteStateModelSource from '../workloadRouteStateModel.ts?raw';
+import workloadUrlSyncModelSource from '../workloadUrlSyncModel.ts?raw';
+import workloadsWorkloadViewportSyncSource from '../useWorkloadViewportSync.ts?raw';
+import workloadsWorkloadRouteStateSource from '../useWorkloadRouteState.ts?raw';
+import workloadsWorkloadUrlSyncSource from '../useWorkloadUrlSync.ts?raw';
+import workloadsStateSource from '../useWorkloadsState.ts?raw';
+import workloadsFilterStateSource from '../useWorkloadsFilterState.ts?raw';
import groupedTableWindowingSource from '../useGroupedTableWindowing.ts?raw';
import thresholdSliderSource from '../ThresholdSlider.tsx?raw';
import thresholdSliderModelSource from '../thresholdSliderModel.ts?raw';
@@ -188,8 +188,8 @@ vi.mock('@/components/shared/InfrastructureSelector', () => ({
),
}));
-vi.mock('../DashboardFilter', () => ({
- DashboardFilter: () => <div data-testid="dashboard-filter">filter</div>,
+vi.mock('../WorkloadsFilter', () => ({
+ WorkloadsFilter: () => <div data-testid="workloads-filter">filter</div>,
}));
vi.mock('../GuestDrawer', () => ({
@@ -313,7 +313,7 @@ const flushEffects = async () => {
await Promise.resolve();
};
-describe('Dashboard performance contract', () => {
+describe('Workloads performance contract', () => {
beforeEach(() => {
vi.clearAllMocks();
localStorage.clear();
@@ -343,12 +343,12 @@ describe('Dashboard performance contract', () => {
});
describe('Baseline structural contracts', () => {
- it('renders Profile S dashboard table and guest rows', async () => {
+ it('renders Profile S workloads table and guest rows', async () => {
mockLocationSearch = '?type=all';
mockWorkloads = makeGuests(PROFILES.S);
const { container, getByTestId } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
@@ -369,10 +369,10 @@ describe('Dashboard performance contract', () => {
wsReconnecting = true;
mockWorkloads = [makeGuest(1, { name: 'route-owned-workload' })];
- render(() => <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />);
+ render(() => <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />);
await waitFor(() => {
- expect(document.querySelector('[data-testid="dashboard-filter"]')).toBeInTheDocument();
+ expect(document.querySelector('[data-testid="workloads-filter"]')).toBeInTheDocument();
});
await waitFor(() => {
expect(
@@ -412,7 +412,7 @@ describe('Dashboard performance contract', () => {
mockWorkloads = [makeGuest(1, { name: 'first-connect-workload' })];
const { container } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
@@ -431,7 +431,7 @@ describe('Dashboard performance contract', () => {
mockWorkloads = [makeGuest(1, { name: 'reconnect-workload' })];
const { container } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
@@ -455,7 +455,7 @@ describe('Dashboard performance contract', () => {
mockWorkloads = makeGuests(PROFILES.M);
const { container } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
@@ -473,7 +473,7 @@ describe('Dashboard performance contract', () => {
mockWorkloads = makeGuests(PROFILES.L);
const { container } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
@@ -494,7 +494,7 @@ describe('Dashboard performance contract', () => {
mockWorkloads = makeGuests(PROFILES.S);
const { container } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
@@ -508,7 +508,7 @@ describe('Dashboard performance contract', () => {
mockWorkloads = guests;
const { container } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
@@ -545,7 +545,7 @@ describe('Dashboard performance contract', () => {
mockWorkloads = profileGuests;
const { container, unmount } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
@@ -558,7 +558,7 @@ describe('Dashboard performance contract', () => {
});
describe('Workload derivation contracts', () => {
- it('normalizes dashboard view mode aliases through the shared workload helper', () => {
+ it('normalizes workloads view mode aliases through the shared workload helper', () => {
expect(normalizeWorkloadViewModeParam('all')).toBe('all');
expect(normalizeWorkloadViewModeParam('docker')).toBe('app-container');
expect(normalizeWorkloadViewModeParam('Kubernetes')).toBe('pod');
@@ -576,7 +576,7 @@ describe('Dashboard performance contract', () => {
);
const { container } = render(() => (
- <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />
+ <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />
));
await waitFor(() => {
@@ -589,202 +589,202 @@ describe('Dashboard performance contract', () => {
});
it('routes org scope normalization through the shared helper', () => {
- expect(dashboardSource).toContain('useDashboardState');
- expect(dashboardStateSource).toContain('useDashboardGuestMetadataState');
- expect(dashboardGuestMetadataStateSource).toContain('normalizeOrgScope(getOrgID())');
- expect(dashboardStateSource).not.toContain("const DEFAULT_ORG_SCOPE = 'default'");
- expect(dashboardStateSource).not.toContain('const normalizeOrgScope =');
+ expect(workloadsSource).toContain('useWorkloadsState');
+ expect(workloadsStateSource).toContain('useWorkloadGuestMetadataState');
+ expect(workloadsGuestMetadataStateSource).toContain('normalizeOrgScope(getOrgID())');
+ expect(workloadsStateSource).not.toContain("const DEFAULT_ORG_SCOPE = 'default'");
+ expect(workloadsStateSource).not.toContain('const normalizeOrgScope =');
});
- it('keeps hot-path dashboard state in the shared dashboard state owner', () => {
- expect(dashboardSource).toContain('useDashboardState');
- expect(dashboardSource).toContain('DashboardStateCards');
- expect(dashboardSource).toContain('DashboardStatsStrip');
- expect(dashboardSource).toContain('DashboardWorkloadTable');
- expect(dashboardSource).not.toContain('const [search, setSearch] = createSignal(');
- expect(dashboardStateSource).toContain('useDashboardControlsState');
- expect(dashboardStateSource).toContain('useDashboardGuestMetadataState');
- expect(dashboardStateSource).toContain('useDashboardSelectionState');
- expect(dashboardStateSource).toContain('useDashboardWorkloadDerivedState');
- expect(dashboardStateSource).toContain('useDashboardWorkloadRouteState');
- expect(dashboardStateSource).toContain('createWorkloadSortComparator');
- expect(dashboardStateSource).toContain('filterWorkloads(params)');
- expect(dashboardStateSource).not.toContain('useBreakpoint');
- expect(dashboardStateSource).not.toContain('useColumnVisibility');
- expect(dashboardStateSource).not.toContain('blurFocusedTypeToSearch');
- expect(dashboardStateSource).not.toContain("from './GuestRow'");
- expect(dashboardStateSource).not.toContain('GuestMetadataAPI.getAllMetadata()');
- expect(dashboardStateSource).not.toContain('buildWorkloadsPath({');
- expect(dashboardStateSource).not.toContain('parseWorkloadsLinkSearch');
- expect(dashboardStateSource).not.toContain('const [selectedGuestId, setSelectedGuestIdRaw]');
- expect(dashboardStateSource).not.toContain('const [hoveredWorkloadId, setHoveredWorkloadId]');
- expect(dashboardStateSource).not.toContain('groupWorkloads(');
- expect(dashboardStateSource).not.toContain('computeWorkloadStats(');
- expect(dashboardStateSource).not.toContain('computeWorkloadIOEmphasis(');
- expect(dashboardStateSource).not.toContain('buildNodeByInstance(');
- expect(dashboardStateSource).not.toContain('buildGuestParentNodeMap(');
- expect(dashboardStateSource).not.toContain('useGroupedTableWindowing');
- expect(dashboardGuestMetadataStateSource).toContain('GuestMetadataAPI.getAllMetadata()');
- expect(dashboardGuestMetadataStateSource).toContain("eventBus.on('org_switched'");
- expect(dashboardGuestMetadataStateSource).toContain(
+ it('keeps hot-path workloads state in the shared workloads state owner', () => {
+ expect(workloadsSource).toContain('useWorkloadsState');
+ expect(workloadsSource).toContain('WorkloadsStateCards');
+ expect(workloadsSource).toContain('WorkloadsStatsStrip');
+ expect(workloadsSource).toContain('WorkloadsTable');
+ expect(workloadsSource).not.toContain('const [search, setSearch] = createSignal(');
+ expect(workloadsStateSource).toContain('useWorkloadsControlsState');
+ expect(workloadsStateSource).toContain('useWorkloadGuestMetadataState');
+ expect(workloadsStateSource).toContain('useWorkloadSelectionState');
+ expect(workloadsStateSource).toContain('useWorkloadsDerivedState');
+ expect(workloadsStateSource).toContain('useWorkloadRouteState');
+ expect(workloadsStateSource).toContain('createWorkloadSortComparator');
+ expect(workloadsStateSource).toContain('filterWorkloads(params)');
+ expect(workloadsStateSource).not.toContain('useBreakpoint');
+ expect(workloadsStateSource).not.toContain('useColumnVisibility');
+ expect(workloadsStateSource).not.toContain('blurFocusedTypeToSearch');
+ expect(workloadsStateSource).not.toContain("from './GuestRow'");
+ expect(workloadsStateSource).not.toContain('GuestMetadataAPI.getAllMetadata()');
+ expect(workloadsStateSource).not.toContain('buildWorkloadsPath({');
+ expect(workloadsStateSource).not.toContain('parseWorkloadsLinkSearch');
+ expect(workloadsStateSource).not.toContain('const [selectedGuestId, setSelectedGuestIdRaw]');
+ expect(workloadsStateSource).not.toContain('const [hoveredWorkloadId, setHoveredWorkloadId]');
+ expect(workloadsStateSource).not.toContain('groupWorkloads(');
+ expect(workloadsStateSource).not.toContain('computeWorkloadStats(');
+ expect(workloadsStateSource).not.toContain('computeWorkloadIOEmphasis(');
+ expect(workloadsStateSource).not.toContain('buildNodeByInstance(');
+ expect(workloadsStateSource).not.toContain('buildGuestParentNodeMap(');
+ expect(workloadsStateSource).not.toContain('useGroupedTableWindowing');
+ expect(workloadsGuestMetadataStateSource).toContain('GuestMetadataAPI.getAllMetadata()');
+ expect(workloadsGuestMetadataStateSource).toContain("eventBus.on('org_switched'");
+ expect(workloadsGuestMetadataStateSource).toContain(
"window.addEventListener('pulse:metadata-changed'",
);
- expect(dashboardWorkloadRouteStateSource).toContain('useDashboardWorkloadUrlSync');
- expect(dashboardWorkloadRouteStateSource).toContain('useDashboardWorkloadFilterOptions');
- expect(dashboardWorkloadRouteStateSource).not.toContain('buildWorkloadsPath({');
- expect(dashboardWorkloadRouteStateSource).not.toContain('normalizeWorkloadViewModeParam');
- expect(dashboardWorkloadRouteStateSource).not.toContain(
+ expect(workloadsWorkloadRouteStateSource).toContain('useWorkloadUrlSync');
+ expect(workloadsWorkloadRouteStateSource).toContain('useWorkloadFilterOptions');
+ expect(workloadsWorkloadRouteStateSource).not.toContain('buildWorkloadsPath({');
+ expect(workloadsWorkloadRouteStateSource).not.toContain('normalizeWorkloadViewModeParam');
+ expect(workloadsWorkloadRouteStateSource).not.toContain(
'const [handledTypeParam, setHandledTypeParam]',
);
- expect(dashboardWorkloadRouteStateSource).not.toContain(
+ expect(workloadsWorkloadRouteStateSource).not.toContain(
'const [workloadsRouteActive, setWorkloadsRouteActive] = createSignal(false)',
);
- expect(dashboardWorkloadRouteStateSource).not.toContain(
+ expect(workloadsWorkloadRouteStateSource).not.toContain(
'const workloadNodeOptions = createMemo',
);
- expect(dashboardWorkloadRouteStateSource).not.toContain(
+ expect(workloadsWorkloadRouteStateSource).not.toContain(
'const containerRuntimeFilterConfig = createMemo',
);
- expect(dashboardWorkloadRouteStateSource).toContain(
- "from './dashboardWorkloadRouteStateModel'",
+ expect(workloadsWorkloadRouteStateSource).toContain(
+ "from './workloadRouteStateModel'",
);
- expect(dashboardWorkloadRouteStateSource).toContain(
- 'resolveDashboardWorkloadNodeSelection({',
+ expect(workloadsWorkloadRouteStateSource).toContain(
+ 'resolveWorkloadsWorkloadNodeSelection({',
);
- expect(dashboardWorkloadRouteStateSource).toContain('DASHBOARD_WORKLOAD_ROUTE_RESET_STATE');
- expect(dashboardWorkloadRouteStateSource).toContain('isWorkloadsRoute,');
- expect(dashboardWorkloadFilterOptionsSource).toContain(
- "from './dashboardWorkloadFilterConfigModel'",
+ expect(workloadsWorkloadRouteStateSource).toContain('WORKLOADS_WORKLOAD_ROUTE_RESET_STATE');
+ expect(workloadsWorkloadRouteStateSource).toContain('isWorkloadsRoute,');
+ expect(workloadsWorkloadFilterOptionsSource).toContain(
+ "from './workloadFilterConfigModel'",
);
- expect(dashboardWorkloadFilterOptionsSource).toContain(
- 'buildDashboardWorkloadNodeOptions(options.allGuests())',
+ expect(workloadsWorkloadFilterOptionsSource).toContain(
+ 'buildWorkloadNodeOptions(options.allGuests())',
);
- expect(dashboardWorkloadFilterOptionsSource).not.toContain(
+ expect(workloadsWorkloadFilterOptionsSource).not.toContain(
'const onContextChange = (value: string) =>',
);
- expect(dashboardWorkloadFilterOptionsSource).toContain(
- 'buildDashboardContainerRuntimeFilterConfig({',
+ expect(workloadsWorkloadFilterOptionsSource).toContain(
+ 'buildWorkloadsContainerRuntimeFilterConfig({',
);
- expect(dashboardWorkloadFilterOptionsSource).toContain('buildDashboardHostFilterConfig({');
- expect(dashboardWorkloadFilterOptionsSource).toContain(
- 'buildDashboardNamespaceFilterConfig({',
+ expect(workloadsWorkloadFilterOptionsSource).toContain('buildWorkloadsHostFilterConfig({');
+ expect(workloadsWorkloadFilterOptionsSource).toContain(
+ 'buildWorkloadsNamespaceFilterConfig({',
);
- expect(dashboardWorkloadFilterConfigModelSource).toContain(
- 'export const buildDashboardContainerRuntimeFilterConfig',
+ expect(workloadFilterConfigModelSource).toContain(
+ 'export const buildWorkloadsContainerRuntimeFilterConfig',
);
- expect(dashboardWorkloadFilterConfigModelSource).toContain(
- 'export const buildDashboardHostFilterConfig',
+ expect(workloadFilterConfigModelSource).toContain(
+ 'export const buildWorkloadsHostFilterConfig',
);
- expect(dashboardWorkloadFilterConfigModelSource).toContain(
- "DASHBOARD_KUBERNETES_CONTEXT_FILTER_LABEL = 'K8s cluster'",
+ expect(workloadFilterConfigModelSource).toContain(
+ "WORKLOADS_KUBERNETES_CONTEXT_FILTER_LABEL = 'K8s cluster'",
);
- expect(dashboardWorkloadFilterConfigModelSource).toContain(
+ expect(workloadFilterConfigModelSource).toContain(
"getAllFilterOptionLabel('K8s clusters')",
);
- expect(dashboardWorkloadFilterConfigModelSource).toContain(
- 'DASHBOARD_WORKLOAD_TYPE_OPTIONS',
+ expect(workloadFilterConfigModelSource).toContain(
+ 'WORKLOAD_TYPE_OPTIONS',
);
- expect(dashboardWorkloadFilterConfigModelSource).toContain(
- 'export const buildDashboardNamespaceFilterConfig',
+ expect(workloadFilterConfigModelSource).toContain(
+ 'export const buildWorkloadsNamespaceFilterConfig',
);
- expect(dashboardWorkloadRouteModelSource).toContain(
- 'export const deserializeDashboardWorkloadViewMode',
+ expect(workloadRouteModelSource).toContain(
+ 'export const deserializeWorkloadViewMode',
);
- expect(dashboardWorkloadRouteModelSource).toContain(
+ expect(workloadRouteModelSource).toContain(
"normalizeWorkloadViewModeParam(raw) ?? 'all'",
);
- expect(dashboardWorkloadRouteModelSource).not.toContain(
- 'export const buildDashboardContainerRuntimeFilterConfig',
+ expect(workloadRouteModelSource).not.toContain(
+ 'export const buildWorkloadsContainerRuntimeFilterConfig',
);
- expect(dashboardWorkloadRouteModelSource).not.toContain(
- 'export const buildDashboardHostFilterConfig',
+ expect(workloadRouteModelSource).not.toContain(
+ 'export const buildWorkloadsHostFilterConfig',
);
- expect(dashboardWorkloadRouteModelSource).not.toContain(
- 'export const buildDashboardNamespaceFilterConfig',
+ expect(workloadRouteModelSource).not.toContain(
+ 'export const buildWorkloadsNamespaceFilterConfig',
);
- expect(dashboardWorkloadRouteStateModelSource).toContain(
- 'export const DASHBOARD_WORKLOAD_ROUTE_RESET_STATE',
+ expect(workloadRouteStateModelSource).toContain(
+ 'export const WORKLOADS_WORKLOAD_ROUTE_RESET_STATE',
);
- expect(dashboardWorkloadRouteStateModelSource).toContain(
- 'export const resolveDashboardWorkloadNodeSelection',
+ expect(workloadRouteStateModelSource).toContain(
+ 'export const resolveWorkloadsWorkloadNodeSelection',
);
- expect(dashboardWorkloadRouteStateModelSource).toContain(
- 'export const deserializeDashboardContainerRuntime',
+ expect(workloadRouteStateModelSource).toContain(
+ 'export const deserializeWorkloadsContainerRuntime',
);
- expect(dashboardWorkloadUrlSyncSource).not.toContain('buildWorkloadsPath({');
- expect(dashboardWorkloadUrlSyncSource).not.toContain('normalizeWorkloadViewModeParam');
- expect(dashboardWorkloadUrlSyncSource).not.toContain('parseWorkloadsLinkSearch');
- expect(dashboardWorkloadUrlSyncSource).toContain("from './dashboardWorkloadRouteModel'");
- expect(dashboardWorkloadUrlSyncSource).toContain("from './dashboardWorkloadUrlSyncModel'");
- expect(dashboardWorkloadUrlSyncSource).toContain(
+ expect(workloadsWorkloadUrlSyncSource).not.toContain('buildWorkloadsPath({');
+ expect(workloadsWorkloadUrlSyncSource).not.toContain('normalizeWorkloadViewModeParam');
+ expect(workloadsWorkloadUrlSyncSource).not.toContain('parseWorkloadsLinkSearch');
+ expect(workloadsWorkloadUrlSyncSource).toContain("from './workloadRouteModel'");
+ expect(workloadsWorkloadUrlSyncSource).toContain("from './workloadUrlSyncModel'");
+ expect(workloadsWorkloadUrlSyncSource).toContain(
'const [handledTypeParam, setHandledTypeParam]',
);
- expect(dashboardWorkloadUrlSyncSource).toContain(
+ expect(workloadsWorkloadUrlSyncSource).toContain(
'if (normalized === handledPlatformParam()) return;',
);
- expect(dashboardWorkloadUrlSyncSource).toContain(
+ expect(workloadsWorkloadUrlSyncSource).toContain(
'const currentSelected = untrack(() => options.selectedPlatform());',
);
- expect(dashboardWorkloadUrlSyncSource).toContain('parseDashboardWorkloadUrlParams');
- expect(dashboardWorkloadUrlSyncSource).toContain(
- 'resolveDashboardManagedWorkloadsNavigateTarget({',
+ expect(workloadsWorkloadUrlSyncSource).toContain('parseWorkloadsWorkloadUrlParams');
+ expect(workloadsWorkloadUrlSyncSource).toContain(
+ 'resolveWorkloadsManagedWorkloadsNavigateTarget({',
);
- expect(dashboardWorkloadUrlSyncModelSource).toContain('parseWorkloadsLinkSearch(search)');
- expect(dashboardWorkloadUrlSyncModelSource).toContain('buildWorkloadsPath({');
- expect(dashboardWorkloadUrlSyncModelSource).toContain(
- 'resolveDashboardManagedWorkloadsNavigateTarget',
+ expect(workloadUrlSyncModelSource).toContain('parseWorkloadsLinkSearch(search)');
+ expect(workloadUrlSyncModelSource).toContain('buildWorkloadsPath({');
+ expect(workloadUrlSyncModelSource).toContain(
+ 'resolveWorkloadsManagedWorkloadsNavigateTarget',
);
- expect(dashboardWorkloadUrlSyncModelSource).toContain('resolveDashboardWorkloadRuntimeParam');
- expect(dashboardWorkloadUrlSyncModelSource).toContain(
+ expect(workloadUrlSyncModelSource).toContain('resolveWorkloadsWorkloadRuntimeParam');
+ expect(workloadUrlSyncModelSource).toContain(
'normalizeWorkloadViewModeParam(params.type)',
);
- expect(dashboardControlsStateSource).toContain('useBreakpoint');
- expect(dashboardControlsStateSource).toContain('useColumnVisibility');
- expect(dashboardControlsStateSource).toContain('usePersistentSignal');
- expect(dashboardControlsStateSource).toContain('blurFocusedTypeToSearch');
- expect(dashboardControlsStateSource).toContain('DEFAULT_DASHBOARD_SORT_KEY');
- expect(dashboardWorkloadDerivedStateSource).toContain('groupWorkloads(');
- expect(dashboardWorkloadDerivedStateSource).toContain('computeWorkloadStats(');
- expect(dashboardWorkloadDerivedStateSource).toContain('computeWorkloadIOEmphasis(');
- expect(dashboardWorkloadDerivedStateSource).toContain("from './workloadTopology'");
- expect(dashboardWorkloadDerivedStateSource).toContain('buildNodeByInstance(');
- expect(dashboardWorkloadDerivedStateSource).toContain('buildGuestParentNodeMap(');
- expect(dashboardWorkloadDerivedStateSource).toContain('useGroupedTableWindowing');
- expect(dashboardWorkloadDerivedStateSource).toContain('useDashboardWorkloadViewportSync');
- expect(dashboardWorkloadDerivedStateSource).not.toContain('window.addEventListener');
- expect(dashboardWorkloadDerivedStateSource).not.toContain('getBoundingClientRect');
- expect(dashboardWorkloadViewportSyncSource).toContain('window.addEventListener');
- expect(dashboardWorkloadViewportSyncSource).toContain('window.removeEventListener');
- expect(dashboardWorkloadViewportSyncSource).toContain('getBoundingClientRect');
- expect(dashboardWorkloadViewportSyncSource).toContain('groupedWindowing.onScroll');
- expect(dashboardWorkloadRouteStateSource).not.toContain("from './workloadTopology'");
- expect(dashboardWorkloadRouteModelSource).toContain("from './workloadTopology'");
- expect(dashboardWorkloadRouteModelSource).toContain('workloadHostScopeId');
- expect(dashboardWorkloadRouteModelSource).toContain('getKubernetesContextKey');
- expect(dashboardSelectionStateSource).toContain(
+ expect(workloadsControlsStateSource).toContain('useBreakpoint');
+ expect(workloadsControlsStateSource).toContain('useColumnVisibility');
+ expect(workloadsControlsStateSource).toContain('usePersistentSignal');
+ expect(workloadsControlsStateSource).toContain('blurFocusedTypeToSearch');
+ expect(workloadsControlsStateSource).toContain('DEFAULT_WORKLOADS_SORT_KEY');
+ expect(workloadsWorkloadDerivedStateSource).toContain('groupWorkloads(');
+ expect(workloadsWorkloadDerivedStateSource).toContain('computeWorkloadStats(');
+ expect(workloadsWorkloadDerivedStateSource).toContain('computeWorkloadIOEmphasis(');
+ expect(workloadsWorkloadDerivedStateSource).toContain("from './workloadTopology'");
+ expect(workloadsWorkloadDerivedStateSource).toContain('buildNodeByInstance(');
+ expect(workloadsWorkloadDerivedStateSource).toContain('buildGuestParentNodeMap(');
+ expect(workloadsWorkloadDerivedStateSource).toContain('useGroupedTableWindowing');
+ expect(workloadsWorkloadDerivedStateSource).toContain('useWorkloadViewportSync');
+ expect(workloadsWorkloadDerivedStateSource).not.toContain('window.addEventListener');
+ expect(workloadsWorkloadDerivedStateSource).not.toContain('getBoundingClientRect');
+ expect(workloadsWorkloadViewportSyncSource).toContain('window.addEventListener');
+ expect(workloadsWorkloadViewportSyncSource).toContain('window.removeEventListener');
+ expect(workloadsWorkloadViewportSyncSource).toContain('getBoundingClientRect');
+ expect(workloadsWorkloadViewportSyncSource).toContain('groupedWindowing.onScroll');
+ expect(workloadsWorkloadRouteStateSource).not.toContain("from './workloadTopology'");
+ expect(workloadRouteModelSource).toContain("from './workloadTopology'");
+ expect(workloadRouteModelSource).toContain('workloadHostScopeId');
+ expect(workloadRouteModelSource).toContain('getKubernetesContextKey');
+ expect(workloadsSelectionStateSource).toContain(
'const [selectedGuestId, setSelectedGuestIdRaw]',
);
- expect(dashboardSelectionStateSource).toContain(
+ expect(workloadsSelectionStateSource).toContain(
'const [hoveredWorkloadId, setHoveredWorkloadId]',
);
- expect(dashboardSelectionStateSource).toContain('setHandledResourceId(null)');
- expect(dashboardSelectionStateSource).toContain("from './dashboardSelectionModel'");
- expect(dashboardSelectionStateSource).not.toContain('parseWorkloadsLinkSearch');
- expect(dashboardSelectionStateSource).not.toContain('getCanonicalWorkloadId');
- expect(dashboardSelectionModelSource).toContain('parseWorkloadsLinkSearch(search)');
- expect(dashboardSelectionModelSource).toContain('getCanonicalWorkloadId');
- expect(dashboardSelectionModelSource).toContain('resolveDashboardResourceSelection');
- expect(dashboardSelectionModelSource).toContain('dashboardHasHoveredWorkload');
+ expect(workloadsSelectionStateSource).toContain('setHandledResourceId(null)');
+ expect(workloadsSelectionStateSource).toContain("from './workloadSelectionModel'");
+ expect(workloadsSelectionStateSource).not.toContain('parseWorkloadsLinkSearch');
+ expect(workloadsSelectionStateSource).not.toContain('getCanonicalWorkloadId');
+ expect(workloadSelectionModelSource).toContain('parseWorkloadsLinkSearch(search)');
+ expect(workloadSelectionModelSource).toContain('getCanonicalWorkloadId');
+ expect(workloadSelectionModelSource).toContain('resolveWorkloadResourceSelection');
+ expect(workloadSelectionModelSource).toContain('workloadsHasHoveredWorkload');
expect(groupedTableWindowingSource).toContain('DEFAULT_WINDOW_SIZE');
expect(groupedTableWindowingSource).toContain('DEFAULT_ENABLE_THRESHOLD');
expect(groupedTableWindowingSource).toContain('DEFAULT_OVERSCAN_ROWS');
expect(groupedTableWindowingSource).toContain('getVisibleSlice');
expect(groupedTableWindowingSource).toContain('onScroll');
expect(groupedTableWindowingSource).toContain('revealIndex');
- expect(dashboardStateSource).not.toContain('const DEFAULT_WINDOW_SIZE =');
- expect(dashboardStateSource).not.toContain('const DEFAULT_ENABLE_THRESHOLD =');
- expect(dashboardStateSource).not.toContain('const DEFAULT_OVERSCAN_ROWS =');
- expect(dashboardSource).not.toContain('createMemo(() => getCanonicalWorkloadId(guest()))');
+ expect(workloadsStateSource).not.toContain('const DEFAULT_WINDOW_SIZE =');
+ expect(workloadsStateSource).not.toContain('const DEFAULT_ENABLE_THRESHOLD =');
+ expect(workloadsStateSource).not.toContain('const DEFAULT_OVERSCAN_ROWS =');
+ expect(workloadsSource).not.toContain('createMemo(() => getCanonicalWorkloadId(guest()))');
expect(workloadPanelSource).toContain('createMemo(() => getCanonicalWorkloadId(guest()))');
expect(workloadPanelSource).toContain('buildWorkloadSummaryGroupScope');
expect(workloadPanelSource).toContain('data-summary-group-id');
@@ -792,56 +792,56 @@ describe('Dashboard performance contract', () => {
expect(workloadPanelSource).toContain('getInteractiveGroupedTableRowClass');
expect(workloadPanelSource).toContain('getGroupedTableRowCellClass');
expect(workloadPanelSource).not.toContain('cursor-pointer bg-surface-alt');
- expect(dashboardWorkloadTableSource).not.toContain(
+ expect(workloadsWorkloadTableSource).not.toContain(
'createMemo(() => getCanonicalWorkloadId(guest()))',
);
- expect(dashboardStateSource).not.toContain('const guestId = () => {');
+ expect(workloadsStateSource).not.toContain('const guestId = () => {');
});
- it('keeps dashboard filter state in canonical dashboard filter owners', () => {
- expect(dashboardFilterSource).toContain('useDashboardFilterState');
- expect(dashboardSource).not.toContain('SummaryScopeBar');
- expect(dashboardSource).not.toContain('searchTrailing={pinnedScopeFallback()}');
- expect(dashboardSource).not.toContain('mobileTrailing={pinnedScopeFallback()}');
- expect(dashboardSource).toContain('setClearSurfaceRootRef');
- expect(dashboardSource).toContain('setTableRootRef={state.setTableRootRef}');
- expect(dashboardSource).toContain('data-testid="workloads-interaction-surface"');
- expect(dashboardSource).toContain('data-summary-clear-ignore');
- expect(dashboardSource).toContain('clearPinnedSummaryScope={state.clearPinnedSummaryScope}');
- expect(dashboardWorkloadTableSource).toContain('data-summary-clear-surface');
- expect(dashboardWorkloadTableSource).toContain('data-testid="workloads-table-surface"');
- expect(dashboardWorkloadTableSource).toContain('TableCard');
- expect(dashboardWorkloadTableSource).toContain('TableCardHeader');
- expect(dashboardWorkloadTableSource).toContain('showClearSelection');
- expect(dashboardWorkloadTableSource).toContain('clearPinnedSummaryScope');
- expect(dashboardFilterSource).not.toContain('const [filtersOpen, setFiltersOpen] =');
- expect(dashboardFilterSource).not.toContain('useBreakpoint');
- expect(dashboardFilterSource).not.toContain("props.setSortKey('name')");
- expect(dashboardFilterSource).toContain('searchTrailing={props.searchTrailing}');
- expect(dashboardFilterSource).toContain('mobileTrailing={props.mobileTrailing}');
- expect(dashboardFilterStateSource).toContain('countActiveDashboardFilters');
- expect(dashboardFilterStateSource).not.toContain('props.containerRuntimeFilter?.onChange');
- expect(dashboardFilterStateSource).toContain('useBreakpoint');
- expect(dashboardFilterStateSource).toContain('DEFAULT_DASHBOARD_SORT_KEY');
- expect(dashboardFilterModelSource).toContain('export const countActiveDashboardFilters');
- expect(dashboardFilterModelSource).toContain('export const hasActiveDashboardFilters');
- expect(dashboardFilterModelSource).toContain(
- "DEFAULT_DASHBOARD_SORT_KEY: DashboardSortKey = 'type'",
+ it('keeps workloads filter state in canonical workloads filter owners', () => {
+ expect(workloadsFilterSource).toContain('useWorkloadsFilterState');
+ expect(workloadsSource).not.toContain('SummaryScopeBar');
+ expect(workloadsSource).not.toContain('searchTrailing={pinnedScopeFallback()}');
+ expect(workloadsSource).not.toContain('mobileTrailing={pinnedScopeFallback()}');
+ expect(workloadsSource).toContain('setClearSurfaceRootRef');
+ expect(workloadsSource).toContain('setTableRootRef={state.setTableRootRef}');
+ expect(workloadsSource).toContain('data-testid="workloads-interaction-surface"');
+ expect(workloadsSource).toContain('data-summary-clear-ignore');
+ expect(workloadsSource).toContain('clearPinnedSummaryScope={state.clearPinnedSummaryScope}');
+ expect(workloadsWorkloadTableSource).toContain('data-summary-clear-surface');
+ expect(workloadsWorkloadTableSource).toContain('data-testid="workloads-table-surface"');
+ expect(workloadsWorkloadTableSource).toContain('TableCard');
+ expect(workloadsWorkloadTableSource).toContain('TableCardHeader');
+ expect(workloadsWorkloadTableSource).toContain('showClearSelection');
+ expect(workloadsWorkloadTableSource).toContain('clearPinnedSummaryScope');
+ expect(workloadsFilterSource).not.toContain('const [filtersOpen, setFiltersOpen] =');
+ expect(workloadsFilterSource).not.toContain('useBreakpoint');
+ expect(workloadsFilterSource).not.toContain("props.setSortKey('name')");
+ expect(workloadsFilterSource).toContain('searchTrailing={props.searchTrailing}');
+ expect(workloadsFilterSource).toContain('mobileTrailing={props.mobileTrailing}');
+ expect(workloadsFilterStateSource).toContain('countActiveWorkloadsFilters');
+ expect(workloadsFilterStateSource).not.toContain('props.containerRuntimeFilter?.onChange');
+ expect(workloadsFilterStateSource).toContain('useBreakpoint');
+ expect(workloadsFilterStateSource).toContain('DEFAULT_WORKLOADS_SORT_KEY');
+ expect(workloadsFilterModelSource).toContain('export const countActiveWorkloadsFilters');
+ expect(workloadsFilterModelSource).toContain('export const hasActiveWorkloadsFilters');
+ expect(workloadsFilterModelSource).toContain(
+ "DEFAULT_WORKLOADS_SORT_KEY: WorkloadsSortKey = 'type'",
);
- expect(dashboardFilterModelSource).toContain('searchTrailing?: JSX.Element;');
- expect(dashboardFilterModelSource).toContain('utilityActions?: JSX.Element;');
- expect(dashboardFilterModelSource).toContain('mobileTrailing?: JSX.Element;');
- expect(dashboardStateSource).toContain('useDashboardWorkloadRouteState');
- expect(dashboardStateSource).toContain('filterWorkloads(params)');
- expect(dashboardStateSource).not.toContain('const containerRuntimeFilterConfig = createMemo');
- expect(dashboardStateSource).not.toContain('useGroupedTableWindowing');
- expect(dashboardWorkloadRouteStateSource).toContain('useDashboardWorkloadUrlSync');
- expect(dashboardWorkloadRouteStateSource).toContain('useDashboardWorkloadFilterOptions');
- expect(dashboardWorkloadRouteStateSource).toContain('containerRuntimeFilterConfig');
- expect(dashboardWorkloadRouteStateSource).toContain('hostFilterConfig');
- expect(dashboardWorkloadRouteStateSource).toContain('namespaceFilterConfig');
- expect(dashboardWorkloadDerivedStateSource).toContain('useGroupedTableWindowing');
- expect(dashboardWorkloadDerivedStateSource).toContain('useDashboardWorkloadViewportSync');
+ expect(workloadsFilterModelSource).toContain('searchTrailing?: JSX.Element;');
+ expect(workloadsFilterModelSource).toContain('utilityActions?: JSX.Element;');
+ expect(workloadsFilterModelSource).toContain('mobileTrailing?: JSX.Element;');
+ expect(workloadsStateSource).toContain('useWorkloadRouteState');
+ expect(workloadsStateSource).toContain('filterWorkloads(params)');
+ expect(workloadsStateSource).not.toContain('const containerRuntimeFilterConfig = createMemo');
+ expect(workloadsStateSource).not.toContain('useGroupedTableWindowing');
+ expect(workloadsWorkloadRouteStateSource).toContain('useWorkloadUrlSync');
+ expect(workloadsWorkloadRouteStateSource).toContain('useWorkloadFilterOptions');
+ expect(workloadsWorkloadRouteStateSource).toContain('containerRuntimeFilterConfig');
+ expect(workloadsWorkloadRouteStateSource).toContain('hostFilterConfig');
+ expect(workloadsWorkloadRouteStateSource).toContain('namespaceFilterConfig');
+ expect(workloadsWorkloadDerivedStateSource).toContain('useGroupedTableWindowing');
+ expect(workloadsWorkloadDerivedStateSource).toContain('useWorkloadViewportSync');
});
it('keeps threshold slider runtime and derivations in canonical slider owners', () => {
@@ -970,22 +970,22 @@ describe('Dashboard performance contract', () => {
expect(workloadTopologySource).toContain('export const buildGuestParentNodeMap');
});
- it('keeps dashboard shell rendering in canonical section owners', () => {
- expect(dashboardSource).toContain('DashboardStateCards');
- expect(dashboardSource).toContain('DashboardStatsStrip');
- expect(dashboardSource).toContain('DashboardWorkloadTable');
- expect(dashboardSource).not.toContain('TableHeader');
- expect(dashboardSource).not.toContain('NodeGroupHeader');
- expect(dashboardWorkloadTableSource).toContain('WorkloadTableHeader');
- expect(dashboardWorkloadTableSource).toContain('WorkloadPanel');
- expect(dashboardWorkloadTableSource).not.toContain('style={{');
- expect(dashboardWorkloadTableSource).toContain('style={getGuestColumnWidthStyle(');
- expect(dashboardWorkloadTableSource).toContain('props.workloadTableLayoutMode()');
- expect(dashboardWorkloadTableSource).toContain('props.workloadTableVisibleColumnIds()');
- expect(dashboardWorkloadTableSource).toContain('<colgroup>');
- expect(dashboardWorkloadTableSource).not.toContain('<TableHead');
- expect(dashboardWorkloadTableSource).not.toContain('NodeGroupHeader');
- expect(dashboardWorkloadTableSource).not.toContain('GuestDrawer');
+ it('keeps workloads shell rendering in canonical section owners', () => {
+ expect(workloadsSource).toContain('WorkloadsStateCards');
+ expect(workloadsSource).toContain('WorkloadsStatsStrip');
+ expect(workloadsSource).toContain('WorkloadsTable');
+ expect(workloadsSource).not.toContain('TableHeader');
+ expect(workloadsSource).not.toContain('NodeGroupHeader');
+ expect(workloadsWorkloadTableSource).toContain('WorkloadTableHeader');
+ expect(workloadsWorkloadTableSource).toContain('WorkloadPanel');
+ expect(workloadsWorkloadTableSource).not.toContain('style={{');
+ expect(workloadsWorkloadTableSource).toContain('style={getGuestColumnWidthStyle(');
+ expect(workloadsWorkloadTableSource).toContain('props.workloadTableLayoutMode()');
+ expect(workloadsWorkloadTableSource).toContain('props.workloadTableVisibleColumnIds()');
+ expect(workloadsWorkloadTableSource).toContain('<colgroup>');
+ expect(workloadsWorkloadTableSource).not.toContain('<TableHead');
+ expect(workloadsWorkloadTableSource).not.toContain('NodeGroupHeader');
+ expect(workloadsWorkloadTableSource).not.toContain('GuestDrawer');
expect(workloadTableHeaderSource).toContain('TableHead');
expect(workloadTableHeaderSource).toContain('col.sortKey as WorkloadSortKey');
expect(workloadTableHeaderSource).toContain('style={getGuestColumnStyle(');
@@ -1006,32 +1006,32 @@ describe('Dashboard performance contract', () => {
expect(workloadPanelSource).not.toContain('style={');
expect(workloadPanelSource).not.toContain('kind="scope"');
expect(workloadPanelSource).not.toContain('leadingAction={');
- expect(dashboardSelectionStateSource).toContain('activeSummaryWorkloadGroupScope');
- expect(dashboardSelectionStateSource).toContain('focusedSummaryWorkloadGroupScope');
- expect(dashboardSelectionStateSource).toContain('setHoveredWorkloadGroupScope');
- expect(dashboardWorkloadTableSource).toContain('focusedSummaryWorkloadGroupScope');
- expect(dashboardWorkloadTableSource).toContain('hoveredSummaryWorkloadGroupScope');
- expect(dashboardSource).toContain(
+ expect(workloadsSelectionStateSource).toContain('activeSummaryWorkloadGroupScope');
+ expect(workloadsSelectionStateSource).toContain('focusedSummaryWorkloadGroupScope');
+ expect(workloadsSelectionStateSource).toContain('setHoveredWorkloadGroupScope');
+ expect(workloadsWorkloadTableSource).toContain('focusedSummaryWorkloadGroupScope');
+ expect(workloadsWorkloadTableSource).toContain('hoveredSummaryWorkloadGroupScope');
+ expect(workloadsSource).toContain(
'hoveredGroupScope={state.hoveredSummaryWorkloadGroupScope()}',
);
- expect(dashboardSource).toContain(
+ expect(workloadsSource).toContain(
'focusedGroupScope={state.focusedSummaryWorkloadGroupScope()}',
);
expect(workloadPanelSource).not.toContain('TableHead');
- expect(dashboardStateCardsSource).toContain('dashboardInfrastructureEmptyState().title');
- expect(dashboardStateCardsSource).toContain('dashboardDisconnectedState().actionLabel');
- expect(dashboardStateCardsSource).toContain("buildInfrastructureOnboardingPath('pick')");
- expect(dashboardStatsStripSource).toContain('totalStats().running');
- expect(dashboardStatsStripSource).toContain('totalStats().stopped');
+ expect(workloadsStateCardsSource).toContain('workloadsInfrastructureEmptyState().title');
+ expect(workloadsStateCardsSource).toContain('workloadsDisconnectedState().actionLabel');
+ expect(workloadsStateCardsSource).toContain("buildInfrastructureOnboardingPath('pick')");
+ expect(workloadsStatsStripSource).toContain('totalStats().running');
+ expect(workloadsStatsStripSource).toContain('totalStats().stopped');
});
it('keeps disk-list runtime and derivations in canonical disk-list owners', () => {
expect(diskListSource).toContain('useDiskListState');
expect(diskListSource).not.toContain('const getUsagePercent =');
expect(diskListSource).not.toContain('const getDiskStatusTooltip =');
- expect(diskListStateSource).toContain('getDashboardGuestDiskStatusMessage');
- expect(diskListModelSource).toContain('export const buildDashboardDiskPresentation');
- expect(diskListModelSource).toContain('export const getDashboardDiskUsagePercent');
+ expect(diskListStateSource).toContain('getWorkloadGuestDiskStatusMessage');
+ expect(diskListModelSource).toContain('export const buildWorkloadsDiskPresentation');
+ expect(diskListModelSource).toContain('export const getWorkloadsDiskUsagePercent');
});
it('filterWorkloads returns all guests when no filters active', () => {
diff --git a/frontend-modern/src/components/Dashboard/__tests__/useEnhancedCPUBarState.test.tsx b/frontend-modern/src/components/Workloads/__tests__/useEnhancedCPUBarState.test.tsx
similarity index 96%
rename from frontend-modern/src/components/Dashboard/__tests__/useEnhancedCPUBarState.test.tsx
rename to frontend-modern/src/components/Workloads/__tests__/useEnhancedCPUBarState.test.tsx
index f8b1ecf679..0ff8975a11 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/useEnhancedCPUBarState.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/useEnhancedCPUBarState.test.tsx
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, it } from 'vitest';
import { cleanup, render } from '@solidjs/testing-library';
-import { useEnhancedCPUBarState } from '@/components/Dashboard/useEnhancedCPUBarState';
+import { useEnhancedCPUBarState } from '@/components/Workloads/useEnhancedCPUBarState';
afterEach(() => {
cleanup();
diff --git a/frontend-modern/src/components/Dashboard/__tests__/useGroupedTableWindowing.test.ts b/frontend-modern/src/components/Workloads/__tests__/useGroupedTableWindowing.test.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/__tests__/useGroupedTableWindowing.test.ts
rename to frontend-modern/src/components/Workloads/__tests__/useGroupedTableWindowing.test.ts
diff --git a/frontend-modern/src/components/Dashboard/__tests__/useMetricBarState.test.tsx b/frontend-modern/src/components/Workloads/__tests__/useMetricBarState.test.tsx
similarity index 96%
rename from frontend-modern/src/components/Dashboard/__tests__/useMetricBarState.test.tsx
rename to frontend-modern/src/components/Workloads/__tests__/useMetricBarState.test.tsx
index 094647bd27..af7871ce21 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/useMetricBarState.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/useMetricBarState.test.tsx
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, it, vi } from 'vitest';
import { cleanup, render } from '@solidjs/testing-library';
-import { useMetricBarState } from '@/components/Dashboard/useMetricBarState';
+import { useMetricBarState } from '@/components/Workloads/useMetricBarState';
class MockResizeObserver {
callback: ResizeObserverCallback;
diff --git a/frontend-modern/src/components/Dashboard/__tests__/useStackedDiskBarState.test.tsx b/frontend-modern/src/components/Workloads/__tests__/useStackedDiskBarState.test.tsx
similarity index 97%
rename from frontend-modern/src/components/Dashboard/__tests__/useStackedDiskBarState.test.tsx
rename to frontend-modern/src/components/Workloads/__tests__/useStackedDiskBarState.test.tsx
index de74a7be7d..9b9937bf48 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/useStackedDiskBarState.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/useStackedDiskBarState.test.tsx
@@ -1,7 +1,7 @@
import { afterEach, describe, expect, it, vi } from 'vitest';
import { cleanup, render } from '@solidjs/testing-library';
import type { Disk } from '@/types/api';
-import { useStackedDiskBarState } from '@/components/Dashboard/useStackedDiskBarState';
+import { useStackedDiskBarState } from '@/components/Workloads/useStackedDiskBarState';
class MockResizeObserver {
callback: ResizeObserverCallback;
diff --git a/frontend-modern/src/components/Dashboard/__tests__/useStackedMemoryBarState.test.tsx b/frontend-modern/src/components/Workloads/__tests__/useStackedMemoryBarState.test.tsx
similarity index 96%
rename from frontend-modern/src/components/Dashboard/__tests__/useStackedMemoryBarState.test.tsx
rename to frontend-modern/src/components/Workloads/__tests__/useStackedMemoryBarState.test.tsx
index 70b042aff4..2dddbc9f42 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/useStackedMemoryBarState.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/useStackedMemoryBarState.test.tsx
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, it, vi } from 'vitest';
import { cleanup, render } from '@solidjs/testing-library';
-import { useStackedMemoryBarState } from '@/components/Dashboard/useStackedMemoryBarState';
+import { useStackedMemoryBarState } from '@/components/Workloads/useStackedMemoryBarState';
class MockResizeObserver {
callback: ResizeObserverCallback;
diff --git a/frontend-modern/src/components/Dashboard/__tests__/useThresholdSliderState.test.ts b/frontend-modern/src/components/Workloads/__tests__/useThresholdSliderState.test.ts
similarity index 97%
rename from frontend-modern/src/components/Dashboard/__tests__/useThresholdSliderState.test.ts
rename to frontend-modern/src/components/Workloads/__tests__/useThresholdSliderState.test.ts
index fa84ada47c..0d7a371646 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/useThresholdSliderState.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/useThresholdSliderState.test.ts
@@ -1,6 +1,6 @@
import { cleanup, renderHook } from '@solidjs/testing-library';
import { describe, expect, it, vi } from 'vitest';
-import { useThresholdSliderState } from '@/components/Dashboard/useThresholdSliderState';
+import { useThresholdSliderState } from '@/components/Workloads/useThresholdSliderState';
vi.mock('@/utils/temperature', () => ({
formatTemperature: (value: number) => `${value}Β°C`,
diff --git a/frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.ts b/frontend-modern/src/components/Workloads/__tests__/useWorkloadSelectionState.test.ts
similarity index 94%
rename from frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.ts
rename to frontend-modern/src/components/Workloads/__tests__/useWorkloadSelectionState.test.ts
index faee018360..bcc370c440 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/useWorkloadSelectionState.test.ts
@@ -6,8 +6,8 @@ import type { SummarySeriesGroupScope } from '@/components/shared/summaryCardInt
import type { WorkloadGuest } from '@/types/workloads';
import { ROUTE_STATE_REPLACE_OPTIONS } from '@/utils/routeStateNavigation';
-import { resolveDashboardResourceSelection } from '../dashboardSelectionModel';
-import { useDashboardSelectionState } from '../useDashboardSelectionState';
+import { resolveWorkloadResourceSelection } from '../workloadSelectionModel';
+import { useWorkloadSelectionState } from '../useWorkloadSelectionState';
let locationSearch = '?resource=cluster-a:node-1:101';
const navigateSpy = vi.fn();
@@ -23,7 +23,7 @@ vi.mock('@solidjs/router', () => ({
useNavigate: () => navigateSpy,
}));
-describe('useDashboardSelectionState', () => {
+describe('useWorkloadSelectionState', () => {
beforeEach(() => {
locationSearch = '?resource=cluster-a:node-1:101';
navigateSpy.mockReset();
@@ -41,18 +41,18 @@ describe('useDashboardSelectionState', () => {
vi.unstubAllGlobals();
});
- it('owns dashboard resource deep-link selection without mutating workload filters', () => {
+ it('owns workloads resource deep-link selection without mutating workload filters', () => {
const [filteredGuests] = createSignal<WorkloadGuest[]>([]);
const { result } = renderHook(() =>
- useDashboardSelectionState({
+ useWorkloadSelectionState({
filteredGuests,
summaryGroupScopes: emptySummaryGroupScopes,
}),
);
expect(result.selectedGuestId()).toBe('cluster-a:node-1:101');
- expect(resolveDashboardResourceSelection(locationSearch)).toEqual({
+ expect(resolveWorkloadResourceSelection(locationSearch)).toEqual({
resourceId: 'cluster-a:node-1:101',
summaryGroupId: null,
});
@@ -70,7 +70,7 @@ describe('useDashboardSelectionState', () => {
const [filteredGuests, setFilteredGuests] = createSignal<WorkloadGuest[]>([guest]);
const { result } = renderHook(() =>
- useDashboardSelectionState({
+ useWorkloadSelectionState({
filteredGuests,
summaryGroupScopes: emptySummaryGroupScopes,
}),
@@ -88,14 +88,14 @@ describe('useDashboardSelectionState', () => {
const [filteredGuests] = createSignal<WorkloadGuest[]>([]);
const { result } = renderHook(() =>
- useDashboardSelectionState({
+ useWorkloadSelectionState({
filteredGuests,
summaryGroupScopes: emptySummaryGroupScopes,
}),
);
expect(result.selectedGuestId()).toBe('app-container:truenas-main:nextcloud');
- expect(resolveDashboardResourceSelection(locationSearch)).toEqual({
+ expect(resolveWorkloadResourceSelection(locationSearch)).toEqual({
resourceId: 'app-container:truenas-main:nextcloud',
summaryGroupId: null,
});
@@ -106,7 +106,7 @@ describe('useDashboardSelectionState', () => {
const [filteredGuests] = createSignal<WorkloadGuest[]>([]);
const { result } = renderHook(() =>
- useDashboardSelectionState({
+ useWorkloadSelectionState({
filteredGuests,
summaryGroupScopes: emptySummaryGroupScopes,
}),
@@ -138,7 +138,7 @@ describe('useDashboardSelectionState', () => {
]);
const { result } = renderHook(() =>
- useDashboardSelectionState({
+ useWorkloadSelectionState({
filteredGuests,
summaryGroupScopes: summaryScopes,
}),
@@ -160,7 +160,7 @@ describe('useDashboardSelectionState', () => {
const clearAdditionalPageStateOnEscape = vi.fn();
renderHook(() =>
- useDashboardSelectionState({
+ useWorkloadSelectionState({
clearAdditionalPageStateOnEscape,
filteredGuests,
summaryGroupScopes: emptySummaryGroupScopes,
@@ -182,7 +182,7 @@ describe('useDashboardSelectionState', () => {
const [filteredGuests] = createSignal<WorkloadGuest[]>([]);
const { result } = renderHook(() =>
- useDashboardSelectionState({
+ useWorkloadSelectionState({
filteredGuests,
summaryGroupScopes: emptySummaryGroupScopes,
}),
@@ -230,7 +230,7 @@ describe('useDashboardSelectionState', () => {
]);
const { result } = renderHook(() =>
- useDashboardSelectionState({
+ useWorkloadSelectionState({
filteredGuests,
summaryGroupScopes: emptySummaryGroupScopes,
}),
@@ -288,7 +288,7 @@ describe('useDashboardSelectionState', () => {
window.scrollTo = scrollToSpy as typeof window.scrollTo;
const { result } = renderHook(() =>
- useDashboardSelectionState({
+ useWorkloadSelectionState({
filteredGuests,
summaryGroupScopes: emptySummaryGroupScopes,
}),
@@ -369,7 +369,7 @@ describe('useDashboardSelectionState', () => {
};
const { result } = renderHook(() =>
- useDashboardSelectionState({
+ useWorkloadSelectionState({
filteredGuests,
summaryGroupScopes: emptySummaryGroupScopes,
}),
@@ -408,7 +408,7 @@ describe('useDashboardSelectionState', () => {
let top = 120;
const { result } = renderHook(() =>
- useDashboardSelectionState({
+ useWorkloadSelectionState({
filteredGuests,
summaryGroupScopes: summaryScopes,
}),
@@ -441,7 +441,7 @@ describe('useDashboardSelectionState', () => {
const [filteredGuests] = createSignal<WorkloadGuest[]>([]);
const { result } = renderHook(() =>
- useDashboardSelectionState({
+ useWorkloadSelectionState({
filteredGuests,
summaryGroupScopes: emptySummaryGroupScopes,
}),
diff --git a/frontend-modern/src/components/Dashboard/__tests__/useDashboardWorkloadViewportSync.test.tsx b/frontend-modern/src/components/Workloads/__tests__/useWorkloadViewportSync.test.tsx
similarity index 90%
rename from frontend-modern/src/components/Dashboard/__tests__/useDashboardWorkloadViewportSync.test.tsx
rename to frontend-modern/src/components/Workloads/__tests__/useWorkloadViewportSync.test.tsx
index ffb6aa3775..cbada5c8b0 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/useDashboardWorkloadViewportSync.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/useWorkloadViewportSync.test.tsx
@@ -2,15 +2,15 @@ import { afterEach, describe, expect, it, vi } from 'vitest';
import { cleanup, render, waitFor } from '@solidjs/testing-library';
import { createSignal } from 'solid-js';
-import { useDashboardWorkloadViewportSync } from '@/components/Dashboard/useDashboardWorkloadViewportSync';
-import type { UseGroupedTableWindowingResult } from '@/components/Dashboard/useGroupedTableWindowing';
+import { useWorkloadViewportSync } from '@/components/Workloads/useWorkloadViewportSync';
+import type { UseGroupedTableWindowingResult } from '@/components/Workloads/useGroupedTableWindowing';
afterEach(() => {
cleanup();
vi.restoreAllMocks();
});
-describe('useDashboardWorkloadViewportSync', () => {
+describe('useWorkloadViewportSync', () => {
it('owns grouped workload viewport sync and listener cleanup', async () => {
const onScroll = vi.fn();
const addEventListenerSpy = vi.spyOn(window, 'addEventListener');
@@ -28,7 +28,7 @@ describe('useDashboardWorkloadViewportSync', () => {
const Harness = () => {
const [bodyRef, setBodyRef] = createSignal<HTMLTableSectionElement | null>(null);
- useDashboardWorkloadViewportSync({
+ useWorkloadViewportSync({
filteredGuestCount: () => 640,
groupedWindowing,
rowHeight: 32,
diff --git a/frontend-modern/src/components/Dashboard/__tests__/useDashboardFilterState.test.ts b/frontend-modern/src/components/Workloads/__tests__/useWorkloadsFilterState.test.ts
similarity index 92%
rename from frontend-modern/src/components/Dashboard/__tests__/useDashboardFilterState.test.ts
rename to frontend-modern/src/components/Workloads/__tests__/useWorkloadsFilterState.test.ts
index fe617c851f..a46e525a00 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/useDashboardFilterState.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/useWorkloadsFilterState.test.ts
@@ -1,7 +1,7 @@
import { renderHook } from '@solidjs/testing-library';
import { createSignal } from 'solid-js';
import { describe, expect, it, vi } from 'vitest';
-import { useDashboardFilterState } from '@/components/Dashboard/useDashboardFilterState';
+import { useWorkloadsFilterState } from '@/components/Workloads/useWorkloadsFilterState';
vi.mock('@/hooks/useBreakpoint', () => ({
useBreakpoint: () => ({
@@ -9,8 +9,8 @@ vi.mock('@/hooks/useBreakpoint', () => ({
}),
}));
-describe('useDashboardFilterState', () => {
- it('centralizes dashboard filter state and reset behavior', () => {
+describe('useWorkloadsFilterState', () => {
+ it('centralizes workloads filter state and reset behavior', () => {
const [search, setSearch] = createSignal('query');
const [viewMode, setViewMode] = createSignal<
'all' | 'vm' | 'system-container' | 'app-container' | 'pod'
@@ -27,7 +27,7 @@ describe('useDashboardFilterState', () => {
const runtimeOnChange = vi.fn();
const { result } = renderHook(() =>
- useDashboardFilterState({
+ useWorkloadsFilterState({
search,
setSearch,
viewMode,
diff --git a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadFilterConfigModel.test.ts b/frontend-modern/src/components/Workloads/__tests__/workloadFilterConfigModel.test.ts
similarity index 73%
rename from frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadFilterConfigModel.test.ts
rename to frontend-modern/src/components/Workloads/__tests__/workloadFilterConfigModel.test.ts
index 11f5a1ea61..e1093299dc 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadFilterConfigModel.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/workloadFilterConfigModel.test.ts
@@ -1,26 +1,26 @@
import { describe, expect, it, vi } from 'vitest';
import {
- buildDashboardContainerRuntimeFilterConfig,
- buildDashboardHostFilterConfig,
- buildDashboardNamespaceFilterConfig,
- buildDashboardPlatformFilterConfig,
- buildDashboardPlatformFilterOptions,
- DASHBOARD_CONTAINER_RUNTIME_ALL_OPTION_LABEL,
- DASHBOARD_KUBERNETES_CONTEXT_ALL_OPTION_LABEL,
- DASHBOARD_KUBERNETES_CONTEXT_FILTER_LABEL,
- DASHBOARD_NAMESPACE_ALL_OPTION_LABEL,
- DASHBOARD_NODE_ALL_OPTION_LABEL,
- DASHBOARD_PLATFORM_ALL_OPTION_LABEL,
- DASHBOARD_WORKLOAD_TYPE_OPTIONS,
-} from '../dashboardWorkloadFilterConfigModel';
+ buildWorkloadsContainerRuntimeFilterConfig,
+ buildWorkloadsHostFilterConfig,
+ buildWorkloadsNamespaceFilterConfig,
+ buildWorkloadsPlatformFilterConfig,
+ buildWorkloadsPlatformFilterOptions,
+ WORKLOADS_CONTAINER_RUNTIME_ALL_OPTION_LABEL,
+ WORKLOADS_KUBERNETES_CONTEXT_ALL_OPTION_LABEL,
+ WORKLOADS_KUBERNETES_CONTEXT_FILTER_LABEL,
+ WORKLOADS_NAMESPACE_ALL_OPTION_LABEL,
+ WORKLOADS_NODE_ALL_OPTION_LABEL,
+ WORKLOADS_PLATFORM_ALL_OPTION_LABEL,
+ WORKLOAD_TYPE_OPTIONS,
+} from '../workloadFilterConfigModel';
-describe('dashboardWorkloadFilterConfigModel', () => {
+describe('workloadFilterConfigModel', () => {
it('builds container runtime config only for app-container workload routes', () => {
const onChange = vi.fn();
expect(
- buildDashboardContainerRuntimeFilterConfig({
+ buildWorkloadsContainerRuntimeFilterConfig({
isWorkloadsRoute: true,
viewMode: 'app-container',
containerRuntime: 'docker',
@@ -32,14 +32,14 @@ describe('dashboardWorkloadFilterConfigModel', () => {
label: 'Runtime',
value: 'docker',
options: [
- { value: '', label: DASHBOARD_CONTAINER_RUNTIME_ALL_OPTION_LABEL },
+ { value: '', label: WORKLOADS_CONTAINER_RUNTIME_ALL_OPTION_LABEL },
{ value: 'containerd', label: 'containerd' },
{ value: 'docker', label: 'docker' },
],
});
expect(
- buildDashboardContainerRuntimeFilterConfig({
+ buildWorkloadsContainerRuntimeFilterConfig({
isWorkloadsRoute: true,
viewMode: 'vm',
containerRuntime: 'docker',
@@ -54,7 +54,7 @@ describe('dashboardWorkloadFilterConfigModel', () => {
const onNodeChange = vi.fn();
expect(
- buildDashboardHostFilterConfig({
+ buildWorkloadsHostFilterConfig({
isWorkloadsRoute: true,
viewMode: 'pod',
selectedKubernetesContext: 'prod',
@@ -66,17 +66,17 @@ describe('dashboardWorkloadFilterConfigModel', () => {
}),
).toMatchObject({
id: 'workloads-k8s-context-filter',
- label: DASHBOARD_KUBERNETES_CONTEXT_FILTER_LABEL,
+ label: WORKLOADS_KUBERNETES_CONTEXT_FILTER_LABEL,
value: 'prod',
options: [
- { value: '', label: DASHBOARD_KUBERNETES_CONTEXT_ALL_OPTION_LABEL },
+ { value: '', label: WORKLOADS_KUBERNETES_CONTEXT_ALL_OPTION_LABEL },
{ value: 'prod', label: 'prod' },
{ value: 'stage', label: 'stage' },
],
});
expect(
- buildDashboardHostFilterConfig({
+ buildWorkloadsHostFilterConfig({
isWorkloadsRoute: true,
viewMode: 'vm',
selectedKubernetesContext: null,
@@ -91,7 +91,7 @@ describe('dashboardWorkloadFilterConfigModel', () => {
label: 'Node',
value: 'cluster-a-node-a',
options: [
- { value: '', label: DASHBOARD_NODE_ALL_OPTION_LABEL },
+ { value: '', label: WORKLOADS_NODE_ALL_OPTION_LABEL },
{ value: 'cluster-a-node-a', label: 'node-a' },
],
});
@@ -101,7 +101,7 @@ describe('dashboardWorkloadFilterConfigModel', () => {
const onChange = vi.fn();
expect(
- buildDashboardNamespaceFilterConfig({
+ buildWorkloadsNamespaceFilterConfig({
isWorkloadsRoute: true,
viewMode: 'pod',
selectedNamespace: 'default',
@@ -113,14 +113,14 @@ describe('dashboardWorkloadFilterConfigModel', () => {
label: 'Namespace',
value: 'default',
options: [
- { value: '', label: DASHBOARD_NAMESPACE_ALL_OPTION_LABEL },
+ { value: '', label: WORKLOADS_NAMESPACE_ALL_OPTION_LABEL },
{ value: 'default', label: 'default' },
{ value: 'kube-system', label: 'kube-system' },
],
});
expect(
- buildDashboardNamespaceFilterConfig({
+ buildWorkloadsNamespaceFilterConfig({
isWorkloadsRoute: true,
viewMode: 'pod',
selectedNamespace: 'default',
@@ -134,7 +134,7 @@ describe('dashboardWorkloadFilterConfigModel', () => {
const onChange = vi.fn();
expect(
- buildDashboardPlatformFilterConfig({
+ buildWorkloadsPlatformFilterConfig({
isWorkloadsRoute: true,
selectedPlatform: 'truenas',
platformOptions: [
@@ -148,7 +148,7 @@ describe('dashboardWorkloadFilterConfigModel', () => {
label: 'Platform',
value: 'truenas',
options: [
- { value: '', label: DASHBOARD_PLATFORM_ALL_OPTION_LABEL },
+ { value: '', label: WORKLOADS_PLATFORM_ALL_OPTION_LABEL },
{ value: 'docker', label: 'Docker' },
{ value: 'truenas', label: 'TrueNAS' },
],
@@ -157,12 +157,12 @@ describe('dashboardWorkloadFilterConfigModel', () => {
it('keeps the selected platform selectable when the current type narrows available options', () => {
expect(
- buildDashboardPlatformFilterOptions('proxmox-pve', [
+ buildWorkloadsPlatformFilterOptions('proxmox-pve', [
{ value: 'truenas', label: 'TrueNAS' },
{ value: 'docker', label: 'Docker / Podman' },
]),
).toEqual([
- { value: '', label: DASHBOARD_PLATFORM_ALL_OPTION_LABEL },
+ { value: '', label: WORKLOADS_PLATFORM_ALL_OPTION_LABEL },
{ value: 'proxmox-pve', label: 'PVE' },
{ value: 'truenas', label: 'TrueNAS' },
{ value: 'docker', label: 'Docker / Podman' },
@@ -170,7 +170,7 @@ describe('dashboardWorkloadFilterConfigModel', () => {
});
it('keeps workload type filter labels in the presentation model', () => {
- expect(DASHBOARD_WORKLOAD_TYPE_OPTIONS).toEqual([
+ expect(WORKLOAD_TYPE_OPTIONS).toEqual([
{ value: 'all', label: 'All' },
{ value: 'vm', label: 'VMs' },
{ value: 'system-container', label: 'System containers' },
diff --git a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteModel.test.ts b/frontend-modern/src/components/Workloads/__tests__/workloadRouteModel.test.ts
similarity index 82%
rename from frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteModel.test.ts
rename to frontend-modern/src/components/Workloads/__tests__/workloadRouteModel.test.ts
index ed7b5de477..2ef791402f 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteModel.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/workloadRouteModel.test.ts
@@ -2,13 +2,13 @@ import { describe, expect, it } from 'vitest';
import type { WorkloadGuest } from '@/types/workloads';
import {
- buildDashboardContainerRuntimeOptions,
- buildDashboardKubernetesContextOptions,
- buildDashboardKubernetesNamespaceOptions,
- buildDashboardPlatformOptions,
- buildDashboardWorkloadNodeOptions,
- deserializeDashboardWorkloadViewMode,
-} from '../dashboardWorkloadRouteModel';
+ buildWorkloadsContainerRuntimeOptions,
+ buildWorkloadsKubernetesContextOptions,
+ buildWorkloadsKubernetesNamespaceOptions,
+ buildWorkloadsPlatformOptions,
+ buildWorkloadNodeOptions,
+ deserializeWorkloadViewMode,
+} from '../workloadRouteModel';
const makeGuest = (overrides?: Partial<WorkloadGuest>): WorkloadGuest =>
({
@@ -37,17 +37,17 @@ const makeGuest = (overrides?: Partial<WorkloadGuest>): WorkloadGuest =>
...overrides,
}) as WorkloadGuest;
-describe('dashboardWorkloadRouteModel', () => {
+describe('workloadRouteModel', () => {
it('deserializes persisted workload view-mode aliases through the canonical helper', () => {
- expect(deserializeDashboardWorkloadViewMode('all')).toBe('all');
- expect(deserializeDashboardWorkloadViewMode('docker')).toBe('app-container');
- expect(deserializeDashboardWorkloadViewMode('Kubernetes')).toBe('pod');
- expect(deserializeDashboardWorkloadViewMode('invalid')).toBe('all');
- expect(deserializeDashboardWorkloadViewMode(null)).toBe('all');
+ expect(deserializeWorkloadViewMode('all')).toBe('all');
+ expect(deserializeWorkloadViewMode('docker')).toBe('app-container');
+ expect(deserializeWorkloadViewMode('Kubernetes')).toBe('pod');
+ expect(deserializeWorkloadViewMode('invalid')).toBe('all');
+ expect(deserializeWorkloadViewMode(null)).toBe('all');
});
it('builds workload node options with instance disambiguation only when needed', () => {
- const options = buildDashboardWorkloadNodeOptions([
+ const options = buildWorkloadNodeOptions([
makeGuest({ id: 'vm-a', node: 'node-a', instance: 'cluster-a' }),
makeGuest({ id: 'vm-b', node: 'node-a', instance: 'cluster-b' }),
makeGuest({ id: 'vm-c', node: 'node-z', instance: 'cluster-a' }),
@@ -62,7 +62,7 @@ describe('dashboardWorkloadRouteModel', () => {
});
it('builds app-container host options from Docker host ids and host labels', () => {
- const options = buildDashboardWorkloadNodeOptions([
+ const options = buildWorkloadNodeOptions([
makeGuest({
id: 'docker-a',
type: 'app-container',
@@ -124,15 +124,15 @@ describe('dashboardWorkloadRouteModel', () => {
}),
];
- expect(buildDashboardKubernetesContextOptions(guests)).toEqual(['prod', 'stage']);
- expect(buildDashboardKubernetesNamespaceOptions(guests, 'prod')).toEqual([
+ expect(buildWorkloadsKubernetesContextOptions(guests)).toEqual(['prod', 'stage']);
+ expect(buildWorkloadsKubernetesNamespaceOptions(guests, 'prod')).toEqual([
'default',
'kube-system',
]);
});
it('builds container runtime options from canonical app-container guests', () => {
expect(
- buildDashboardContainerRuntimeOptions([
+ buildWorkloadsContainerRuntimeOptions([
makeGuest({
id: 'docker-a',
type: 'app-container',
@@ -157,7 +157,7 @@ describe('dashboardWorkloadRouteModel', () => {
it('builds canonical platform options from visible workload platforms', () => {
expect(
- buildDashboardPlatformOptions(
+ buildWorkloadsPlatformOptions(
[
makeGuest({
id: 'app-a',
@@ -211,10 +211,10 @@ describe('dashboardWorkloadRouteModel', () => {
}),
];
- expect(buildDashboardKubernetesNamespaceOptions(guests, 'prod')).toEqual([
+ expect(buildWorkloadsKubernetesNamespaceOptions(guests, 'prod')).toEqual([
'default',
'kube-system',
]);
- expect(buildDashboardKubernetesNamespaceOptions(guests, 'stage')).toEqual(['observability']);
+ expect(buildWorkloadsKubernetesNamespaceOptions(guests, 'stage')).toEqual(['observability']);
});
});
diff --git a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteStateModel.test.ts b/frontend-modern/src/components/Workloads/__tests__/workloadRouteStateModel.test.ts
similarity index 63%
rename from frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteStateModel.test.ts
rename to frontend-modern/src/components/Workloads/__tests__/workloadRouteStateModel.test.ts
index aaa6bf77f0..b95717477f 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteStateModel.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/workloadRouteStateModel.test.ts
@@ -1,21 +1,21 @@
import { describe, expect, it } from 'vitest';
import {
- DASHBOARD_WORKLOAD_ROUTE_RESET_STATE,
- deserializeDashboardContainerRuntime,
- resolveDashboardWorkloadNodeSelection,
-} from '../dashboardWorkloadRouteStateModel';
+ WORKLOADS_WORKLOAD_ROUTE_RESET_STATE,
+ deserializeWorkloadsContainerRuntime,
+ resolveWorkloadsWorkloadNodeSelection,
+} from '../workloadRouteStateModel';
-describe('dashboardWorkloadRouteStateModel', () => {
+describe('workloadRouteStateModel', () => {
it('deserializes persisted container runtime values through the canonical helper', () => {
- expect(deserializeDashboardContainerRuntime('docker')).toBe('docker');
- expect(deserializeDashboardContainerRuntime('')).toBe('');
- expect(deserializeDashboardContainerRuntime(null)).toBe('');
- expect(deserializeDashboardContainerRuntime(42)).toBe('');
+ expect(deserializeWorkloadsContainerRuntime('docker')).toBe('docker');
+ expect(deserializeWorkloadsContainerRuntime('')).toBe('');
+ expect(deserializeWorkloadsContainerRuntime(null)).toBe('');
+ expect(deserializeWorkloadsContainerRuntime(42)).toBe('');
});
it('exports the canonical workload-route reset state', () => {
- expect(DASHBOARD_WORKLOAD_ROUTE_RESET_STATE).toEqual({
+ expect(WORKLOADS_WORKLOAD_ROUTE_RESET_STATE).toEqual({
selectedNode: null,
selectedHostHint: null,
selectedPlatform: null,
@@ -28,7 +28,7 @@ describe('dashboardWorkloadRouteStateModel', () => {
it('applies host-node selection only for pve or neutral route contexts', () => {
expect(
- resolveDashboardWorkloadNodeSelection({
+ resolveWorkloadsWorkloadNodeSelection({
nodeId: 'cluster-a-node-a',
nodeType: 'pve',
showFilters: false,
@@ -41,7 +41,7 @@ describe('dashboardWorkloadRouteStateModel', () => {
});
expect(
- resolveDashboardWorkloadNodeSelection({
+ resolveWorkloadsWorkloadNodeSelection({
nodeId: 'cluster-a-node-a',
nodeType: 'pbs',
showFilters: false,
diff --git a/frontend-modern/src/components/Dashboard/__tests__/dashboardSelectionModel.test.ts b/frontend-modern/src/components/Workloads/__tests__/workloadSelectionModel.test.ts
similarity index 73%
rename from frontend-modern/src/components/Dashboard/__tests__/dashboardSelectionModel.test.ts
rename to frontend-modern/src/components/Workloads/__tests__/workloadSelectionModel.test.ts
index e9461b6f01..82d66624b9 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/dashboardSelectionModel.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/workloadSelectionModel.test.ts
@@ -3,19 +3,19 @@ import { describe, expect, it } from 'vitest';
import type { WorkloadGuest } from '@/types/workloads';
import {
- dashboardHasHoveredWorkload,
- resolveDashboardResourceSelection,
- resolveDashboardSelectionNavigateTarget,
-} from '../dashboardSelectionModel';
+ workloadsHasHoveredWorkload,
+ resolveWorkloadResourceSelection,
+ resolveWorkloadsSelectionNavigateTarget,
+} from '../workloadSelectionModel';
-describe('dashboardSelectionModel', () => {
- it('resolves dashboard resource deep links into focused guest ids without inventing filters', () => {
- expect(resolveDashboardResourceSelection('?resource=cluster-a:node-1:101')).toEqual({
+describe('workloadSelectionModel', () => {
+ it('resolves workloads resource deep links into focused guest ids without inventing filters', () => {
+ expect(resolveWorkloadResourceSelection('?resource=cluster-a:node-1:101')).toEqual({
resourceId: 'cluster-a:node-1:101',
summaryGroupId: null,
});
expect(
- resolveDashboardResourceSelection(
+ resolveWorkloadResourceSelection(
'?type=app-container&resource=app-container:truenas-main:nextcloud',
),
).toEqual({
@@ -23,16 +23,16 @@ describe('dashboardSelectionModel', () => {
summaryGroupId: null,
});
expect(
- resolveDashboardResourceSelection('?resource=app-container:docker-main:container-123'),
+ resolveWorkloadResourceSelection('?resource=app-container:docker-main:container-123'),
).toEqual({
resourceId: 'app-container:docker-main:container-123',
summaryGroupId: null,
});
- expect(resolveDashboardResourceSelection('?resource=guest-1')).toEqual({
+ expect(resolveWorkloadResourceSelection('?resource=guest-1')).toEqual({
resourceId: 'guest-1',
summaryGroupId: null,
});
- expect(resolveDashboardResourceSelection('')).toBeNull();
+ expect(resolveWorkloadResourceSelection('')).toBeNull();
});
it('checks hovered workload continuity against canonical workload ids', () => {
@@ -47,13 +47,13 @@ describe('dashboardSelectionModel', () => {
} as unknown as WorkloadGuest,
];
- expect(dashboardHasHoveredWorkload(guests, 'cluster-a:node-1:101')).toBe(true);
- expect(dashboardHasHoveredWorkload(guests, 'cluster-a:node-1:102')).toBe(false);
+ expect(workloadsHasHoveredWorkload(guests, 'cluster-a:node-1:101')).toBe(true);
+ expect(workloadsHasHoveredWorkload(guests, 'cluster-a:node-1:102')).toBe(false);
});
it('builds route-backed workload selection targets without dropping other filters', () => {
expect(
- resolveDashboardSelectionNavigateTarget({
+ resolveWorkloadsSelectionNavigateTarget({
pathname: '/workloads',
search: '?type=app-container&platform=truenas&agent=truenas-main',
resourceId: 'app-container:truenas-main:nextcloud',
@@ -64,7 +64,7 @@ describe('dashboardSelectionModel', () => {
);
expect(
- resolveDashboardSelectionNavigateTarget({
+ resolveWorkloadsSelectionNavigateTarget({
pathname: '/workloads',
search:
'?type=app-container&platform=truenas&agent=truenas-main&resource=app-container%3Atruenas-main%3Anextcloud',
@@ -74,7 +74,7 @@ describe('dashboardSelectionModel', () => {
).toBe('/workloads?type=app-container&platform=truenas&agent=truenas-main');
expect(
- resolveDashboardSelectionNavigateTarget({
+ resolveWorkloadsSelectionNavigateTarget({
pathname: '/workloads',
search:
'?type=app-container&platform=truenas&agent=truenas-main&resource=app-container%3Atruenas-main%3Anextcloud',
@@ -84,7 +84,7 @@ describe('dashboardSelectionModel', () => {
).toBeNull();
expect(
- resolveDashboardSelectionNavigateTarget({
+ resolveWorkloadsSelectionNavigateTarget({
pathname: '/workloads',
search: '?type=app-container&platform=truenas&agent=truenas-main',
resourceId: null,
@@ -95,7 +95,7 @@ describe('dashboardSelectionModel', () => {
);
expect(
- resolveDashboardSelectionNavigateTarget({
+ resolveWorkloadsSelectionNavigateTarget({
pathname: '/workloads',
search:
'?type=app-container&platform=truenas&agent=truenas-main&summaryGroup=docker-host%3Atruenas-main',
diff --git a/frontend-modern/src/components/Dashboard/__tests__/workloadSelectors.test.ts b/frontend-modern/src/components/Workloads/__tests__/workloadSelectors.test.ts
similarity index 99%
rename from frontend-modern/src/components/Dashboard/__tests__/workloadSelectors.test.ts
rename to frontend-modern/src/components/Workloads/__tests__/workloadSelectors.test.ts
index d4d145c639..4b1321d46a 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/workloadSelectors.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/workloadSelectors.test.ts
@@ -8,8 +8,8 @@ import {
getDiskUsagePercent,
getWorkloadGroupKey,
groupWorkloads,
-} from '@/components/Dashboard/workloadSelectors';
-import { workloadNodeScopeId } from '@/components/Dashboard/workloadTopology';
+} from '@/components/Workloads/workloadSelectors';
+import { workloadNodeScopeId } from '@/components/Workloads/workloadTopology';
const makeGuest = (i: number, overrides?: Partial<WorkloadGuest>): WorkloadGuest => ({
id: `guest-${i}`,
diff --git a/frontend-modern/src/components/Dashboard/__tests__/workloadTopology.test.ts b/frontend-modern/src/components/Workloads/__tests__/workloadTopology.test.ts
similarity index 99%
rename from frontend-modern/src/components/Dashboard/__tests__/workloadTopology.test.ts
rename to frontend-modern/src/components/Workloads/__tests__/workloadTopology.test.ts
index 6dd7b7cb2d..286c6a4ee1 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/workloadTopology.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/workloadTopology.test.ts
@@ -10,7 +10,7 @@ import {
getKubernetesContextKey,
getWorkloadDockerHostId,
workloadNodeScopeId,
-} from '@/components/Dashboard/workloadTopology';
+} from '@/components/Workloads/workloadTopology';
const makeGuest = (i: number, overrides?: Partial<WorkloadGuest>): WorkloadGuest => ({
id: `guest-${i}`,
diff --git a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadUrlSyncModel.test.ts b/frontend-modern/src/components/Workloads/__tests__/workloadUrlSyncModel.test.ts
similarity index 82%
rename from frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadUrlSyncModel.test.ts
rename to frontend-modern/src/components/Workloads/__tests__/workloadUrlSyncModel.test.ts
index b262d94d92..889f52de0b 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadUrlSyncModel.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/workloadUrlSyncModel.test.ts
@@ -1,16 +1,16 @@
import { describe, expect, it } from 'vitest';
import {
- parseDashboardWorkloadUrlParams,
- resolveDashboardManagedWorkloadsNavigateTarget,
- resolveDashboardWorkloadRuntimeParam,
- resolveDashboardWorkloadTypeParam,
-} from '../dashboardWorkloadUrlSyncModel';
+ parseWorkloadsWorkloadUrlParams,
+ resolveWorkloadsManagedWorkloadsNavigateTarget,
+ resolveWorkloadsWorkloadRuntimeParam,
+ resolveWorkloadsWorkloadTypeParam,
+} from '../workloadUrlSyncModel';
-describe('dashboardWorkloadUrlSyncModel', () => {
+describe('workloadUrlSyncModel', () => {
it('parses canonical workload route params and keeps resource deep links intact', () => {
expect(
- parseDashboardWorkloadUrlParams(
+ parseWorkloadsWorkloadUrlParams(
'?type=docker&platform=truenas&runtime=containerd&context=prod&namespace=default&agent=node-a&resource=guest-1',
),
).toEqual({
@@ -27,7 +27,7 @@ describe('dashboardWorkloadUrlSyncModel', () => {
it('resolves workload type params through the canonical alias rules and k8s precedence', () => {
expect(
- resolveDashboardWorkloadTypeParam({
+ resolveWorkloadsWorkloadTypeParam({
type: 'docker',
platform: '',
runtime: '',
@@ -38,7 +38,7 @@ describe('dashboardWorkloadUrlSyncModel', () => {
}),
).toBe('app-container');
expect(
- resolveDashboardWorkloadTypeParam({
+ resolveWorkloadsWorkloadTypeParam({
type: 'vm',
platform: '',
runtime: '',
@@ -52,7 +52,7 @@ describe('dashboardWorkloadUrlSyncModel', () => {
it('only applies runtime params when the url semantics still resolve to app-container scope', () => {
expect(
- resolveDashboardWorkloadRuntimeParam({
+ resolveWorkloadsWorkloadRuntimeParam({
type: 'docker',
platform: '',
runtime: 'containerd',
@@ -68,7 +68,7 @@ describe('dashboardWorkloadUrlSyncModel', () => {
});
expect(
- resolveDashboardWorkloadRuntimeParam({
+ resolveWorkloadsWorkloadRuntimeParam({
type: 'vm',
platform: '',
runtime: 'containerd',
@@ -86,7 +86,7 @@ describe('dashboardWorkloadUrlSyncModel', () => {
it('builds managed workload navigate targets without dropping unrelated resource params', () => {
expect(
- resolveDashboardManagedWorkloadsNavigateTarget({
+ resolveWorkloadsManagedWorkloadsNavigateTarget({
currentSearch: '?resource=guest-1&type=vm&agent=node-a',
viewMode: 'pod',
containerRuntime: 'docker',
@@ -99,7 +99,7 @@ describe('dashboardWorkloadUrlSyncModel', () => {
).toBe('/workloads?resource=guest-1&type=pod&platform=kubernetes&context=prod&namespace=default');
expect(
- resolveDashboardManagedWorkloadsNavigateTarget({
+ resolveWorkloadsManagedWorkloadsNavigateTarget({
currentSearch: '?type=pod&context=prod&namespace=default',
viewMode: 'pod',
containerRuntime: '',
diff --git a/frontend-modern/src/components/Workloads/diskListModel.ts b/frontend-modern/src/components/Workloads/diskListModel.ts
new file mode 100644
index 0000000000..d3ff81dce4
--- /dev/null
+++ b/frontend-modern/src/components/Workloads/diskListModel.ts
@@ -0,0 +1,71 @@
+import type { Disk } from '@/types/api';
+
+import { formatBytes } from '@/utils/format';
+import { getMetricColorClass } from '@/utils/metricThresholds';
+
+export interface DiskListProps {
+ disks: Disk[];
+ diskStatusReason?: string;
+}
+
+export interface WorkloadsDiskPresentation {
+ key: string;
+ label: string;
+ labelTitle?: string;
+ progressClass: string;
+ progressWidth: string;
+ typeLabel: string;
+ usageText: string;
+ usagePercentLabel: string;
+}
+
+export const hasWorkloadsDiskCapacity = (disk: Disk): boolean =>
+ typeof disk.total === 'number' && disk.total > 0;
+
+export const getWorkloadsDiskUsagePercent = (disk: Disk): number => {
+ if (!hasWorkloadsDiskCapacity(disk)) {
+ return 0;
+ }
+
+ return (disk.used / disk.total) * 100;
+};
+
+export const getWorkloadsDiskLabel = (disk: Disk): string =>
+ disk.mountpoint || disk.device || 'Unknown';
+
+export const getWorkloadsDiskLabelTitle = (label: string): string | undefined =>
+ label !== 'Unknown' ? label : undefined;
+
+export const getWorkloadsDiskUsageText = (disk: Disk): string =>
+ hasWorkloadsDiskCapacity(disk)
+ ? `${formatBytes(disk.used)}/${formatBytes(disk.total)}`
+ : 'Usage unavailable';
+
+export const getWorkloadsDiskUsagePercentLabel = (disk: Disk): string =>
+ hasWorkloadsDiskCapacity(disk) ? `${getWorkloadsDiskUsagePercent(disk).toFixed(0)}%` : 'β€”';
+
+export const getWorkloadsDiskProgressClass = (disk: Disk): string =>
+ getMetricColorClass(getWorkloadsDiskUsagePercent(disk), 'disk');
+
+export const getWorkloadsDiskProgressWidth = (disk: Disk): string =>
+ `${Math.min(getWorkloadsDiskUsagePercent(disk), 100)}%`;
+
+export const getWorkloadsDiskTypeLabel = (disk: Disk): string => disk.type?.toUpperCase() ?? '';
+
+export const buildWorkloadsDiskPresentation = (
+ disk: Disk,
+ index: number,
+): WorkloadsDiskPresentation => {
+ const label = getWorkloadsDiskLabel(disk);
+
+ return {
+ key: `${disk.mountpoint ?? ''}:${disk.device ?? ''}:${index}`,
+ label,
+ labelTitle: getWorkloadsDiskLabelTitle(label),
+ progressClass: getWorkloadsDiskProgressClass(disk),
+ progressWidth: getWorkloadsDiskProgressWidth(disk),
+ typeLabel: getWorkloadsDiskTypeLabel(disk),
+ usageText: getWorkloadsDiskUsageText(disk),
+ usagePercentLabel: getWorkloadsDiskUsagePercentLabel(disk),
+ };
+};
diff --git a/frontend-modern/src/components/Dashboard/enhancedCpuBarModel.ts b/frontend-modern/src/components/Workloads/enhancedCpuBarModel.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/enhancedCpuBarModel.ts
rename to frontend-modern/src/components/Workloads/enhancedCpuBarModel.ts
diff --git a/frontend-modern/src/components/Dashboard/guestDrawerModel.ts b/frontend-modern/src/components/Workloads/guestDrawerModel.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/guestDrawerModel.ts
rename to frontend-modern/src/components/Workloads/guestDrawerModel.ts
diff --git a/frontend-modern/src/components/Dashboard/guestRowModel.tsx b/frontend-modern/src/components/Workloads/guestRowModel.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/guestRowModel.tsx
rename to frontend-modern/src/components/Workloads/guestRowModel.tsx
diff --git a/frontend-modern/src/components/Dashboard/metricBarModel.ts b/frontend-modern/src/components/Workloads/metricBarModel.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/metricBarModel.ts
rename to frontend-modern/src/components/Workloads/metricBarModel.ts
diff --git a/frontend-modern/src/components/Dashboard/stackedDiskBarModel.ts b/frontend-modern/src/components/Workloads/stackedDiskBarModel.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/stackedDiskBarModel.ts
rename to frontend-modern/src/components/Workloads/stackedDiskBarModel.ts
diff --git a/frontend-modern/src/components/Dashboard/stackedMemoryBarModel.ts b/frontend-modern/src/components/Workloads/stackedMemoryBarModel.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/stackedMemoryBarModel.ts
rename to frontend-modern/src/components/Workloads/stackedMemoryBarModel.ts
diff --git a/frontend-modern/src/components/Dashboard/thresholdSliderModel.ts b/frontend-modern/src/components/Workloads/thresholdSliderModel.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/thresholdSliderModel.ts
rename to frontend-modern/src/components/Workloads/thresholdSliderModel.ts
diff --git a/frontend-modern/src/components/Dashboard/useDiskListState.ts b/frontend-modern/src/components/Workloads/useDiskListState.ts
similarity index 57%
rename from frontend-modern/src/components/Dashboard/useDiskListState.ts
rename to frontend-modern/src/components/Workloads/useDiskListState.ts
index 15f265966e..ef38bec9e2 100644
--- a/frontend-modern/src/components/Dashboard/useDiskListState.ts
+++ b/frontend-modern/src/components/Workloads/useDiskListState.ts
@@ -1,16 +1,16 @@
import { createMemo } from 'solid-js';
-import { getDashboardGuestDiskStatusMessage } from '@/utils/dashboardGuestPresentation';
+import { getWorkloadGuestDiskStatusMessage } from '@/utils/workloadGuestPresentation';
-import { buildDashboardDiskPresentation, type DiskListProps } from './diskListModel';
+import { buildWorkloadsDiskPresentation, type DiskListProps } from './diskListModel';
export function useDiskListState(props: DiskListProps) {
const hasDisks = createMemo(() => props.disks.length > 0);
const diskStatusTooltip = createMemo(() =>
- getDashboardGuestDiskStatusMessage(props.diskStatusReason),
+ getWorkloadGuestDiskStatusMessage(props.diskStatusReason),
);
const diskPresentation = createMemo(() =>
- props.disks.map((disk, index) => buildDashboardDiskPresentation(disk, index)),
+ props.disks.map((disk, index) => buildWorkloadsDiskPresentation(disk, index)),
);
return {
diff --git a/frontend-modern/src/components/Dashboard/useEnhancedCPUBarState.ts b/frontend-modern/src/components/Workloads/useEnhancedCPUBarState.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/useEnhancedCPUBarState.ts
rename to frontend-modern/src/components/Workloads/useEnhancedCPUBarState.ts
diff --git a/frontend-modern/src/components/Dashboard/useGroupedTableWindowing.ts b/frontend-modern/src/components/Workloads/useGroupedTableWindowing.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/useGroupedTableWindowing.ts
rename to frontend-modern/src/components/Workloads/useGroupedTableWindowing.ts
diff --git a/frontend-modern/src/components/Dashboard/useGuestDrawerState.ts b/frontend-modern/src/components/Workloads/useGuestDrawerState.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/useGuestDrawerState.ts
rename to frontend-modern/src/components/Workloads/useGuestDrawerState.ts
diff --git a/frontend-modern/src/components/Dashboard/useGuestRowState.ts b/frontend-modern/src/components/Workloads/useGuestRowState.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/useGuestRowState.ts
rename to frontend-modern/src/components/Workloads/useGuestRowState.ts
diff --git a/frontend-modern/src/components/Dashboard/useMetricBarState.ts b/frontend-modern/src/components/Workloads/useMetricBarState.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/useMetricBarState.ts
rename to frontend-modern/src/components/Workloads/useMetricBarState.ts
diff --git a/frontend-modern/src/components/Dashboard/useStackedDiskBarState.ts b/frontend-modern/src/components/Workloads/useStackedDiskBarState.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/useStackedDiskBarState.ts
rename to frontend-modern/src/components/Workloads/useStackedDiskBarState.ts
diff --git a/frontend-modern/src/components/Dashboard/useStackedMemoryBarState.ts b/frontend-modern/src/components/Workloads/useStackedMemoryBarState.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/useStackedMemoryBarState.ts
rename to frontend-modern/src/components/Workloads/useStackedMemoryBarState.ts
diff --git a/frontend-modern/src/components/Dashboard/useThresholdSliderState.ts b/frontend-modern/src/components/Workloads/useThresholdSliderState.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/useThresholdSliderState.ts
rename to frontend-modern/src/components/Workloads/useThresholdSliderState.ts
diff --git a/frontend-modern/src/components/Dashboard/useDashboardWorkloadFilterOptions.ts b/frontend-modern/src/components/Workloads/useWorkloadFilterOptions.ts
similarity index 67%
rename from frontend-modern/src/components/Dashboard/useDashboardWorkloadFilterOptions.ts
rename to frontend-modern/src/components/Workloads/useWorkloadFilterOptions.ts
index 0595609add..6926e5718d 100644
--- a/frontend-modern/src/components/Dashboard/useDashboardWorkloadFilterOptions.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadFilterOptions.ts
@@ -1,22 +1,22 @@
import { createMemo, type Accessor } from 'solid-js';
import type { WorkloadGuest, ViewMode } from '@/types/workloads';
-import type { DashboardToolbarFilterConfig } from './dashboardFilterModel';
+import type { WorkloadsToolbarFilterConfig } from './workloadsFilterModel';
import {
- buildDashboardContainerRuntimeOptions,
- buildDashboardKubernetesContextOptions,
- buildDashboardPlatformOptions,
- buildDashboardKubernetesNamespaceOptions,
- buildDashboardWorkloadNodeOptions,
-} from './dashboardWorkloadRouteModel';
+ buildWorkloadsContainerRuntimeOptions,
+ buildWorkloadsKubernetesContextOptions,
+ buildWorkloadsPlatformOptions,
+ buildWorkloadsKubernetesNamespaceOptions,
+ buildWorkloadNodeOptions,
+} from './workloadRouteModel';
import {
- buildDashboardContainerRuntimeFilterConfig,
- buildDashboardHostFilterConfig,
- buildDashboardPlatformFilterConfig,
- buildDashboardNamespaceFilterConfig,
-} from './dashboardWorkloadFilterConfigModel';
+ buildWorkloadsContainerRuntimeFilterConfig,
+ buildWorkloadsHostFilterConfig,
+ buildWorkloadsPlatformFilterConfig,
+ buildWorkloadsNamespaceFilterConfig,
+} from './workloadFilterConfigModel';
-interface DashboardWorkloadFilterOptionsOptions {
+interface WorkloadsWorkloadFilterOptionsOptions {
allGuests: Accessor<WorkloadGuest[]>;
isWorkloadsRoute: Accessor<boolean>;
viewMode: Accessor<ViewMode>;
@@ -32,34 +32,34 @@ interface DashboardWorkloadFilterOptionsOptions {
setSelectedKubernetesNamespace: (value: string | null) => void;
}
-export function useDashboardWorkloadFilterOptions(
- options: DashboardWorkloadFilterOptionsOptions,
+export function useWorkloadFilterOptions(
+ options: WorkloadsWorkloadFilterOptionsOptions,
) {
const workloadNodeOptions = createMemo(() =>
- buildDashboardWorkloadNodeOptions(options.allGuests()),
+ buildWorkloadNodeOptions(options.allGuests()),
);
const kubernetesContextOptions = createMemo(() =>
- buildDashboardKubernetesContextOptions(options.allGuests()),
+ buildWorkloadsKubernetesContextOptions(options.allGuests()),
);
const kubernetesNamespaceOptions = createMemo(() =>
- buildDashboardKubernetesNamespaceOptions(
+ buildWorkloadsKubernetesNamespaceOptions(
options.allGuests(),
options.selectedKubernetesContext(),
),
);
const containerRuntimeOptions = createMemo(() =>
- buildDashboardContainerRuntimeOptions(options.allGuests()),
+ buildWorkloadsContainerRuntimeOptions(options.allGuests()),
);
const platformOptions = createMemo(() =>
- buildDashboardPlatformOptions(options.allGuests(), options.viewMode()),
+ buildWorkloadsPlatformOptions(options.allGuests(), options.viewMode()),
);
- const containerRuntimeFilterConfig = createMemo<DashboardToolbarFilterConfig | undefined>(() =>
- buildDashboardContainerRuntimeFilterConfig({
+ const containerRuntimeFilterConfig = createMemo<WorkloadsToolbarFilterConfig | undefined>(() =>
+ buildWorkloadsContainerRuntimeFilterConfig({
isWorkloadsRoute: options.isWorkloadsRoute(),
viewMode: options.viewMode(),
containerRuntime: options.containerRuntime(),
@@ -68,8 +68,8 @@ export function useDashboardWorkloadFilterOptions(
}),
);
- const platformFilterConfig = createMemo<DashboardToolbarFilterConfig | undefined>(() =>
- buildDashboardPlatformFilterConfig({
+ const platformFilterConfig = createMemo<WorkloadsToolbarFilterConfig | undefined>(() =>
+ buildWorkloadsPlatformFilterConfig({
isWorkloadsRoute: options.isWorkloadsRoute(),
selectedPlatform: options.selectedPlatform(),
platformOptions: platformOptions(),
@@ -77,8 +77,8 @@ export function useDashboardWorkloadFilterOptions(
}),
);
- const hostFilterConfig = createMemo<DashboardToolbarFilterConfig | undefined>(() =>
- buildDashboardHostFilterConfig({
+ const hostFilterConfig = createMemo<WorkloadsToolbarFilterConfig | undefined>(() =>
+ buildWorkloadsHostFilterConfig({
isWorkloadsRoute: options.isWorkloadsRoute(),
viewMode: options.viewMode(),
selectedKubernetesContext: options.selectedKubernetesContext(),
@@ -90,8 +90,8 @@ export function useDashboardWorkloadFilterOptions(
}),
);
- const namespaceFilterConfig = createMemo<DashboardToolbarFilterConfig | undefined>(() =>
- buildDashboardNamespaceFilterConfig({
+ const namespaceFilterConfig = createMemo<WorkloadsToolbarFilterConfig | undefined>(() =>
+ buildWorkloadsNamespaceFilterConfig({
isWorkloadsRoute: options.isWorkloadsRoute(),
viewMode: options.viewMode(),
selectedNamespace: options.selectedKubernetesNamespace(),
diff --git a/frontend-modern/src/components/Dashboard/useDashboardGuestMetadataState.ts b/frontend-modern/src/components/Workloads/useWorkloadGuestMetadataState.ts
similarity index 97%
rename from frontend-modern/src/components/Dashboard/useDashboardGuestMetadataState.ts
rename to frontend-modern/src/components/Workloads/useWorkloadGuestMetadataState.ts
index 4037a55711..6e1ad879f6 100644
--- a/frontend-modern/src/components/Dashboard/useDashboardGuestMetadataState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadGuestMetadataState.ts
@@ -200,7 +200,7 @@ const queueGuestMetadataPersist = (storageKey: string, metadata: GuestMetadataRe
}
};
-export function useDashboardGuestMetadataState() {
+export function useWorkloadGuestMetadataState() {
const [orgScope, setOrgScope] = createSignal(normalizeOrgScope(getOrgID()));
const guestMetadataStorageKey = createMemo(() => guestMetadataStorageKeyForOrg(orgScope()));
const [guestMetadata, setGuestMetadata] = createSignal<GuestMetadataRecord>(
@@ -282,7 +282,7 @@ export function useDashboardGuestMetadataState() {
const handleMetadataChanged = (event: Event) => {
const customEvent = event as CustomEvent;
- logger.debug('[Dashboard] Metadata changed event received', customEvent.detail);
+ logger.debug('[Workloads] Metadata changed event received', customEvent.detail);
if (customEvent.detail?.payload) {
let { guestId, url } = customEvent.detail.payload;
@@ -292,14 +292,14 @@ export function useDashboardGuestMetadataState() {
if (parts.length === 3) {
const [instance, _node, vmid] = parts;
guestId = `${instance}-${vmid}`;
- logger.debug('[Dashboard] Normalized optimistic guestId', {
+ logger.debug('[Workloads] Normalized optimistic guestId', {
original: customEvent.detail.payload.guestId,
normalized: guestId,
});
}
}
- logger.debug('[Dashboard] Applying optimistic metadata update', { guestId, url });
+ logger.debug('[Workloads] Applying optimistic metadata update', { guestId, url });
handleCustomUrlUpdate(guestId, url || '');
return;
}
@@ -309,7 +309,7 @@ export function useDashboardGuestMetadataState() {
void refreshGuestMetadata();
};
- logger.debug('[Dashboard] Adding pulse:metadata-changed listener');
+ logger.debug('[Workloads] Adding pulse:metadata-changed listener');
window.addEventListener('pulse:metadata-changed', handleMetadataChanged);
const unsubscribeOrgSwitched = eventBus.on('org_switched', (nextOrgID) => {
setOrgScope(normalizeOrgScope(nextOrgID));
diff --git a/frontend-modern/src/components/Dashboard/useDashboardWorkloadRouteState.ts b/frontend-modern/src/components/Workloads/useWorkloadRouteState.ts
similarity index 72%
rename from frontend-modern/src/components/Dashboard/useDashboardWorkloadRouteState.ts
rename to frontend-modern/src/components/Workloads/useWorkloadRouteState.ts
index 034e76766c..3ff8b1cf45 100644
--- a/frontend-modern/src/components/Dashboard/useDashboardWorkloadRouteState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadRouteState.ts
@@ -1,22 +1,22 @@
import { createSignal, type Accessor, type Setter } from 'solid-js';
import type { WorkloadGuest, ViewMode } from '@/types/workloads';
import { usePersistentSignal } from '@/hooks/usePersistentSignal';
-import { deserializeDashboardWorkloadViewMode } from './dashboardWorkloadRouteModel';
+import { deserializeWorkloadViewMode } from './workloadRouteModel';
import {
- DASHBOARD_WORKLOAD_ROUTE_RESET_STATE,
- deserializeDashboardContainerRuntime,
- resolveDashboardWorkloadNodeSelection,
-} from './dashboardWorkloadRouteStateModel';
-import { useDashboardWorkloadFilterOptions } from './useDashboardWorkloadFilterOptions';
-import { useDashboardWorkloadUrlSync } from './useDashboardWorkloadUrlSync';
+ WORKLOADS_WORKLOAD_ROUTE_RESET_STATE,
+ deserializeWorkloadsContainerRuntime,
+ resolveWorkloadsWorkloadNodeSelection,
+} from './workloadRouteStateModel';
+import { useWorkloadFilterOptions } from './useWorkloadFilterOptions';
+import { useWorkloadUrlSync } from './useWorkloadUrlSync';
-export interface DashboardWorkloadRouteStateOptions {
+export interface WorkloadRouteStateOptions {
allGuests: Accessor<WorkloadGuest[]>;
showFilters: Accessor<boolean>;
setShowFilters: Setter<boolean>;
}
-export function useDashboardWorkloadRouteState(options: DashboardWorkloadRouteStateOptions) {
+export function useWorkloadRouteState(options: WorkloadRouteStateOptions) {
const [selectedNode, setSelectedNode] = createSignal<string | null>(null);
const [selectedPlatform, setSelectedPlatform] = createSignal<string | null>(null);
const [selectedKubernetesContext, setSelectedKubernetesContext] = createSignal<string | null>(
@@ -27,21 +27,21 @@ export function useDashboardWorkloadRouteState(options: DashboardWorkloadRouteSt
>(null);
const [selectedHostHint, setSelectedHostHint] = createSignal<string | null>(null);
- const [viewMode, setViewMode] = usePersistentSignal<ViewMode>('dashboardViewMode', 'all', {
- deserialize: deserializeDashboardWorkloadViewMode,
+ const [viewMode, setViewMode] = usePersistentSignal<ViewMode>('workloadsViewMode', 'all', {
+ deserialize: deserializeWorkloadViewMode,
});
const [containerRuntime, setContainerRuntime] = usePersistentSignal<string>(
- 'dashboardContainerRuntime',
+ 'workloadsContainerRuntime',
'',
{
- deserialize: deserializeDashboardContainerRuntime,
+ deserialize: deserializeWorkloadsContainerRuntime,
serialize: (value) => value,
},
);
const handleNodeSelect = (nodeId: string | null, nodeType: 'pve' | 'pbs' | 'pmg' | null) => {
- const selection = resolveDashboardWorkloadNodeSelection({
+ const selection = resolveWorkloadsWorkloadNodeSelection({
nodeId,
nodeType,
showFilters: options.showFilters(),
@@ -55,18 +55,18 @@ export function useDashboardWorkloadRouteState(options: DashboardWorkloadRouteSt
};
const resetWorkloadRouteFilters = () => {
- setSelectedNode(DASHBOARD_WORKLOAD_ROUTE_RESET_STATE.selectedNode);
- setSelectedHostHint(DASHBOARD_WORKLOAD_ROUTE_RESET_STATE.selectedHostHint);
- setSelectedPlatform(DASHBOARD_WORKLOAD_ROUTE_RESET_STATE.selectedPlatform);
- setSelectedKubernetesContext(DASHBOARD_WORKLOAD_ROUTE_RESET_STATE.selectedKubernetesContext);
+ setSelectedNode(WORKLOADS_WORKLOAD_ROUTE_RESET_STATE.selectedNode);
+ setSelectedHostHint(WORKLOADS_WORKLOAD_ROUTE_RESET_STATE.selectedHostHint);
+ setSelectedPlatform(WORKLOADS_WORKLOAD_ROUTE_RESET_STATE.selectedPlatform);
+ setSelectedKubernetesContext(WORKLOADS_WORKLOAD_ROUTE_RESET_STATE.selectedKubernetesContext);
setSelectedKubernetesNamespace(
- DASHBOARD_WORKLOAD_ROUTE_RESET_STATE.selectedKubernetesNamespace,
+ WORKLOADS_WORKLOAD_ROUTE_RESET_STATE.selectedKubernetesNamespace,
);
- setContainerRuntime(DASHBOARD_WORKLOAD_ROUTE_RESET_STATE.containerRuntime);
- setViewMode(DASHBOARD_WORKLOAD_ROUTE_RESET_STATE.viewMode);
+ setContainerRuntime(WORKLOADS_WORKLOAD_ROUTE_RESET_STATE.containerRuntime);
+ setViewMode(WORKLOADS_WORKLOAD_ROUTE_RESET_STATE.viewMode);
};
- const { isWorkloadsRoute } = useDashboardWorkloadUrlSync({
+ const { isWorkloadsRoute } = useWorkloadUrlSync({
containerRuntime,
containerRuntimeOptions: () => filterOptions.containerRuntimeOptions(),
kubernetesNamespaceOptions: () => filterOptions.kubernetesNamespaceOptions(),
@@ -88,7 +88,7 @@ export function useDashboardWorkloadRouteState(options: DashboardWorkloadRouteSt
workloadNodeOptions: () => filterOptions.workloadNodeOptions(),
});
- const filterOptions = useDashboardWorkloadFilterOptions({
+ const filterOptions = useWorkloadFilterOptions({
allGuests: options.allGuests,
isWorkloadsRoute,
viewMode,
diff --git a/frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts b/frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts
similarity index 91%
rename from frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts
rename to frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts
index 65700c3942..0e1a58768c 100644
--- a/frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts
@@ -11,19 +11,19 @@ import type { WorkloadGuest } from '@/types/workloads';
import { capturePendingAppShellRestoreTop } from '@/utils/appShellScrollRestoration';
import { createRouteStateNavigateScheduler } from '@/utils/routeStateNavigation';
import {
- dashboardHasHoveredWorkload,
- dashboardHasVisibleWorkloadGroupScope,
- resolveDashboardResourceSelection,
- resolveDashboardSelectionNavigateTarget,
-} from './dashboardSelectionModel';
+ workloadsHasHoveredWorkload,
+ workloadsHasVisibleWorkloadGroupScope,
+ resolveWorkloadResourceSelection,
+ resolveWorkloadsSelectionNavigateTarget,
+} from './workloadSelectionModel';
-interface UseDashboardSelectionStateOptions {
+interface UseWorkloadsSelectionStateOptions {
clearAdditionalPageStateOnEscape?: () => void;
filteredGuests: Accessor<WorkloadGuest[]>;
summaryGroupScopes: Accessor<Map<string, SummarySeriesGroupScope>>;
}
-export function useDashboardSelectionState(options: UseDashboardSelectionStateOptions) {
+export function useWorkloadSelectionState(options: UseWorkloadsSelectionStateOptions) {
const location = useLocation();
const navigate = useNavigate();
const routeStateNavigate = createRouteStateNavigateScheduler(
@@ -57,7 +57,7 @@ export function useDashboardSelectionState(options: UseDashboardSelectionStateOp
setSelectedGuestIdRaw(null);
setSelectedWorkloadGroupIdRaw(null);
});
- const nextPath = resolveDashboardSelectionNavigateTarget({
+ const nextPath = resolveWorkloadsSelectionNavigateTarget({
pathname: location.pathname,
search: location.search,
resourceId: null,
@@ -111,7 +111,7 @@ export function useDashboardSelectionState(options: UseDashboardSelectionStateOp
setSelectedGuestIdRaw(id);
setSelectedWorkloadGroupIdRaw(nextGroupScope?.id ?? null);
});
- const nextPath = resolveDashboardSelectionNavigateTarget({
+ const nextPath = resolveWorkloadsSelectionNavigateTarget({
pathname: location.pathname,
search: location.search,
resourceId: id,
@@ -136,7 +136,7 @@ export function useDashboardSelectionState(options: UseDashboardSelectionStateOp
const nextSelectedGuestId =
scope && !isSummarySeriesInGroupScope(scope, selectedGuestId()) ? null : selectedGuestId();
setFocusedWorkloadGroupScopeState(scope);
- const nextPath = resolveDashboardSelectionNavigateTarget({
+ const nextPath = resolveWorkloadsSelectionNavigateTarget({
pathname: location.pathname,
search: location.search,
resourceId: nextSelectedGuestId,
@@ -148,7 +148,7 @@ export function useDashboardSelectionState(options: UseDashboardSelectionStateOp
};
createEffect(() => {
- const selection = resolveDashboardResourceSelection(location.search);
+ const selection = resolveWorkloadResourceSelection(location.search);
if (!selection) {
if (handledResourceId() !== null) {
setSelectedGuestIdState(null);
@@ -175,7 +175,7 @@ export function useDashboardSelectionState(options: UseDashboardSelectionStateOp
createEffect(() => {
const hoveredId = hoveredWorkloadId();
if (!hoveredId) return;
- if (!dashboardHasHoveredWorkload(options.filteredGuests(), hoveredId)) {
+ if (!workloadsHasHoveredWorkload(options.filteredGuests(), hoveredId)) {
setHoveredWorkloadId(null);
}
});
@@ -183,7 +183,7 @@ export function useDashboardSelectionState(options: UseDashboardSelectionStateOp
createEffect(() => {
const revealedId = revealedGuestId();
if (!revealedId) return;
- if (!dashboardHasHoveredWorkload(options.filteredGuests(), revealedId)) {
+ if (!workloadsHasHoveredWorkload(options.filteredGuests(), revealedId)) {
setRevealedGuestId(null);
}
});
@@ -193,7 +193,7 @@ export function useDashboardSelectionState(options: UseDashboardSelectionStateOp
if (!groupScope) {
return;
}
- if (!dashboardHasVisibleWorkloadGroupScope(options.filteredGuests(), groupScope)) {
+ if (!workloadsHasVisibleWorkloadGroupScope(options.filteredGuests(), groupScope)) {
setHoveredWorkloadGroupScope(null);
}
});
diff --git a/frontend-modern/src/components/Dashboard/useDashboardWorkloadUrlSync.ts b/frontend-modern/src/components/Workloads/useWorkloadUrlSync.ts
similarity index 92%
rename from frontend-modern/src/components/Dashboard/useDashboardWorkloadUrlSync.ts
rename to frontend-modern/src/components/Workloads/useWorkloadUrlSync.ts
index 867347839a..52a41137f3 100644
--- a/frontend-modern/src/components/Dashboard/useDashboardWorkloadUrlSync.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadUrlSync.ts
@@ -11,15 +11,15 @@ import { useLocation, useNavigate } from '@solidjs/router';
import type { ViewMode } from '@/types/workloads';
import { WORKLOADS_PATH } from '@/routing/resourceLinks';
import { createRouteStateNavigateScheduler } from '@/utils/routeStateNavigation';
-import type { DashboardWorkloadNodeOption } from './dashboardWorkloadRouteModel';
+import type { WorkloadNodeOption } from './workloadRouteModel';
import {
- parseDashboardWorkloadUrlParams,
- resolveDashboardManagedWorkloadsNavigateTarget,
- resolveDashboardWorkloadRuntimeParam,
- resolveDashboardWorkloadTypeParam,
-} from './dashboardWorkloadUrlSyncModel';
+ parseWorkloadsWorkloadUrlParams,
+ resolveWorkloadsManagedWorkloadsNavigateTarget,
+ resolveWorkloadsWorkloadRuntimeParam,
+ resolveWorkloadsWorkloadTypeParam,
+} from './workloadUrlSyncModel';
-export interface DashboardWorkloadUrlSyncOptions {
+export interface WorkloadsWorkloadUrlSyncOptions {
containerRuntime: Accessor<string>;
containerRuntimeOptions: Accessor<string[]>;
kubernetesNamespaceOptions: Accessor<string[]>;
@@ -38,14 +38,14 @@ export interface DashboardWorkloadUrlSyncOptions {
setViewMode: Setter<ViewMode>;
showFilters: Accessor<boolean>;
viewMode: Accessor<ViewMode>;
- workloadNodeOptions: Accessor<DashboardWorkloadNodeOption[]>;
+ workloadNodeOptions: Accessor<WorkloadNodeOption[]>;
}
-export function useDashboardWorkloadUrlSync(options: DashboardWorkloadUrlSyncOptions) {
+export function useWorkloadUrlSync(options: WorkloadsWorkloadUrlSyncOptions) {
const navigate = useNavigate();
const location = useLocation();
const isWorkloadsRoute = () => location.pathname === WORKLOADS_PATH;
- const workloadUrlParams = createMemo(() => parseDashboardWorkloadUrlParams(location.search));
+ const workloadUrlParams = createMemo(() => parseWorkloadsWorkloadUrlParams(location.search));
const routeStateNavigate = createRouteStateNavigateScheduler(
navigate,
() => `${untrack(() => location.pathname)}${untrack(() => location.search)}`,
@@ -142,7 +142,7 @@ export function useDashboardWorkloadUrlSync(options: DashboardWorkloadUrlSyncOpt
return;
}
- const nextMode = resolveDashboardWorkloadTypeParam(parsed);
+ const nextMode = resolveWorkloadsWorkloadTypeParam(parsed);
if (!nextMode) {
setHandledTypeParam(normalizedType);
return;
@@ -243,7 +243,7 @@ export function useDashboardWorkloadUrlSync(options: DashboardWorkloadUrlSyncOpt
const urlRuntime = parsed.runtime;
if (urlRuntime === handledRuntimeParam()) return;
- const resolution = resolveDashboardWorkloadRuntimeParam(parsed);
+ const resolution = resolveWorkloadsWorkloadRuntimeParam(parsed);
if (!resolution.shouldApply) {
setHandledRuntimeParam(urlRuntime);
return;
@@ -279,7 +279,7 @@ export function useDashboardWorkloadUrlSync(options: DashboardWorkloadUrlSyncOpt
if (handledAgentParam() !== urlAgent) return;
if (urlResource) return;
- const nextPath = resolveDashboardManagedWorkloadsNavigateTarget({
+ const nextPath = resolveWorkloadsManagedWorkloadsNavigateTarget({
currentSearch: location.search,
viewMode: options.viewMode(),
containerRuntime: options.containerRuntime(),
diff --git a/frontend-modern/src/components/Dashboard/useDashboardWorkloadViewportSync.ts b/frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts
similarity index 90%
rename from frontend-modern/src/components/Dashboard/useDashboardWorkloadViewportSync.ts
rename to frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts
index 441068dffa..97ba4cf3bf 100644
--- a/frontend-modern/src/components/Dashboard/useDashboardWorkloadViewportSync.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts
@@ -2,15 +2,15 @@ import { createEffect, onCleanup, type Accessor } from 'solid-js';
import type { UseGroupedTableWindowingResult } from './useGroupedTableWindowing';
-interface DashboardWorkloadViewportSyncOptions {
+interface WorkloadsWorkloadViewportSyncOptions {
filteredGuestCount: Accessor<number>;
groupedWindowing: UseGroupedTableWindowingResult;
rowHeight: number;
tableBodyRef: Accessor<HTMLTableSectionElement | null>;
}
-export function useDashboardWorkloadViewportSync(
- options: DashboardWorkloadViewportSyncOptions,
+export function useWorkloadViewportSync(
+ options: WorkloadsWorkloadViewportSyncOptions,
) {
const syncGuestWindowToViewport = () => {
if (!options.groupedWindowing.isWindowed() || typeof window === 'undefined') return;
diff --git a/frontend-modern/src/components/Dashboard/useDashboardControlsState.ts b/frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts
similarity index 81%
rename from frontend-modern/src/components/Dashboard/useDashboardControlsState.ts
rename to frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts
index 3e178b2372..310d1e3b69 100644
--- a/frontend-modern/src/components/Dashboard/useDashboardControlsState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts
@@ -16,40 +16,40 @@ import {
getWorkloadVisibleColumnsForLayout,
} from './guestRowModel';
import {
- DEFAULT_DASHBOARD_SORT_DIRECTION,
- DEFAULT_DASHBOARD_SORT_KEY,
- DEFAULT_DASHBOARD_STATUS_MODE,
- type DashboardGroupingMode,
- type DashboardSortKey,
- type DashboardStatusMode,
-} from './dashboardFilterModel';
-
-interface DashboardControlsStateOptions {
+ DEFAULT_WORKLOADS_SORT_DIRECTION,
+ DEFAULT_WORKLOADS_SORT_KEY,
+ DEFAULT_WORKLOADS_STATUS_MODE,
+ type WorkloadsGroupingMode,
+ type WorkloadsSortKey,
+ type WorkloadsStatusMode,
+} from './workloadsFilterModel';
+
+interface WorkloadsControlsStateOptions {
setShowFilters: (value: boolean | ((current: boolean) => boolean)) => void;
showFilters: Accessor<boolean>;
viewMode: Accessor<ViewMode>;
}
-export function useDashboardControlsState(options: DashboardControlsStateOptions) {
+export function useWorkloadsControlsState(options: WorkloadsControlsStateOptions) {
const breakpoint = useBreakpoint();
const workloadTableLayoutMode = createMemo(() => getWorkloadTableLayoutMode(breakpoint.width()));
const isMobile = createMemo(() => workloadTableLayoutMode() === 'mobile');
const [search, setSearch] = createSignal('');
const [isSearchLocked, setIsSearchLocked] = createSignal(false);
- const [statusMode, setStatusMode] = usePersistentSignal<DashboardStatusMode>(
- 'dashboardStatusMode',
- DEFAULT_DASHBOARD_STATUS_MODE,
+ const [statusMode, setStatusMode] = usePersistentSignal<WorkloadsStatusMode>(
+ 'workloadsStatusMode',
+ DEFAULT_WORKLOADS_STATUS_MODE,
{
deserialize: (raw) =>
raw === 'all' || raw === 'running' || raw === 'degraded' || raw === 'stopped'
- ? (raw as DashboardStatusMode)
- : DEFAULT_DASHBOARD_STATUS_MODE,
+ ? (raw as WorkloadsStatusMode)
+ : DEFAULT_WORKLOADS_STATUS_MODE,
},
);
- const [groupingMode, setGroupingMode] = usePersistentSignal<DashboardGroupingMode>(
- 'dashboardGroupingMode',
+ const [groupingMode, setGroupingMode] = usePersistentSignal<WorkloadsGroupingMode>(
+ 'workloadsGroupingMode',
'grouped',
{
deserialize: (raw) => (raw === 'grouped' || raw === 'flat' ? raw : 'grouped'),
@@ -70,11 +70,11 @@ export function useDashboardControlsState(options: DashboardControlsStateOptions
{ deserialize: (raw) => raw === 'true' },
);
- const [sortKey, setSortKey] = createSignal<DashboardSortKey | null>(
- DEFAULT_DASHBOARD_SORT_KEY,
+ const [sortKey, setSortKey] = createSignal<WorkloadsSortKey | null>(
+ DEFAULT_WORKLOADS_SORT_KEY,
);
const [sortDirection, setSortDirection] = createSignal<'asc' | 'desc'>(
- DEFAULT_DASHBOARD_SORT_DIRECTION,
+ DEFAULT_WORKLOADS_SORT_DIRECTION,
);
const relevantColumns = createMemo(() => {
@@ -89,7 +89,7 @@ export function useDashboardControlsState(options: DashboardControlsStateOptions
});
const columnVisibility = useColumnVisibility(
- STORAGE_KEYS.DASHBOARD_HIDDEN_COLUMNS,
+ STORAGE_KEYS.WORKLOADS_HIDDEN_COLUMNS,
GUEST_COLUMNS,
['os', 'ip'],
relevantColumns,
@@ -104,7 +104,7 @@ export function useDashboardControlsState(options: DashboardControlsStateOptions
);
const totalColumns = createMemo(() => workloadTableVisibleColumns().length);
- const handleSort = (key: DashboardSortKey) => {
+ const handleSort = (key: WorkloadsSortKey) => {
if (sortKey() === key) {
setSortDirection(sortDirection() === 'asc' ? 'desc' : 'asc');
return;
@@ -121,16 +121,16 @@ export function useDashboardControlsState(options: DashboardControlsStateOptions
) {
setSortDirection('desc');
} else {
- setSortDirection(DEFAULT_DASHBOARD_SORT_DIRECTION);
+ setSortDirection(DEFAULT_WORKLOADS_SORT_DIRECTION);
}
};
- const resetDashboardControls = () => {
+ const resetWorkloadsControls = () => {
setSearch('');
setIsSearchLocked(false);
- setSortKey(DEFAULT_DASHBOARD_SORT_KEY);
- setSortDirection(DEFAULT_DASHBOARD_SORT_DIRECTION);
- setStatusMode(DEFAULT_DASHBOARD_STATUS_MODE);
+ setSortKey(DEFAULT_WORKLOADS_SORT_KEY);
+ setSortDirection(DEFAULT_WORKLOADS_SORT_DIRECTION);
+ setStatusMode(DEFAULT_WORKLOADS_STATUS_MODE);
blurFocusedTypeToSearch();
};
@@ -178,7 +178,7 @@ export function useDashboardControlsState(options: DashboardControlsStateOptions
}
};
- const dashboardFilterColumnVisibility = createMemo(() => ({
+ const workloadsFilterColumnVisibility = createMemo(() => ({
availableColumns: columnVisibility.availableToggles(),
isColumnHidden: columnVisibility.isHiddenByUser,
onColumnToggle: columnVisibility.toggle,
@@ -187,14 +187,14 @@ export function useDashboardControlsState(options: DashboardControlsStateOptions
return {
columnVisibility,
- dashboardFilterColumnVisibility,
+ workloadsFilterColumnVisibility,
groupingMode,
handleBeforeAutoFocus,
handleSort,
handleTagClick,
isMobile,
isSearchLocked,
- resetDashboardControls,
+ resetWorkloadsControls,
search,
setGroupingMode,
setSearch,
diff --git a/frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts b/frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts
similarity index 94%
rename from frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts
rename to frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts
index 75164ab9d4..e88ad9da84 100644
--- a/frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts
@@ -17,12 +17,12 @@ import {
buildNodeByInstance,
buildGuestParentNodeMap,
} from './workloadTopology';
-import { useDashboardWorkloadViewportSync } from './useDashboardWorkloadViewportSync';
+import { useWorkloadViewportSync } from './useWorkloadViewportSync';
import { useGroupedTableWindowing } from './useGroupedTableWindowing';
type GroupingMode = 'grouped' | 'flat';
-const DASHBOARD_TABLE_ESTIMATED_ROW_HEIGHT = 32;
+const WORKLOADS_TABLE_ESTIMATED_ROW_HEIGHT = 32;
const workloadMetricPercent = (value: number | null | undefined): number => {
if (typeof value !== 'number' || !Number.isFinite(value)) return 0;
@@ -30,7 +30,7 @@ const workloadMetricPercent = (value: number | null | undefined): number => {
return Math.max(0, value);
};
-interface DashboardWorkloadDerivedStateOptions {
+interface WorkloadsWorkloadDerivedStateOptions {
activeAlerts: Accessor<Record<string, Alert>>;
alertsEnabled: Accessor<boolean>;
allGuests: Accessor<WorkloadGuest[]>;
@@ -43,8 +43,8 @@ interface DashboardWorkloadDerivedStateOptions {
tableBodyRef: Accessor<HTMLTableSectionElement | null>;
}
-export function useDashboardWorkloadDerivedState(
- options: DashboardWorkloadDerivedStateOptions,
+export function useWorkloadsDerivedState(
+ options: WorkloadsWorkloadDerivedStateOptions,
) {
const filteredGuests = createMemo<WorkloadGuest[]>(() => options.filteredGuests() ?? []);
@@ -216,7 +216,7 @@ export function useDashboardWorkloadDerivedState(
const topSpacerHeight = createMemo(() =>
groupedWindowing.isWindowed()
- ? groupedWindowing.startIndex() * DASHBOARD_TABLE_ESTIMATED_ROW_HEIGHT
+ ? groupedWindowing.startIndex() * WORKLOADS_TABLE_ESTIMATED_ROW_HEIGHT
: 0,
);
@@ -229,10 +229,10 @@ export function useDashboardWorkloadDerivedState(
: 0,
);
- useDashboardWorkloadViewportSync({
+ useWorkloadViewportSync({
filteredGuestCount: () => filteredGuests().length,
groupedWindowing,
- rowHeight: DASHBOARD_TABLE_ESTIMATED_ROW_HEIGHT,
+ rowHeight: WORKLOADS_TABLE_ESTIMATED_ROW_HEIGHT,
tableBodyRef: options.tableBodyRef,
});
diff --git a/frontend-modern/src/components/Dashboard/useDashboardFilterState.ts b/frontend-modern/src/components/Workloads/useWorkloadsFilterState.ts
similarity index 72%
rename from frontend-modern/src/components/Dashboard/useDashboardFilterState.ts
rename to frontend-modern/src/components/Workloads/useWorkloadsFilterState.ts
index d94fa11120..235cccd914 100644
--- a/frontend-modern/src/components/Dashboard/useDashboardFilterState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadsFilterState.ts
@@ -3,22 +3,22 @@ import { createMemo, createSignal } from 'solid-js';
import { useBreakpoint } from '@/hooks/useBreakpoint';
import {
- countActiveDashboardFilters,
- DEFAULT_DASHBOARD_GROUPING_MODE,
- DEFAULT_DASHBOARD_SORT_DIRECTION,
- DEFAULT_DASHBOARD_SORT_KEY,
- DEFAULT_DASHBOARD_STATUS_MODE,
- DEFAULT_DASHBOARD_VIEW_MODE,
- hasActiveDashboardFilters,
- type DashboardFilterProps,
-} from './dashboardFilterModel';
+ countActiveWorkloadsFilters,
+ DEFAULT_WORKLOADS_GROUPING_MODE,
+ DEFAULT_WORKLOADS_SORT_DIRECTION,
+ DEFAULT_WORKLOADS_SORT_KEY,
+ DEFAULT_WORKLOADS_STATUS_MODE,
+ DEFAULT_WORKLOADS_VIEW_MODE,
+ hasActiveWorkloadsFilters,
+ type WorkloadsFilterProps,
+} from './workloadsFilterModel';
-export const useDashboardFilterState = (props: DashboardFilterProps) => {
+export const useWorkloadsFilterState = (props: WorkloadsFilterProps) => {
const { isMobile } = useBreakpoint();
const [filtersOpen, setFiltersOpen] = createSignal(false);
const activeFilterCount = createMemo(() =>
- countActiveDashboardFilters({
+ countActiveWorkloadsFilters({
search: props.search(),
viewMode: props.viewMode(),
statusMode: props.statusMode(),
@@ -29,7 +29,7 @@ export const useDashboardFilterState = (props: DashboardFilterProps) => {
);
const showReset = createMemo(() =>
- hasActiveDashboardFilters({
+ hasActiveWorkloadsFilters({
search: props.search(),
viewMode: props.viewMode(),
statusMode: props.statusMode(),
@@ -57,11 +57,11 @@ export const useDashboardFilterState = (props: DashboardFilterProps) => {
const resetFilters = () => {
props.setSearch('');
- props.setSortKey(DEFAULT_DASHBOARD_SORT_KEY);
- props.setSortDirection(DEFAULT_DASHBOARD_SORT_DIRECTION);
- props.setViewMode(DEFAULT_DASHBOARD_VIEW_MODE);
- props.setStatusMode(DEFAULT_DASHBOARD_STATUS_MODE);
- props.setGroupingMode(DEFAULT_DASHBOARD_GROUPING_MODE);
+ props.setSortKey(DEFAULT_WORKLOADS_SORT_KEY);
+ props.setSortDirection(DEFAULT_WORKLOADS_SORT_DIRECTION);
+ props.setViewMode(DEFAULT_WORKLOADS_VIEW_MODE);
+ props.setStatusMode(DEFAULT_WORKLOADS_STATUS_MODE);
+ props.setGroupingMode(DEFAULT_WORKLOADS_GROUPING_MODE);
props.hostFilter?.onChange('');
props.platformFilter?.onChange('');
diff --git a/frontend-modern/src/components/Dashboard/useDashboardState.ts b/frontend-modern/src/components/Workloads/useWorkloadsState.ts
similarity index 83%
rename from frontend-modern/src/components/Dashboard/useDashboardState.ts
rename to frontend-modern/src/components/Workloads/useWorkloadsState.ts
index 90e711ca49..34619b7277 100644
--- a/frontend-modern/src/components/Dashboard/useDashboardState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadsState.ts
@@ -8,11 +8,11 @@ import { usePersistentSignal } from '@/hooks/usePersistentSignal';
import { useWorkloads } from '@/hooks/useWorkloads';
import { useKioskMode } from '@/hooks/useKioskMode';
import {
- getDashboardDisconnectedState,
- getDashboardGuestsEmptyState,
- getDashboardInfrastructureEmptyState,
- getDashboardLoadingState,
-} from '@/utils/dashboardEmptyStatePresentation';
+ getWorkloadsDisconnectedState,
+ getWorkloadsGuestsEmptyState,
+ getWorkloadsInfrastructureEmptyState,
+ getWorkloadsLoadingState,
+} from '@/utils/workloadEmptyStatePresentation';
import { getCanonicalWorkloadId } from '@/utils/workloads';
import {
buildWorkloadSummaryGroupScopeMap,
@@ -21,24 +21,24 @@ import {
type FilterWorkloadsParams,
} from './workloadSelectors';
import {
- type DashboardSortKey,
-} from './dashboardFilterModel';
-import { useDashboardControlsState } from './useDashboardControlsState';
-import { useDashboardGuestMetadataState } from './useDashboardGuestMetadataState';
-import { useDashboardSelectionState } from './useDashboardSelectionState';
-import { useDashboardWorkloadDerivedState } from './useDashboardWorkloadDerivedState';
-import { useDashboardWorkloadRouteState } from './useDashboardWorkloadRouteState';
+ type WorkloadsSortKey,
+} from './workloadsFilterModel';
+import { useWorkloadsControlsState } from './useWorkloadsControlsState';
+import { useWorkloadGuestMetadataState } from './useWorkloadGuestMetadataState';
+import { useWorkloadSelectionState } from './useWorkloadSelectionState';
+import { useWorkloadsDerivedState } from './useWorkloadsDerivedState';
+import { useWorkloadRouteState } from './useWorkloadRouteState';
-export interface DashboardProps {
+export interface WorkloadsSurfaceProps {
vms: VM[];
containers: Container[];
nodes: Node[];
useWorkloads?: boolean;
}
-export type WorkloadSortKey = DashboardSortKey;
+export type WorkloadSortKey = WorkloadsSortKey;
-export function useDashboardState(props: DashboardProps) {
+export function useWorkloadsState(props: WorkloadsSurfaceProps) {
const navigate = useNavigate();
const ws = useWebSocket();
const { connected, activeAlerts, initialDataReceived, reconnecting, reconnect } = ws;
@@ -47,7 +47,7 @@ export function useDashboardState(props: DashboardProps) {
const kioskMode = useKioskMode();
- const { guestMetadata, handleCustomUrlUpdate } = useDashboardGuestMetadataState();
+ const { guestMetadata, handleCustomUrlUpdate } = useWorkloadGuestMetadataState();
const workloadsEnabled = createMemo(() => props.useWorkloads === true);
const workloads = useWorkloads(workloadsEnabled);
@@ -69,7 +69,7 @@ export function useDashboardState(props: DashboardProps) {
);
const [showFilters, setShowFilters] = usePersistentSignal<boolean>(
- 'dashboardShowFilters',
+ 'workloadsShowFilters',
false,
{
deserialize: (raw) => raw === 'true',
@@ -102,7 +102,7 @@ export function useDashboardState(props: DashboardProps) {
viewMode,
workloadNodeOptions,
containerRuntimeOptions,
- } = useDashboardWorkloadRouteState({
+ } = useWorkloadRouteState({
allGuests,
showFilters,
setShowFilters,
@@ -110,14 +110,14 @@ export function useDashboardState(props: DashboardProps) {
const {
columnVisibility,
- dashboardFilterColumnVisibility,
+ workloadsFilterColumnVisibility,
groupingMode,
handleBeforeAutoFocus,
handleSort,
handleTagClick,
isMobile,
isSearchLocked,
- resetDashboardControls,
+ resetWorkloadsControls,
search,
setGroupingMode,
setSearch,
@@ -136,16 +136,16 @@ export function useDashboardState(props: DashboardProps) {
workloadsSummaryRange,
setWorkloadsSummaryCollapsed,
setWorkloadsSummaryRange,
- } = useDashboardControlsState({
+ } = useWorkloadsControlsState({
setShowFilters,
showFilters,
viewMode,
});
- const dashboardInfrastructureEmptyState = createMemo(() => getDashboardInfrastructureEmptyState());
- const dashboardGuestsEmptyState = createMemo(() => getDashboardGuestsEmptyState(search()));
- const dashboardLoadingState = createMemo(() => getDashboardLoadingState(reconnecting()));
- const dashboardDisconnectedState = createMemo(() => getDashboardDisconnectedState(reconnecting()));
+ const workloadsInfrastructureEmptyState = createMemo(() => getWorkloadsInfrastructureEmptyState());
+ const workloadsGuestsEmptyState = createMemo(() => getWorkloadsGuestsEmptyState(search()));
+ const workloadsLoadingState = createMemo(() => getWorkloadsLoadingState(reconnecting()));
+ const workloadsDisconnectedState = createMemo(() => getWorkloadsDisconnectedState(reconnecting()));
const hasWorkloadsData = createMemo(() => allGuests().length > 0);
const surfaceConnected = createMemo(() =>
workloadsEnabled()
@@ -229,9 +229,9 @@ export function useDashboardState(props: DashboardProps) {
setTableWrapperRef,
shouldShowJumpToActiveWorkloadRow,
tableBodyRef,
- } = useDashboardSelectionState({
+ } = useWorkloadSelectionState({
clearAdditionalPageStateOnEscape: () => {
- resetDashboardControls();
+ resetWorkloadsControls();
resetWorkloadRouteFilters();
},
filteredGuests,
@@ -253,7 +253,7 @@ export function useDashboardState(props: DashboardProps) {
workloadsSummaryFallbackCounts,
workloadsSummaryFallbackSnapshots,
workloadsSummaryVisibleIds,
- } = useDashboardWorkloadDerivedState({
+ } = useWorkloadsDerivedState({
activeAlerts: () => activeAlerts,
alertsEnabled,
allGuests,
@@ -280,11 +280,11 @@ export function useDashboardState(props: DashboardProps) {
containerRuntime,
containerRuntimeFilterConfig,
containerRuntimeOptions,
- dashboardFilterColumnVisibility,
- dashboardDisconnectedState,
- dashboardGuestsEmptyState,
- dashboardInfrastructureEmptyState,
- dashboardLoadingState,
+ workloadsFilterColumnVisibility,
+ workloadsDisconnectedState,
+ workloadsGuestsEmptyState,
+ workloadsInfrastructureEmptyState,
+ workloadsLoadingState,
filteredGuests,
focusedSummaryWorkloadGroupScope,
focusedSummaryWorkloadGroupId,
@@ -373,4 +373,4 @@ export function useDashboardState(props: DashboardProps) {
} as const;
}
-export type DashboardState = ReturnType<typeof useDashboardState>;
+export type WorkloadsState = ReturnType<typeof useWorkloadsState>;
diff --git a/frontend-modern/src/components/Dashboard/dashboardWorkloadFilterConfigModel.ts b/frontend-modern/src/components/Workloads/workloadFilterConfigModel.ts
similarity index 66%
rename from frontend-modern/src/components/Dashboard/dashboardWorkloadFilterConfigModel.ts
rename to frontend-modern/src/components/Workloads/workloadFilterConfigModel.ts
index 63efdc2682..13f69a31cc 100644
--- a/frontend-modern/src/components/Dashboard/dashboardWorkloadFilterConfigModel.ts
+++ b/frontend-modern/src/components/Workloads/workloadFilterConfigModel.ts
@@ -1,18 +1,18 @@
import type { ViewMode } from '@/types/workloads';
import { getAllFilterOptionLabel } from '@/components/shared/filterOptionPresentation';
import { getSourcePlatformLabel, normalizeSourcePlatformQueryValue } from '@/utils/sourcePlatforms';
-import type { DashboardToolbarFilterConfig } from './dashboardFilterModel';
-import type { DashboardWorkloadNodeOption } from './dashboardWorkloadRouteModel';
+import type { WorkloadsToolbarFilterConfig } from './workloadsFilterModel';
+import type { WorkloadNodeOption } from './workloadRouteModel';
-export const DASHBOARD_KUBERNETES_CONTEXT_FILTER_LABEL = 'K8s cluster';
-export const DASHBOARD_KUBERNETES_CONTEXT_ALL_OPTION_LABEL =
+export const WORKLOADS_KUBERNETES_CONTEXT_FILTER_LABEL = 'K8s cluster';
+export const WORKLOADS_KUBERNETES_CONTEXT_ALL_OPTION_LABEL =
getAllFilterOptionLabel('K8s clusters');
-export const DASHBOARD_CONTAINER_RUNTIME_ALL_OPTION_LABEL =
+export const WORKLOADS_CONTAINER_RUNTIME_ALL_OPTION_LABEL =
getAllFilterOptionLabel('runtimes');
-export const DASHBOARD_PLATFORM_ALL_OPTION_LABEL = getAllFilterOptionLabel('platforms');
-export const DASHBOARD_NODE_ALL_OPTION_LABEL = getAllFilterOptionLabel('nodes');
-export const DASHBOARD_NAMESPACE_ALL_OPTION_LABEL = getAllFilterOptionLabel('namespaces');
-export const DASHBOARD_WORKLOAD_TYPE_OPTIONS: Array<{ value: ViewMode; label: string }> = [
+export const WORKLOADS_PLATFORM_ALL_OPTION_LABEL = getAllFilterOptionLabel('platforms');
+export const WORKLOADS_NODE_ALL_OPTION_LABEL = getAllFilterOptionLabel('nodes');
+export const WORKLOADS_NAMESPACE_ALL_OPTION_LABEL = getAllFilterOptionLabel('namespaces');
+export const WORKLOAD_TYPE_OPTIONS: Array<{ value: ViewMode; label: string }> = [
{ value: 'all', label: 'All' },
{ value: 'vm', label: 'VMs' },
{ value: 'system-container', label: 'System containers' },
@@ -20,7 +20,7 @@ export const DASHBOARD_WORKLOAD_TYPE_OPTIONS: Array<{ value: ViewMode; label: st
{ value: 'pod', label: 'Pods' },
];
-interface DashboardContainerRuntimeFilterConfigOptions {
+interface WorkloadsContainerRuntimeFilterConfigOptions {
isWorkloadsRoute: boolean;
viewMode: ViewMode;
containerRuntime: string;
@@ -28,13 +28,13 @@ interface DashboardContainerRuntimeFilterConfigOptions {
onChange: (value: string) => void;
}
-export const buildDashboardContainerRuntimeFilterConfig = ({
+export const buildWorkloadsContainerRuntimeFilterConfig = ({
isWorkloadsRoute,
viewMode,
containerRuntime,
runtimeOptions,
onChange,
-}: DashboardContainerRuntimeFilterConfigOptions): DashboardToolbarFilterConfig | undefined => {
+}: WorkloadsContainerRuntimeFilterConfigOptions): WorkloadsToolbarFilterConfig | undefined => {
if (!isWorkloadsRoute) return undefined;
if (viewMode !== 'app-container') return undefined;
if (runtimeOptions.length === 0) return undefined;
@@ -44,25 +44,25 @@ export const buildDashboardContainerRuntimeFilterConfig = ({
label: 'Runtime',
value: containerRuntime,
options: [
- { value: '', label: DASHBOARD_CONTAINER_RUNTIME_ALL_OPTION_LABEL },
+ { value: '', label: WORKLOADS_CONTAINER_RUNTIME_ALL_OPTION_LABEL },
...runtimeOptions.map((value) => ({ value, label: value })),
],
onChange,
};
};
-interface DashboardPlatformFilterConfigOptions {
+interface WorkloadsPlatformFilterConfigOptions {
isWorkloadsRoute: boolean;
selectedPlatform: string | null;
- platformOptions: DashboardToolbarFilterConfig['options'];
+ platformOptions: WorkloadsToolbarFilterConfig['options'];
onChange: (value: string) => void;
}
-export const buildDashboardPlatformFilterOptions = (
+export const buildWorkloadsPlatformFilterOptions = (
selectedPlatform: string | null,
- platformOptions: DashboardToolbarFilterConfig['options'],
-): DashboardToolbarFilterConfig['options'] => {
- const allOption = { value: '', label: DASHBOARD_PLATFORM_ALL_OPTION_LABEL };
+ platformOptions: WorkloadsToolbarFilterConfig['options'],
+): WorkloadsToolbarFilterConfig['options'] => {
+ const allOption = { value: '', label: WORKLOADS_PLATFORM_ALL_OPTION_LABEL };
const selectedValue = normalizeSourcePlatformQueryValue(selectedPlatform);
if (!selectedValue || selectedValue === 'all') {
return [allOption, ...platformOptions];
@@ -80,12 +80,12 @@ export const buildDashboardPlatformFilterOptions = (
];
};
-export const buildDashboardPlatformFilterConfig = ({
+export const buildWorkloadsPlatformFilterConfig = ({
isWorkloadsRoute,
selectedPlatform,
platformOptions,
onChange,
-}: DashboardPlatformFilterConfigOptions): DashboardToolbarFilterConfig | undefined => {
+}: WorkloadsPlatformFilterConfigOptions): WorkloadsToolbarFilterConfig | undefined => {
if (!isWorkloadsRoute) return undefined;
if (platformOptions.length === 0) return undefined;
if (platformOptions.length === 1 && !(selectedPlatform || '').trim()) return undefined;
@@ -94,23 +94,23 @@ export const buildDashboardPlatformFilterConfig = ({
id: 'workloads-platform-filter',
label: 'Platform',
value: selectedPlatform ?? '',
- options: buildDashboardPlatformFilterOptions(selectedPlatform, platformOptions),
+ options: buildWorkloadsPlatformFilterOptions(selectedPlatform, platformOptions),
onChange,
};
};
-interface DashboardHostFilterConfigOptions {
+interface WorkloadsHostFilterConfigOptions {
isWorkloadsRoute: boolean;
viewMode: ViewMode;
selectedKubernetesContext: string | null;
kubernetesContextOptions: string[];
selectedNode: string | null;
- workloadNodeOptions: DashboardWorkloadNodeOption[];
+ workloadNodeOptions: WorkloadNodeOption[];
onContextChange: (value: string) => void;
onNodeChange: (value: string) => void;
}
-export const buildDashboardHostFilterConfig = ({
+export const buildWorkloadsHostFilterConfig = ({
isWorkloadsRoute,
viewMode,
selectedKubernetesContext,
@@ -119,16 +119,16 @@ export const buildDashboardHostFilterConfig = ({
workloadNodeOptions,
onContextChange,
onNodeChange,
-}: DashboardHostFilterConfigOptions): DashboardToolbarFilterConfig | undefined => {
+}: WorkloadsHostFilterConfigOptions): WorkloadsToolbarFilterConfig | undefined => {
if (!isWorkloadsRoute) return undefined;
if (viewMode === 'pod') {
return {
id: 'workloads-k8s-context-filter',
- label: DASHBOARD_KUBERNETES_CONTEXT_FILTER_LABEL,
+ label: WORKLOADS_KUBERNETES_CONTEXT_FILTER_LABEL,
value: selectedKubernetesContext ?? '',
options: [
- { value: '', label: DASHBOARD_KUBERNETES_CONTEXT_ALL_OPTION_LABEL },
+ { value: '', label: WORKLOADS_KUBERNETES_CONTEXT_ALL_OPTION_LABEL },
...kubernetesContextOptions.map((context) => ({ value: context, label: context })),
],
onChange: onContextChange,
@@ -139,12 +139,12 @@ export const buildDashboardHostFilterConfig = ({
id: 'workloads-node-filter',
label: 'Node',
value: selectedNode ?? '',
- options: [{ value: '', label: DASHBOARD_NODE_ALL_OPTION_LABEL }, ...workloadNodeOptions],
+ options: [{ value: '', label: WORKLOADS_NODE_ALL_OPTION_LABEL }, ...workloadNodeOptions],
onChange: onNodeChange,
};
};
-interface DashboardNamespaceFilterConfigOptions {
+interface WorkloadsNamespaceFilterConfigOptions {
isWorkloadsRoute: boolean;
viewMode: ViewMode;
selectedNamespace: string | null;
@@ -152,13 +152,13 @@ interface DashboardNamespaceFilterConfigOptions {
onChange: (value: string) => void;
}
-export const buildDashboardNamespaceFilterConfig = ({
+export const buildWorkloadsNamespaceFilterConfig = ({
isWorkloadsRoute,
viewMode,
selectedNamespace,
namespaceOptions,
onChange,
-}: DashboardNamespaceFilterConfigOptions): DashboardToolbarFilterConfig | undefined => {
+}: WorkloadsNamespaceFilterConfigOptions): WorkloadsToolbarFilterConfig | undefined => {
if (!isWorkloadsRoute) return undefined;
if (viewMode !== 'pod') return undefined;
if (namespaceOptions.length === 0) return undefined;
@@ -168,7 +168,7 @@ export const buildDashboardNamespaceFilterConfig = ({
label: 'Namespace',
value: selectedNamespace ?? '',
options: [
- { value: '', label: DASHBOARD_NAMESPACE_ALL_OPTION_LABEL },
+ { value: '', label: WORKLOADS_NAMESPACE_ALL_OPTION_LABEL },
...namespaceOptions.map((value) => ({ value, label: value })),
],
onChange,
diff --git a/frontend-modern/src/components/Dashboard/dashboardWorkloadRouteModel.ts b/frontend-modern/src/components/Workloads/workloadRouteModel.ts
similarity index 86%
rename from frontend-modern/src/components/Dashboard/dashboardWorkloadRouteModel.ts
rename to frontend-modern/src/components/Workloads/workloadRouteModel.ts
index b1a6b9647e..92f0049d90 100644
--- a/frontend-modern/src/components/Dashboard/dashboardWorkloadRouteModel.ts
+++ b/frontend-modern/src/components/Workloads/workloadRouteModel.ts
@@ -1,23 +1,23 @@
import type { WorkloadGuest, ViewMode } from '@/types/workloads';
import { normalizeWorkloadViewModeParam, resolveWorkloadType } from '@/utils/workloads';
import { buildSourcePlatformOptions } from '@/utils/sourcePlatformOptions';
-import type { DashboardFilterSelectOption } from './dashboardFilterModel';
+import type { WorkloadsFilterSelectOption } from './workloadsFilterModel';
import {
getKubernetesContextKey,
getWorkloadHostLabel,
workloadHostScopeId,
} from './workloadTopology';
-export type DashboardWorkloadNodeOption = DashboardFilterSelectOption;
+export type WorkloadNodeOption = WorkloadsFilterSelectOption;
-export const deserializeDashboardWorkloadViewMode = (raw: unknown): ViewMode => {
+export const deserializeWorkloadViewMode = (raw: unknown): ViewMode => {
if (typeof raw !== 'string') return 'all';
return normalizeWorkloadViewModeParam(raw) ?? 'all';
};
-export const buildDashboardWorkloadNodeOptions = (
+export const buildWorkloadNodeOptions = (
guests: WorkloadGuest[],
-): DashboardWorkloadNodeOption[] => {
+): WorkloadNodeOption[] => {
const labelsByScope = new Map<string, string>();
const scopesByLabel = new Map<string, Set<string>>();
@@ -64,7 +64,7 @@ export const buildDashboardWorkloadNodeOptions = (
.sort((a, b) => a.label.localeCompare(b.label));
};
-export const buildDashboardKubernetesContextOptions = (guests: WorkloadGuest[]): string[] => {
+export const buildWorkloadsKubernetesContextOptions = (guests: WorkloadGuest[]): string[] => {
const contexts = new Set<string>();
for (const guest of guests) {
if (resolveWorkloadType(guest) !== 'pod') continue;
@@ -76,7 +76,7 @@ export const buildDashboardKubernetesContextOptions = (guests: WorkloadGuest[]):
return Array.from(contexts).sort((a, b) => a.localeCompare(b));
};
-export const buildDashboardKubernetesNamespaceOptions = (
+export const buildWorkloadsKubernetesNamespaceOptions = (
guests: WorkloadGuest[],
selectedContext: string | null,
): string[] => {
@@ -91,7 +91,7 @@ export const buildDashboardKubernetesNamespaceOptions = (
return Array.from(namespaces).sort((a, b) => a.localeCompare(b));
};
-export const buildDashboardContainerRuntimeOptions = (guests: WorkloadGuest[]): string[] => {
+export const buildWorkloadsContainerRuntimeOptions = (guests: WorkloadGuest[]): string[] => {
const runtimes = new Set<string>();
for (const guest of guests) {
if (resolveWorkloadType(guest) !== 'app-container') continue;
@@ -103,10 +103,10 @@ export const buildDashboardContainerRuntimeOptions = (guests: WorkloadGuest[]):
return Array.from(runtimes).sort((a, b) => a.localeCompare(b));
};
-export const buildDashboardPlatformOptions = (
+export const buildWorkloadsPlatformOptions = (
guests: WorkloadGuest[],
viewMode: ViewMode,
-): DashboardFilterSelectOption[] =>
+): WorkloadsFilterSelectOption[] =>
buildSourcePlatformOptions(
guests
.filter((guest) => viewMode === 'all' || resolveWorkloadType(guest) === viewMode)
diff --git a/frontend-modern/src/components/Dashboard/dashboardWorkloadRouteStateModel.ts b/frontend-modern/src/components/Workloads/workloadRouteStateModel.ts
similarity index 67%
rename from frontend-modern/src/components/Dashboard/dashboardWorkloadRouteStateModel.ts
rename to frontend-modern/src/components/Workloads/workloadRouteStateModel.ts
index 493cbffbe8..c8ff2dcc75 100644
--- a/frontend-modern/src/components/Dashboard/dashboardWorkloadRouteStateModel.ts
+++ b/frontend-modern/src/components/Workloads/workloadRouteStateModel.ts
@@ -1,7 +1,7 @@
-export const deserializeDashboardContainerRuntime = (raw: unknown): string =>
+export const deserializeWorkloadsContainerRuntime = (raw: unknown): string =>
typeof raw === 'string' ? raw : '';
-export const DASHBOARD_WORKLOAD_ROUTE_RESET_STATE = {
+export const WORKLOADS_WORKLOAD_ROUTE_RESET_STATE = {
selectedNode: null,
selectedHostHint: null,
selectedPlatform: null,
@@ -11,24 +11,24 @@ export const DASHBOARD_WORKLOAD_ROUTE_RESET_STATE = {
viewMode: 'all',
} as const;
-interface DashboardWorkloadNodeSelectionOptions {
+interface WorkloadsWorkloadNodeSelectionOptions {
nodeId: string | null;
nodeType: 'pve' | 'pbs' | 'pmg' | null;
showFilters: boolean;
}
-export interface DashboardWorkloadNodeSelectionResult {
+export interface WorkloadsWorkloadNodeSelectionResult {
selectedNode: string | null;
selectedHostHint: null;
shouldApply: boolean;
shouldShowFilters: boolean;
}
-export const resolveDashboardWorkloadNodeSelection = ({
+export const resolveWorkloadsWorkloadNodeSelection = ({
nodeId,
nodeType,
showFilters,
-}: DashboardWorkloadNodeSelectionOptions): DashboardWorkloadNodeSelectionResult => {
+}: WorkloadsWorkloadNodeSelectionOptions): WorkloadsWorkloadNodeSelectionResult => {
const shouldApply = nodeType === 'pve' || nodeType === null;
return {
selectedNode: nodeId,
diff --git a/frontend-modern/src/components/Dashboard/dashboardSelectionModel.ts b/frontend-modern/src/components/Workloads/workloadSelectionModel.ts
similarity index 83%
rename from frontend-modern/src/components/Dashboard/dashboardSelectionModel.ts
rename to frontend-modern/src/components/Workloads/workloadSelectionModel.ts
index 515e5b4a56..ede21d318c 100644
--- a/frontend-modern/src/components/Dashboard/dashboardSelectionModel.ts
+++ b/frontend-modern/src/components/Workloads/workloadSelectionModel.ts
@@ -8,21 +8,21 @@ import type { WorkloadGuest } from '@/types/workloads';
import { areSearchParamsEquivalent } from '@/utils/searchParams';
import { getCanonicalWorkloadId } from '@/utils/workloads';
-export interface DashboardResourceSelection {
+export interface WorkloadsResourceSelection {
resourceId: string | null;
summaryGroupId: string | null;
}
-export interface DashboardSelectionNavigateTargetOptions {
+export interface WorkloadsSelectionNavigateTargetOptions {
pathname: string;
search: string;
resourceId: string | null;
summaryGroupId: string | null;
}
-export const resolveDashboardResourceSelection = (
+export const resolveWorkloadResourceSelection = (
search: string,
-): DashboardResourceSelection | null => {
+): WorkloadsResourceSelection | null => {
const { resource: resourceId, summaryGroup: summaryGroupId } = parseWorkloadsLinkSearch(search);
if (!resourceId && !summaryGroupId) return null;
@@ -32,12 +32,12 @@ export const resolveDashboardResourceSelection = (
};
};
-export const resolveDashboardSelectionNavigateTarget = ({
+export const resolveWorkloadsSelectionNavigateTarget = ({
pathname,
search,
resourceId,
summaryGroupId,
-}: DashboardSelectionNavigateTargetOptions): string | null => {
+}: WorkloadsSelectionNavigateTargetOptions): string | null => {
const currentParams = new URLSearchParams(search);
const nextParams = new URLSearchParams(search);
nextParams.delete(WORKLOADS_QUERY_PARAMS.resource);
@@ -61,12 +61,12 @@ export const resolveDashboardSelectionNavigateTarget = ({
return nextSearch ? `${nextPathname}?${nextSearch}` : nextPathname;
};
-export const dashboardHasHoveredWorkload = (
+export const workloadsHasHoveredWorkload = (
filteredGuests: WorkloadGuest[],
hoveredId: string,
): boolean => filteredGuests.some((guest) => getCanonicalWorkloadId(guest) === hoveredId);
-export const dashboardHasVisibleWorkloadGroupScope = (
+export const workloadsHasVisibleWorkloadGroupScope = (
filteredGuests: WorkloadGuest[],
groupScope: SummarySeriesGroupScope,
): boolean => {
diff --git a/frontend-modern/src/components/Dashboard/workloadSelectors.ts b/frontend-modern/src/components/Workloads/workloadSelectors.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/workloadSelectors.ts
rename to frontend-modern/src/components/Workloads/workloadSelectors.ts
diff --git a/frontend-modern/src/components/Dashboard/workloadTopology.ts b/frontend-modern/src/components/Workloads/workloadTopology.ts
similarity index 100%
rename from frontend-modern/src/components/Dashboard/workloadTopology.ts
rename to frontend-modern/src/components/Workloads/workloadTopology.ts
diff --git a/frontend-modern/src/components/Dashboard/dashboardWorkloadUrlSyncModel.ts b/frontend-modern/src/components/Workloads/workloadUrlSyncModel.ts
similarity index 78%
rename from frontend-modern/src/components/Dashboard/dashboardWorkloadUrlSyncModel.ts
rename to frontend-modern/src/components/Workloads/workloadUrlSyncModel.ts
index e514b03d41..650dd6fff5 100644
--- a/frontend-modern/src/components/Dashboard/dashboardWorkloadUrlSyncModel.ts
+++ b/frontend-modern/src/components/Workloads/workloadUrlSyncModel.ts
@@ -8,7 +8,7 @@ import {
import { areSearchParamsEquivalent } from '@/utils/searchParams';
import { normalizeWorkloadViewModeParam } from '@/utils/workloads';
-export interface DashboardWorkloadUrlParams {
+export interface WorkloadsWorkloadUrlParams {
type: string;
platform: string;
runtime: string;
@@ -18,13 +18,13 @@ export interface DashboardWorkloadUrlParams {
resource: string;
}
-export interface DashboardWorkloadRuntimeParamResolution {
+export interface WorkloadsWorkloadRuntimeParamResolution {
forceViewMode: ViewMode | null;
runtime: string;
shouldApply: boolean;
}
-interface DashboardManagedWorkloadsNavigateTargetOptions {
+interface WorkloadsManagedWorkloadsNavigateTargetOptions {
containerRuntime: string;
currentSearch: string;
selectedHostHint: string | null;
@@ -35,27 +35,27 @@ interface DashboardManagedWorkloadsNavigateTargetOptions {
viewMode: ViewMode;
}
-export const parseDashboardWorkloadUrlParams = (search: string): DashboardWorkloadUrlParams =>
+export const parseWorkloadsWorkloadUrlParams = (search: string): WorkloadsWorkloadUrlParams =>
parseWorkloadsLinkSearch(search);
-const hasDashboardWorkloadKubernetesScope = (params: DashboardWorkloadUrlParams): boolean =>
+const hasWorkloadsWorkloadKubernetesScope = (params: WorkloadsWorkloadUrlParams): boolean =>
Boolean(params.context.trim()) || Boolean(params.namespace.trim());
-export const resolveDashboardWorkloadTypeParam = (
- params: DashboardWorkloadUrlParams,
+export const resolveWorkloadsWorkloadTypeParam = (
+ params: WorkloadsWorkloadUrlParams,
): ViewMode | null => {
const nextMode = normalizeWorkloadViewModeParam(params.type);
if (!nextMode) return null;
- if (hasDashboardWorkloadKubernetesScope(params) && nextMode !== 'pod') return null;
+ if (hasWorkloadsWorkloadKubernetesScope(params) && nextMode !== 'pod') return null;
return nextMode;
};
-export const resolveDashboardWorkloadRuntimeParam = (
- params: DashboardWorkloadUrlParams,
-): DashboardWorkloadRuntimeParamResolution => {
- const nextMode = resolveDashboardWorkloadTypeParam(params);
+export const resolveWorkloadsWorkloadRuntimeParam = (
+ params: WorkloadsWorkloadUrlParams,
+): WorkloadsWorkloadRuntimeParamResolution => {
+ const nextMode = resolveWorkloadsWorkloadTypeParam(params);
const runtimeRelevant =
- !hasDashboardWorkloadKubernetesScope(params) &&
+ !hasWorkloadsWorkloadKubernetesScope(params) &&
(nextMode === 'app-container' || !params.type.trim());
if (!runtimeRelevant) {
@@ -81,7 +81,7 @@ export const resolveDashboardWorkloadRuntimeParam = (
};
};
-export const resolveDashboardManagedWorkloadsNavigateTarget = ({
+export const resolveWorkloadsManagedWorkloadsNavigateTarget = ({
containerRuntime,
currentSearch,
selectedHostHint,
@@ -90,7 +90,7 @@ export const resolveDashboardManagedWorkloadsNavigateTarget = ({
selectedKubernetesNamespace,
selectedNode,
viewMode,
-}: DashboardManagedWorkloadsNavigateTargetOptions): string | null => {
+}: WorkloadsManagedWorkloadsNavigateTargetOptions): string | null => {
const currentParams = new URLSearchParams(currentSearch);
const nextParams = new URLSearchParams(currentSearch);
const nextType = viewMode === 'all' ? '' : viewMode;
diff --git a/frontend-modern/src/components/Workloads/workloadsFilterModel.ts b/frontend-modern/src/components/Workloads/workloadsFilterModel.ts
new file mode 100644
index 0000000000..c13fcd734a
--- /dev/null
+++ b/frontend-modern/src/components/Workloads/workloadsFilterModel.ts
@@ -0,0 +1,89 @@
+import type { ColumnDef } from '@/hooks/useColumnVisibility';
+import type { ViewMode, WorkloadGuest } from '@/types/workloads';
+import type { JSX } from 'solid-js';
+
+export type WorkloadsStatusMode = 'all' | 'running' | 'degraded' | 'stopped';
+export type WorkloadsGroupingMode = 'grouped' | 'flat';
+export type WorkloadsSortKey = keyof WorkloadGuest | 'diskIo' | 'netIo';
+
+export interface WorkloadsFilterSelectOption {
+ value: string;
+ label: string;
+}
+
+export interface WorkloadsToolbarFilterConfig {
+ id?: string;
+ label?: string;
+ value: string;
+ options: WorkloadsFilterSelectOption[];
+ onChange: (value: string) => void;
+}
+
+export interface WorkloadsFilterProps {
+ search: () => string;
+ setSearch: (value: string) => void;
+ viewMode: () => ViewMode;
+ setViewMode: (value: ViewMode) => void;
+ statusMode: () => WorkloadsStatusMode;
+ setStatusMode: (value: WorkloadsStatusMode) => void;
+ groupingMode: () => WorkloadsGroupingMode;
+ setGroupingMode: (value: WorkloadsGroupingMode) => void;
+ setSortKey: (value: WorkloadsSortKey) => void;
+ setSortDirection: (value: 'asc' | 'desc') => void;
+ onBeforeAutoFocus?: () => boolean;
+ columnVisibility?: {
+ availableColumns: ColumnDef[];
+ isColumnHidden: (id: string) => boolean;
+ onColumnToggle: (id: string) => void;
+ onColumnReset?: () => void;
+ };
+ hostFilter?: WorkloadsToolbarFilterConfig;
+ platformFilter?: WorkloadsToolbarFilterConfig;
+ namespaceFilter?: WorkloadsToolbarFilterConfig;
+ containerRuntimeFilter?: WorkloadsToolbarFilterConfig;
+ chartsCollapsed?: () => boolean;
+ onChartsToggle?: () => void;
+ searchTrailing?: JSX.Element;
+ utilityActions?: JSX.Element;
+ mobileTrailing?: JSX.Element;
+}
+
+export interface CountActiveWorkloadsFiltersOptions {
+ search: string;
+ viewMode: ViewMode;
+ statusMode: WorkloadsStatusMode;
+ hostFilterValue?: string;
+ platformFilterValue?: string;
+ namespaceFilterValue?: string;
+}
+
+export interface HasActiveWorkloadsFiltersOptions extends CountActiveWorkloadsFiltersOptions {
+ groupingMode: WorkloadsGroupingMode;
+}
+
+export const DEFAULT_WORKLOADS_SORT_KEY: WorkloadsSortKey = 'type';
+export const DEFAULT_WORKLOADS_SORT_DIRECTION = 'asc';
+export const DEFAULT_WORKLOADS_VIEW_MODE: ViewMode = 'all';
+export const DEFAULT_WORKLOADS_STATUS_MODE: WorkloadsStatusMode = 'all';
+export const DEFAULT_WORKLOADS_GROUPING_MODE: WorkloadsGroupingMode = 'grouped';
+
+export const countActiveWorkloadsFilters = (
+ options: CountActiveWorkloadsFiltersOptions,
+): number => {
+ let count = 0;
+
+ if (options.search.trim() !== '') count++;
+ if (options.viewMode !== DEFAULT_WORKLOADS_VIEW_MODE) count++;
+ if (options.statusMode !== DEFAULT_WORKLOADS_STATUS_MODE) count++;
+ if ((options.hostFilterValue ?? '') !== '') count++;
+ if ((options.platformFilterValue ?? '') !== '') count++;
+ if ((options.namespaceFilterValue ?? '') !== '') count++;
+
+ return count;
+};
+
+export const hasActiveWorkloadsFilters = (
+ options: HasActiveWorkloadsFiltersOptions,
+): boolean =>
+ countActiveWorkloadsFilters(options) > 0 ||
+ options.groupingMode !== DEFAULT_WORKLOADS_GROUPING_MODE;
diff --git a/frontend-modern/src/components/shared/InfrastructureSummaryTable.tsx b/frontend-modern/src/components/shared/InfrastructureSummaryTable.tsx
index 2c5b00fa23..9fc838e00e 100644
--- a/frontend-modern/src/components/shared/InfrastructureSummaryTable.tsx
+++ b/frontend-modern/src/components/shared/InfrastructureSummaryTable.tsx
@@ -81,7 +81,7 @@ export const InfrastructureSummaryTable: Component<InfrastructureSummaryTablePro
Temp {table.renderSortIndicator('temperature')}
</TableHead>
</Show>
- <Show when={props.currentTab === 'dashboard'}>
+ <Show when={props.currentTab === 'workloads'}>
<TableHead
class={thClass}
style={{ width: '50px', 'min-width': '50px', 'max-width': '50px' }}
diff --git a/frontend-modern/src/components/shared/InfrastructureSummaryTableRow.tsx b/frontend-modern/src/components/shared/InfrastructureSummaryTableRow.tsx
index 84f6287b8d..d97f6822f2 100644
--- a/frontend-modern/src/components/shared/InfrastructureSummaryTableRow.tsx
+++ b/frontend-modern/src/components/shared/InfrastructureSummaryTableRow.tsx
@@ -7,9 +7,9 @@ import { getNodeDisplayName, hasAlternateDisplayName } from '@/utils/nodes';
import { formatTemperature } from '@/utils/temperature';
import { StatusDot } from '@/components/shared/StatusDot';
import { ResponsiveMetricCell } from '@/components/shared/responsive';
-import { EnhancedCPUBar } from '@/components/Dashboard/EnhancedCPUBar';
-import { StackedMemoryBar } from '@/components/Dashboard/StackedMemoryBar';
-import { StackedDiskBar } from '@/components/Dashboard/StackedDiskBar';
+import { EnhancedCPUBar } from '@/components/Workloads/EnhancedCPUBar';
+import { StackedMemoryBar } from '@/components/Workloads/StackedMemoryBar';
+import { StackedDiskBar } from '@/components/Workloads/StackedDiskBar';
import { TemperatureGauge } from '@/components/shared/TemperatureGauge';
import { getNodeStatusIndicator, getPBSStatusIndicator } from '@/utils/status';
import { TableCell, TableRow } from '@/components/shared/Table';
@@ -394,7 +394,7 @@ export const InfrastructureSummaryTableRow: Component<InfrastructureSummaryTable
</TableCell>
</Show>
- <Show when={props.tableProps.currentTab === 'dashboard'}>
+ <Show when={props.tableProps.currentTab === 'workloads'}>
<TableCell class={tdClass}>
<div class="flex justify-center">
<span class={online() ? 'text-xs text-base-content' : 'text-xs text-muted'}>
diff --git a/frontend-modern/src/components/shared/PageControls.guardrails.test.ts b/frontend-modern/src/components/shared/PageControls.guardrails.test.ts
index b187146a90..53a35b8fa2 100644
--- a/frontend-modern/src/components/shared/PageControls.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/PageControls.guardrails.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';
import pageControlsSource from '@/components/shared/PageControls.tsx?raw';
-import dashboardFilterSource from '@/components/Dashboard/DashboardFilter.tsx?raw';
+import workloadsFilterSource from '@/components/Workloads/WorkloadsFilter.tsx?raw';
import recoveryPageSource from '@/components/Recovery/Recovery.tsx?raw';
import recoveryHistorySectionSource from '@/components/Recovery/RecoveryHistorySection.tsx?raw';
import recoveryProtectedInventorySectionSource from '@/components/Recovery/RecoveryProtectedInventorySection.tsx?raw';
@@ -29,9 +29,9 @@ describe('page controls guardrails', () => {
expect(pageControlsSource).toContain('const activeSearchTrailing = () => (mobileControlsEnabled() ? undefined : local.searchTrailing);');
expect(pageControlsSource).toContain('searchAccessory={activeSearchTrailing() ?? mobileSearchAccessory()}');
- expect(dashboardFilterSource).toContain('PageControls');
- expect(dashboardFilterSource).not.toContain('<FilterHeader');
- expect(dashboardFilterSource).not.toContain('<ColumnPicker');
+ expect(workloadsFilterSource).toContain('PageControls');
+ expect(workloadsFilterSource).not.toContain('<FilterHeader');
+ expect(workloadsFilterSource).not.toContain('<ColumnPicker');
expect(recoveryProtectedInventorySectionSource).toContain('PageControls');
expect(recoveryProtectedInventorySectionSource).not.toContain('<FilterHeader');
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index a90f60a6e8..5b01874d49 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -70,7 +70,7 @@ import summaryTableFocusSource from '@/components/shared/summaryTableFocus.ts?ra
import tableCardSource from '@/components/shared/TableCard.tsx?raw';
import groupedTableModeSegmentedControlSource from '@/components/shared/GroupedTableModeSegmentedControl.tsx?raw';
import groupedTableRowPresentationSource from '@/components/shared/groupedTableRowPresentation.ts?raw';
-import dashboardFilterSource from '@/components/Dashboard/DashboardFilter.tsx?raw';
+import workloadsFilterSource from '@/components/Workloads/WorkloadsFilter.tsx?raw';
import infrastructurePageSurfaceSource from '@/features/infrastructure/InfrastructurePageSurface.tsx?raw';
import infrastructureSourceManagerSource from '@/components/Settings/InfrastructureSourceManager.tsx?raw';
import infrastructureSummaryTableSource from '@/components/shared/InfrastructureSummaryTable.tsx?raw';
@@ -118,11 +118,11 @@ import webInterfaceUrlFieldSource from '@/components/shared/WebInterfaceUrlField
import webInterfaceUrlFieldModelSource from '@/components/shared/webInterfaceUrlFieldModel.ts?raw';
import webInterfaceUrlFieldStateSource from '@/components/shared/useWebInterfaceUrlFieldState.ts?raw';
import upgradeNavigationSource from '@/utils/upgradeNavigation.ts?raw';
-import guestRowSource from '@/components/Dashboard/GuestRow.tsx?raw';
-import dashboardWorkloadTableSource from '@/components/Dashboard/DashboardWorkloadTable.tsx?raw';
-import workloadPanelSource from '@/components/Dashboard/WorkloadPanel.tsx?raw';
-import guestRowStateSource from '@/components/Dashboard/useGuestRowState.ts?raw';
-import dashboardSelectionStateSource from '@/components/Dashboard/useDashboardSelectionState.ts?raw';
+import guestRowSource from '@/components/Workloads/GuestRow.tsx?raw';
+import workloadsTableSource from '@/components/Workloads/WorkloadsTable.tsx?raw';
+import workloadPanelSource from '@/components/Workloads/WorkloadPanel.tsx?raw';
+import guestRowStateSource from '@/components/Workloads/useGuestRowState.ts?raw';
+import workloadSelectionStateSource from '@/components/Workloads/useWorkloadSelectionState.ts?raw';
import infrastructureSummarySource from '@/components/Infrastructure/InfrastructureSummary.tsx?raw';
import infrastructureSummaryStateSource from '@/components/Infrastructure/useInfrastructureSummaryState.ts?raw';
import unifiedResourceHostTableCardSource from '@/components/Infrastructure/UnifiedResourceHostTableCard.tsx?raw';
@@ -306,7 +306,7 @@ describe('shared primitive guardrails', () => {
expect(summaryTableCardHeaderSource).toContain("from './TableCardHeader'");
expect(summaryTableCardHeaderSource).not.toContain('border-b border-border bg-surface-hover');
for (const source of [
- dashboardWorkloadTableSource,
+ workloadsTableSource,
unifiedResourceHostTableCardSource,
unifiedResourceServiceInfrastructureCardSource,
storageContentCardSource,
@@ -328,7 +328,7 @@ describe('shared primitive guardrails', () => {
expect(tableCardSource).toContain('<Card');
for (const source of [
- dashboardWorkloadTableSource,
+ workloadsTableSource,
unifiedResourceHostTableCardSource,
unifiedResourceServiceInfrastructureCardSource,
storageContentCardSource,
@@ -369,10 +369,10 @@ describe('shared primitive guardrails', () => {
expect(interactiveSparklineModelSource).toContain('onHoverSyncChange');
expect(densityMapModelSource).toContain('onHoverSyncChange');
- expect(dashboardSelectionStateSource).toContain('preserveScrollableAncestorVerticalOffset');
- expect(dashboardSelectionStateSource).toContain('hoveredWorkloadGroupScope');
- expect(dashboardSelectionStateSource).toContain('activeSummaryWorkloadGroupScope');
- expect(dashboardSelectionStateSource).not.toContain('const scrollTop = scroller?.scrollTop');
+ expect(workloadSelectionStateSource).toContain('preserveScrollableAncestorVerticalOffset');
+ expect(workloadSelectionStateSource).toContain('hoveredWorkloadGroupScope');
+ expect(workloadSelectionStateSource).toContain('activeSummaryWorkloadGroupScope');
+ expect(workloadSelectionStateSource).not.toContain('const scrollTop = scroller?.scrollTop');
expect(summaryJumpToRowButtonSource).toContain('<span>Jump to row</span>');
expect(summaryJumpToRowButtonSource).toContain('props.onClick');
@@ -519,7 +519,7 @@ describe('shared primitive guardrails', () => {
"import ListIcon from 'lucide-solid/icons/list'",
);
- for (const source of [dashboardFilterSource, infrastructurePageSurfaceSource]) {
+ for (const source of [workloadsFilterSource, infrastructurePageSurfaceSource]) {
expect(source).toContain('GroupedTableModeSegmentedControl');
expect(source).not.toContain("title: 'Group by node'");
expect(source).not.toContain("title: 'Grouped table view'");
@@ -821,7 +821,7 @@ describe('shared primitive guardrails', () => {
expect(guestRowSource).not.toContain("from './TagBadges'");
expect(resourceDetailDrawerOverviewSource).toContain("from '@/components/shared/TagBadges'");
expect(resourceDetailDrawerOverviewSource).not.toContain(
- "from '@/components/Dashboard/TagBadges'",
+ "from '@/components/Workloads/TagBadges'",
);
});
@@ -1290,7 +1290,7 @@ describe('shared primitive guardrails', () => {
expect(whatsNewModalModelSource).toContain('WHATS_NEW_DOCS_LABEL');
expect(whatsNewModalModelSource).toContain('MIGRATION_GUIDE_DOC_URL');
expect(whatsNewModalModelSource).toContain('Telemetry details');
- expect(whatsNewModalModelSource).toContain("title: 'Dashboard'");
+ expect(whatsNewModalModelSource).toContain("title: 'Infrastructure'");
});
it('keeps dialog stack visibility in the shared dialog runtime', () => {
diff --git a/frontend-modern/src/components/shared/TypeColumn.guardrails.test.ts b/frontend-modern/src/components/shared/TypeColumn.guardrails.test.ts
index 90817d2949..48f264fbad 100644
--- a/frontend-modern/src/components/shared/TypeColumn.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/TypeColumn.guardrails.test.ts
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
-import guestRowModelSource from '@/components/Dashboard/guestRowModel.tsx?raw';
+import guestRowModelSource from '@/components/Workloads/guestRowModel.tsx?raw';
import recoverySource from '@/components/Recovery/Recovery.tsx?raw';
import responsiveSource from '@/types/responsive.ts?raw';
import typeColumnDefinitionSource from '@/utils/typeColumnDefinition.ts?raw';
@@ -92,7 +92,7 @@ describe('type column guardrails', () => {
.sort();
expect(typeColumnUsers).toEqual([
- '../Dashboard/guestRowModel.tsx',
+ '../Workloads/guestRowModel.tsx',
'../Recovery/Recovery.tsx',
]);
@@ -127,7 +127,7 @@ describe('type column guardrails', () => {
.sort();
expect(directHelperImportUsers).toEqual([
- '../Dashboard/guestRowModel.tsx',
+ '../Workloads/guestRowModel.tsx',
'../Recovery/Recovery.tsx',
]);
});
diff --git a/frontend-modern/src/components/shared/WebInterfaceUrlField.tsx b/frontend-modern/src/components/shared/WebInterfaceUrlField.tsx
index 04c711a412..1fe279bce8 100644
--- a/frontend-modern/src/components/shared/WebInterfaceUrlField.tsx
+++ b/frontend-modern/src/components/shared/WebInterfaceUrlField.tsx
@@ -113,7 +113,7 @@ export const WebInterfaceUrlField: Component<WebInterfaceUrlFieldProps> = (props
</Show>
<p class="mt-1.5 text-[10px] text-muted">
- Add a URL to quickly access this {state.targetLabel()}'s web interface from the dashboard.
+ Add a URL to quickly access this {state.targetLabel()}'s web interface from Workloads.
</p>
</div>
</Show>
diff --git a/frontend-modern/src/components/shared/WhatsNewModal.tsx b/frontend-modern/src/components/shared/WhatsNewModal.tsx
index 9ea978c03a..fc9fa0f80b 100644
--- a/frontend-modern/src/components/shared/WhatsNewModal.tsx
+++ b/frontend-modern/src/components/shared/WhatsNewModal.tsx
@@ -1,6 +1,5 @@
import { For, Show } from 'solid-js';
import { Portal } from 'solid-js/web';
-import LayoutDashboardIcon from 'lucide-solid/icons/layout-dashboard';
import ServerIcon from 'lucide-solid/icons/server';
import BoxesIcon from 'lucide-solid/icons/boxes';
import HardDriveIcon from 'lucide-solid/icons/hard-drive';
@@ -27,8 +26,6 @@ import { useWhatsNewModalState } from './useWhatsNewModalState';
function WhatsNewFeatureIcon(props: { card: WhatsNewFeatureCard }) {
switch (props.card.icon) {
- case 'dashboard':
- return <LayoutDashboardIcon class="h-4 w-4" />;
case 'infrastructure':
return <ServerIcon class="h-4 w-4" />;
case 'workloads':
diff --git a/frontend-modern/src/components/shared/__tests__/InfrastructureSelector.test.tsx b/frontend-modern/src/components/shared/__tests__/InfrastructureSelector.test.tsx
index f41a6ec592..0f0a50ddce 100644
--- a/frontend-modern/src/components/shared/__tests__/InfrastructureSelector.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/InfrastructureSelector.test.tsx
@@ -7,54 +7,53 @@ import { InfrastructureSelector } from '@/components/shared/InfrastructureSelect
import { buildInfrastructureSelectorAgents } from '@/components/shared/infrastructureSelectorModel';
import type { Resource } from '@/types/resource';
-const useUnifiedResourcesMock = vi.fn(
- (options?: { enabled?: () => boolean }) => ({
- resources: () =>
- options?.enabled?.() === false
- ? []
- : [
- {
- id: 'node-1',
- type: 'agent',
- name: 'pve1',
- status: 'online',
+const useUnifiedResourcesMock = vi.fn((options?: { enabled?: () => boolean }) => ({
+ resources: () =>
+ options?.enabled?.() === false
+ ? []
+ : [
+ {
+ id: 'node-1',
+ type: 'agent',
+ name: 'pve1',
+ status: 'online',
+ instance: 'main',
+ uptime: 120,
+ platformData: {
+ type: 'node',
+ node: 'pve1',
instance: 'main',
- uptime: 120,
- platformData: {
- type: 'node',
- node: 'pve1',
- instance: 'main',
- pveVersion: '8.0',
- cpu: 0.2,
- memory: { total: 8, used: 4, free: 4, usage: 50 },
- disk: { total: 100, used: 25, free: 75, usage: 25 },
- loadAverage: [0.1, 0.2, 0.3],
- },
- memory: { total: 8, used: 4, free: 4, current: 50 },
- agent: {
- platform: 'linux',
- memory: { total: 8, used: 4, free: 4, usage: 50 },
- disks: [],
- networkInterfaces: [],
- raid: [],
- },
+ pveVersion: '8.0',
+ cpu: 0.2,
+ memory: { total: 8, used: 4, free: 4, usage: 50 },
+ disk: { total: 100, used: 25, free: 75, usage: 25 },
+ loadAverage: [0.1, 0.2, 0.3],
},
- ],
- refetch: vi.fn(),
- mutate: vi.fn(),
- loading: () => false,
- error: () => null,
- }),
-);
+ memory: { total: 8, used: 4, free: 4, current: 50 },
+ agent: {
+ platform: 'linux',
+ memory: { total: 8, used: 4, free: 4, usage: 50 },
+ disks: [],
+ networkInterfaces: [],
+ raid: [],
+ },
+ },
+ ],
+ refetch: vi.fn(),
+ mutate: vi.fn(),
+ loading: () => false,
+ error: () => null,
+}));
-const useRecoveryRollupsMock = vi.fn(
- (_query?: (() => unknown) | undefined) => ({
- rollups: () => [],
- }),
-);
+const useRecoveryRollupsMock = vi.fn((_query?: (() => unknown) | undefined) => ({
+ rollups: () => [],
+}));
const infrastructureSummaryTableMock = vi.fn(
- (props: { onNodeClick: (nodeId: string, nodeType: 'pve' | 'pbs') => void; selectedNode: string | null }) => (
+ (props: {
+ onNodeClick: (nodeId: string, nodeType: 'pve' | 'pbs') => void;
+ selectedNode: string | null;
+ }) => (
<button
type="button"
data-testid="infrastructure-selector-table"
@@ -97,20 +96,14 @@ describe('InfrastructureSelector', () => {
'export function useInfrastructureSelectorState',
);
- expect(infrastructureSelectorModelSource).toContain(
- 'buildInfrastructureSelectorAgents',
- );
- expect(infrastructureSelectorModelSource).toContain(
- 'buildInfrastructureSelectorBackupCounts',
- );
- expect(infrastructureSelectorModelSource).toContain(
- 'buildInfrastructureSelectorUnifiedNodes',
- );
+ expect(infrastructureSelectorModelSource).toContain('buildInfrastructureSelectorAgents');
+ expect(infrastructureSelectorModelSource).toContain('buildInfrastructureSelectorBackupCounts');
+ expect(infrastructureSelectorModelSource).toContain('buildInfrastructureSelectorUnifiedNodes');
expect(infrastructureSelectorModelSource).toContain('isAgentFacetInfrastructureResource');
});
it('disables selector data hooks when the node summary is hidden', () => {
- render(() => <InfrastructureSelector currentTab="dashboard" showNodeSummary={false} />);
+ render(() => <InfrastructureSelector currentTab="workloads" showNodeSummary={false} />);
expect(screen.queryByTestId('infrastructure-selector-table')).not.toBeInTheDocument();
expect(useUnifiedResourcesMock).toHaveBeenCalledTimes(1);
@@ -123,9 +116,7 @@ describe('InfrastructureSelector', () => {
expect(unifiedOptions?.cacheKey).toBe('all-resources');
expect(unifiedOptions?.enabled?.()).toBe(false);
- const recoveryQuery = useRecoveryRollupsMock.mock.calls[0]?.[0] as
- | (() => unknown)
- | undefined;
+ const recoveryQuery = useRecoveryRollupsMock.mock.calls[0]?.[0] as (() => unknown) | undefined;
expect(recoveryQuery?.()).toBeNull();
});
@@ -133,7 +124,7 @@ describe('InfrastructureSelector', () => {
const onNodeSelect = vi.fn();
render(() => (
- <InfrastructureSelector currentTab="dashboard" showNodeSummary onNodeSelect={onNodeSelect} />
+ <InfrastructureSelector currentTab="workloads" showNodeSummary onNodeSelect={onNodeSelect} />
));
const table = screen.getByTestId('infrastructure-selector-table');
diff --git a/frontend-modern/src/components/shared/__tests__/InfrastructureSummaryTable.test.tsx b/frontend-modern/src/components/shared/__tests__/InfrastructureSummaryTable.test.tsx
index 58f0238724..477bc5327c 100644
--- a/frontend-modern/src/components/shared/__tests__/InfrastructureSummaryTable.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/InfrastructureSummaryTable.test.tsx
@@ -46,18 +46,18 @@ vi.mock('@/components/shared/TemperatureGauge', () => ({
TemperatureGauge: () => <div data-testid="temperature-gauge">temp</div>,
}));
-vi.mock('@/components/Dashboard/EnhancedCPUBar', () => ({
+vi.mock('@/components/Workloads/EnhancedCPUBar', () => ({
EnhancedCPUBar: (props: unknown) => {
enhancedCpuBarMock(props);
return <div data-testid="enhanced-cpu-bar">cpu</div>;
},
}));
-vi.mock('@/components/Dashboard/StackedMemoryBar', () => ({
+vi.mock('@/components/Workloads/StackedMemoryBar', () => ({
StackedMemoryBar: () => <div data-testid="stacked-memory-bar">memory</div>,
}));
-vi.mock('@/components/Dashboard/StackedDiskBar', () => ({
+vi.mock('@/components/Workloads/StackedDiskBar', () => ({
StackedDiskBar: () => <div data-testid="stacked-disk-bar">disk</div>,
}));
@@ -134,7 +134,7 @@ describe('InfrastructureSummaryTable', () => {
<InfrastructureSummaryTable
nodes={[makeNode({ linkedAgentId: 'agent-host-1' })]}
selectedNode={null}
- currentTab="dashboard"
+ currentTab="workloads"
onNodeClick={vi.fn()}
/>
));
@@ -153,7 +153,7 @@ describe('InfrastructureSummaryTable', () => {
<InfrastructureSummaryTable
nodes={[makeNode({ id: 'node-2', name: 'pve2' })]}
selectedNode={null}
- currentTab="dashboard"
+ currentTab="workloads"
onNodeClick={vi.fn()}
/>
));
@@ -170,7 +170,7 @@ describe('InfrastructureSummaryTable', () => {
<InfrastructureSummaryTable
nodes={[makeNode()]}
selectedNode={null}
- currentTab="dashboard"
+ currentTab="workloads"
onNodeClick={vi.fn()}
/>
));
@@ -196,10 +196,12 @@ describe('InfrastructureSummaryTable', () => {
hostname: 'pve1.internal',
},
},
- } as Partial<Agent> & { platformData: { linkedAgentId: string; agent: { hostname: string } } }),
+ } as Partial<Agent> & {
+ platformData: { linkedAgentId: string; agent: { hostname: string } };
+ }),
]}
selectedNode="node-1"
- currentTab="dashboard"
+ currentTab="workloads"
onNodeClick={vi.fn()}
/>
));
diff --git a/frontend-modern/src/components/shared/__tests__/MobileNavBar.test.tsx b/frontend-modern/src/components/shared/__tests__/MobileNavBar.test.tsx
index 3b9da7f4cc..c57c24112f 100644
--- a/frontend-modern/src/components/shared/__tests__/MobileNavBar.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/MobileNavBar.test.tsx
@@ -12,7 +12,9 @@ window.requestAnimationFrame = ((callback: FrameRequestCallback) => {
return 1;
}) as typeof window.requestAnimationFrame;
-const DashboardIcon: Component<{ class?: string }> = (props) => <span class={props.class}>DB</span>;
+const InfrastructureIcon: Component<{ class?: string }> = (props) => (
+ <span class={props.class}>IN</span>
+);
const StorageIcon: Component<{ class?: string }> = (props) => <span class={props.class}>ST</span>;
const AlertsIcon: Component<{ class?: string }> = (props) => <span class={props.class}>AL</span>;
const SettingsIcon: Component<{ class?: string }> = (props) => <span class={props.class}>SE</span>;
@@ -78,8 +80,19 @@ describe('MobileNavBar', () => {
const { container } = render(() => (
<MobileNavBar
- activeTab={() => 'dashboard'}
+ activeTab={() => 'infrastructure'}
platformTabs={() => [
+ {
+ id: 'infrastructure',
+ label: 'Infrastructure',
+ route: '/infrastructure',
+ settingsRoute: '/settings',
+ tooltip: 'Infrastructure',
+ enabled: true,
+ live: true,
+ icon: InfrastructureIcon,
+ alwaysShow: true,
+ },
{
id: 'storage',
label: 'Storage',
@@ -91,17 +104,6 @@ describe('MobileNavBar', () => {
icon: StorageIcon,
alwaysShow: true,
},
- {
- id: 'dashboard',
- label: 'Dashboard',
- route: '/dashboard',
- settingsRoute: '/settings/dashboard',
- tooltip: 'Dashboard',
- enabled: true,
- live: true,
- icon: DashboardIcon,
- alwaysShow: true,
- },
]}
utilityTabs={() => [
{
@@ -138,7 +140,7 @@ describe('MobileNavBar', () => {
fireEvent.scroll(navList);
const buttons = container.querySelectorAll('button[data-tab-id]');
- expect(buttons[0]).toHaveAttribute('data-tab-id', 'dashboard');
+ expect(buttons[0]).toHaveAttribute('data-tab-id', 'infrastructure');
expect(buttons[1]).toHaveAttribute('data-tab-id', 'storage');
expect(buttons[2]).toHaveAttribute('data-tab-id', 'alerts');
expect(buttons[3]).toHaveAttribute('data-tab-id', 'settings');
diff --git a/frontend-modern/src/components/shared/__tests__/WebInterfaceUrlField.test.tsx b/frontend-modern/src/components/shared/__tests__/WebInterfaceUrlField.test.tsx
index db65ddd909..c428a62fd7 100644
--- a/frontend-modern/src/components/shared/__tests__/WebInterfaceUrlField.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/WebInterfaceUrlField.test.tsx
@@ -94,7 +94,7 @@ describe('WebInterfaceUrlField', () => {
expect(
await screen.findByText(
- "Add a URL to quickly access this workload's web interface from the dashboard.",
+ "Add a URL to quickly access this workload's web interface from Workloads.",
),
).toBeInTheDocument();
});
diff --git a/frontend-modern/src/components/shared/__tests__/WhatsNewModal.test.tsx b/frontend-modern/src/components/shared/__tests__/WhatsNewModal.test.tsx
index 3c06d492c1..89e8d4a6bd 100644
--- a/frontend-modern/src/components/shared/__tests__/WhatsNewModal.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/WhatsNewModal.test.tsx
@@ -69,7 +69,7 @@ describe('WhatsNewModal', () => {
'https://github.com/rcourtman/Pulse/blob/main/docs/PRIVACY.md',
);
expect(whatsNewModalModelSource).toContain('WHATS_NEW_DOCS_LABEL');
- expect(whatsNewModalModelSource).toContain("title: 'Dashboard'");
+ expect(whatsNewModalModelSource).toContain("title: 'Infrastructure'");
});
it('renders when the navigation modal has not been seen yet', async () => {
@@ -77,10 +77,10 @@ describe('WhatsNewModal', () => {
const dialog = await screen.findByRole('dialog', { name: 'Pulse navigation guide' });
expect(dialog).toBeInTheDocument();
- expect(within(dialog).getByText('Step 1 of 5')).toBeInTheDocument();
+ expect(within(dialog).getByText('Step 1 of 4')).toBeInTheDocument();
expect(within(dialog).getByText('Nav guide')).toBeInTheDocument();
expect(
- within(dialog).getByText(/Start here for the live estate overview/i),
+ within(dialog).getByText(/Start here to add, inspect, and manage infrastructure sources/i),
).toBeInTheDocument();
expect(within(dialog).queryByText('Where Things Moved')).not.toBeInTheDocument();
expect(within(dialog).getByRole('link', { name: 'Navigation guide' })).toBeInTheDocument();
@@ -137,10 +137,8 @@ describe('WhatsNewModal', () => {
it('advances through the guided tour and finishes on the last step', async () => {
render(() => <WhatsNewModal />);
- expect(await screen.findByText(/Start here for the live estate overview/i)).toBeInTheDocument();
- fireEvent.click(screen.getByRole('button', { name: 'Next' }));
expect(
- await screen.findByText(/Use this to add and manage infrastructure sources/i),
+ await screen.findByText(/Start here to add, inspect, and manage infrastructure sources/i),
).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: 'Next' }));
expect(await screen.findByText(/Use this for VMs, containers, pods/i)).toBeInTheDocument();
@@ -156,12 +154,14 @@ describe('WhatsNewModal', () => {
it('lets the user jump to a tour stop directly from the stop map', async () => {
render(() => <WhatsNewModal />);
- expect(await screen.findByText(/Start here for the live estate overview/i)).toBeInTheDocument();
+ expect(
+ await screen.findByText(/Start here to add, inspect, and manage infrastructure sources/i),
+ ).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: /Workloads/i }));
expect(await screen.findByText(/Use this for VMs, containers, pods/i)).toBeInTheDocument();
- expect(screen.getByText('Step 3 of 5')).toBeInTheDocument();
+ expect(screen.getByText('Step 2 of 4')).toBeInTheDocument();
});
it('routes the docs CTA through the navigation guide', async () => {
@@ -177,7 +177,7 @@ describe('WhatsNewModal', () => {
render(() => <WhatsNewModal />);
const dialog = await screen.findByRole('dialog', { name: 'Pulse navigation guide' });
- expect(within(dialog).getByText('Step 5 of 5')).toBeInTheDocument();
+ expect(within(dialog).getByText('Step 4 of 4')).toBeInTheDocument();
expect(
within(dialog).getByText(/Use this for backup coverage, snapshots, replication/i),
).toBeInTheDocument();
diff --git a/frontend-modern/src/components/shared/cards/RootDiskCard.tsx b/frontend-modern/src/components/shared/cards/RootDiskCard.tsx
index da2a4cb450..efcd7146c2 100644
--- a/frontend-modern/src/components/shared/cards/RootDiskCard.tsx
+++ b/frontend-modern/src/components/shared/cards/RootDiskCard.tsx
@@ -1,7 +1,7 @@
import { Component } from 'solid-js';
import { Node } from '@/types/api';
import { formatBytes } from '@/utils/format';
-import { StackedDiskBar } from '@/components/Dashboard/StackedDiskBar';
+import { StackedDiskBar } from '@/components/Workloads/StackedDiskBar';
interface RootDiskCardProps {
node: Node;
diff --git a/frontend-modern/src/components/shared/infrastructureSelectorModel.ts b/frontend-modern/src/components/shared/infrastructureSelectorModel.ts
index 2b03954982..709104687d 100644
--- a/frontend-modern/src/components/shared/infrastructureSelectorModel.ts
+++ b/frontend-modern/src/components/shared/infrastructureSelectorModel.ts
@@ -13,7 +13,7 @@ import {
} from '@/utils/agentResources';
export interface InfrastructureSelectorProps {
- currentTab: 'dashboard' | 'storage' | 'recovery';
+ currentTab: 'workloads' | 'storage' | 'recovery';
globalTemperatureMonitoringEnabled?: boolean;
onNodeSelect?: (nodeId: string | null, nodeType: 'pve' | 'pbs' | null) => void;
onNamespaceSelect?: (namespace: string) => void;
diff --git a/frontend-modern/src/components/shared/infrastructureSummaryTableModel.ts b/frontend-modern/src/components/shared/infrastructureSummaryTableModel.ts
index 9920c4c492..ccbc00c3a1 100644
--- a/frontend-modern/src/components/shared/infrastructureSummaryTableModel.ts
+++ b/frontend-modern/src/components/shared/infrastructureSummaryTableModel.ts
@@ -18,7 +18,7 @@ export interface InfrastructureSummaryTableProps {
diskCounts?: Record<string, number>;
agents?: Agent[];
backupCounts?: Record<string, number>;
- currentTab: 'dashboard' | 'storage' | 'recovery';
+ currentTab: 'workloads' | 'storage' | 'recovery';
selectedNode: string | null;
globalTemperatureMonitoringEnabled?: boolean;
onNodeClick: (nodeId: string, nodeType: 'pve' | 'pbs') => void;
diff --git a/frontend-modern/src/components/shared/mobileNavBarModel.ts b/frontend-modern/src/components/shared/mobileNavBarModel.ts
index c9554d6686..2691dacb77 100644
--- a/frontend-modern/src/components/shared/mobileNavBarModel.ts
+++ b/frontend-modern/src/components/shared/mobileNavBarModel.ts
@@ -35,7 +35,6 @@ export type MobileNavBarProps = {
};
const MOBILE_NAV_PLATFORM_PRIORITY = [
- 'dashboard',
'infrastructure',
'workloads',
'storage',
diff --git a/frontend-modern/src/components/shared/responsive/ResponsiveMetricCell.tsx b/frontend-modern/src/components/shared/responsive/ResponsiveMetricCell.tsx
index 6f6e91a2e2..627325b4af 100644
--- a/frontend-modern/src/components/shared/responsive/ResponsiveMetricCell.tsx
+++ b/frontend-modern/src/components/shared/responsive/ResponsiveMetricCell.tsx
@@ -1,5 +1,5 @@
import { Component, Show, createMemo, JSX } from 'solid-js';
-import { MetricBar } from '@/components/Dashboard/MetricBar';
+import { MetricBar } from '@/components/Workloads/MetricBar';
import { useBreakpoint } from '@/hooks/useBreakpoint';
import { formatPercent } from '@/utils/format';
import { getMetricSeverity } from '@/utils/metricThresholds';
diff --git a/frontend-modern/src/components/shared/useInfrastructureSummaryTableState.ts b/frontend-modern/src/components/shared/useInfrastructureSummaryTableState.ts
index 3c30be876d..02b031578f 100644
--- a/frontend-modern/src/components/shared/useInfrastructureSummaryTableState.ts
+++ b/frontend-modern/src/components/shared/useInfrastructureSummaryTableState.ts
@@ -33,7 +33,7 @@ export function useInfrastructureSummaryTableState(props: InfrastructureSummaryT
const totalColumnCount = createMemo(() => {
let count = 6;
if (hasAnyTemperatureData()) count += 1;
- if (props.currentTab === 'dashboard') count += 2;
+ if (props.currentTab === 'workloads') count += 2;
else if (props.currentTab === 'storage') count += 2;
else if (props.currentTab === 'recovery') count += 1;
return count;
diff --git a/frontend-modern/src/components/shared/useWhatsNewModalState.ts b/frontend-modern/src/components/shared/useWhatsNewModalState.ts
index 73e46819bd..f5343fa5fb 100644
--- a/frontend-modern/src/components/shared/useWhatsNewModalState.ts
+++ b/frontend-modern/src/components/shared/useWhatsNewModalState.ts
@@ -14,7 +14,6 @@ type SpotlightRect = {
};
const DESKTOP_TAB_SELECTOR_BY_TARGET = {
- dashboard: '[role="tab"][title="Environment overview and command center"]',
infrastructure: '[role="tab"][title="All agents and nodes across platforms"]',
workloads: '[role="tab"][title="VMs, containers, and Kubernetes workloads"]',
storage: '[role="tab"][title="Storage pools, disks, and datastores"]',
@@ -22,7 +21,6 @@ const DESKTOP_TAB_SELECTOR_BY_TARGET = {
} as const;
const MOBILE_TAB_SELECTOR_BY_TARGET = {
- dashboard: 'button[data-tab-id="dashboard"]',
infrastructure: 'button[data-tab-id="infrastructure"]',
workloads: 'button[data-tab-id="workloads"]',
storage: 'button[data-tab-id="storage"]',
@@ -39,7 +37,7 @@ const getInitialStepIndexForPath = (): number => {
if (path.startsWith('/storage')) return 'storage';
if (path.startsWith('/workloads')) return 'workloads';
if (path.startsWith('/infrastructure')) return 'infrastructure';
- return 'dashboard';
+ return 'infrastructure';
})();
const index = WHATS_NEW_FEATURE_CARDS.findIndex((card) => card.target === target);
return index >= 0 ? index : 0;
diff --git a/frontend-modern/src/components/shared/whatsNewModalModel.ts b/frontend-modern/src/components/shared/whatsNewModalModel.ts
index ee444751ba..a53ede3719 100644
--- a/frontend-modern/src/components/shared/whatsNewModalModel.ts
+++ b/frontend-modern/src/components/shared/whatsNewModalModel.ts
@@ -3,8 +3,8 @@ import { MIGRATION_GUIDE_DOC_URL, PRIVACY_DOC_URL } from '@/utils/docsLinks';
export interface WhatsNewFeatureCard {
accent: string;
description: string;
- icon: 'dashboard' | 'infrastructure' | 'workloads' | 'storage' | 'recovery';
- target: 'dashboard' | 'infrastructure' | 'workloads' | 'storage' | 'recovery';
+ icon: 'infrastructure' | 'workloads' | 'storage' | 'recovery';
+ target: 'infrastructure' | 'workloads' | 'storage' | 'recovery';
title: string;
}
@@ -12,18 +12,10 @@ export const WHATS_NEW_DOCS_URL = MIGRATION_GUIDE_DOC_URL;
export const WHATS_NEW_PRIVACY_URL = PRIVACY_DOC_URL;
export const WHATS_NEW_FEATURE_CARDS: WhatsNewFeatureCard[] = [
- {
- accent: 'border-indigo-200 bg-indigo-50 dark:border-indigo-800 dark:bg-indigo-900',
- description:
- 'Start here for the live estate overview: health, alerts, capacity, and recent activity.',
- icon: 'dashboard',
- target: 'dashboard',
- title: 'Dashboard',
- },
{
accent: 'border-blue-200 bg-blue-50 dark:border-blue-800 dark:bg-blue-900',
description:
- 'Use this to add and manage infrastructure sources: platform API inventory, Pulse Agent telemetry, and discovered candidates.',
+ 'Start here to add, inspect, and manage infrastructure sources: platform API inventory, Pulse Agent telemetry, and discovered candidates.',
icon: 'infrastructure',
target: 'infrastructure',
title: 'Infrastructure',
diff --git a/frontend-modern/src/constants/apiScopes.ts b/frontend-modern/src/constants/apiScopes.ts
index 8a9972ab3d..7b8fa972ad 100644
--- a/frontend-modern/src/constants/apiScopes.ts
+++ b/frontend-modern/src/constants/apiScopes.ts
@@ -21,8 +21,8 @@ export const AUDIT_READ_SCOPE = 'audit:read';
export const API_SCOPE_OPTIONS: APIScopeOption[] = [
{
value: MONITORING_READ_SCOPE,
- label: 'Dashboards & alerts (read)',
- description: 'View monitoring data, dashboards, and alert history.',
+ label: 'Monitoring & alerts (read)',
+ description: 'View monitoring data, infrastructure, workloads, and alert history.',
group: 'Monitoring',
},
{
diff --git a/frontend-modern/src/features/dashboardOverview/ActionRequiredPanel.tsx b/frontend-modern/src/features/dashboardOverview/ActionRequiredPanel.tsx
deleted file mode 100644
index c9054ecec8..0000000000
--- a/frontend-modern/src/features/dashboardOverview/ActionRequiredPanel.tsx
+++ /dev/null
@@ -1,451 +0,0 @@
-import { For, Show, createSignal, createEffect, onCleanup, createMemo } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { StatusDot } from '@/components/shared/StatusDot';
-import { aiIntelligenceStore, type UnifiedFinding } from '@/stores/aiIntelligence';
-import { notificationStore } from '@/stores/notifications';
-import { AlertsAPI } from '@/api/alerts';
-import { hasFeature } from '@/stores/license';
-import { formatRelativeTime } from '@/utils/format';
-import { getApprovalRiskPresentation } from '@/utils/approvalRiskPresentation';
-import {
- getFindingCompactBadgePresentation,
- getFindingManualControlsPresentation,
- getFindingPrimaryActionPresentation,
- getFindingTitlePresentation,
- getInvestigationOutcomeBadgeClasses,
- getInvestigationOutcomeLabel,
-} from '@/utils/aiFindingPresentation';
-import { ALERTS_OVERVIEW_PATH, AI_PATROL_PATH } from '@/routing/resourceLinks';
-import type { Alert } from '@/types/api';
-import type { ApprovalRequest } from '@/api/ai';
-import CheckIcon from 'lucide-solid/icons/check';
-import XIcon from 'lucide-solid/icons/x';
-import AlertTriangleIcon from 'lucide-solid/icons/alert-triangle';
-import RefreshCwIcon from 'lucide-solid/icons/refresh-cw';
-
-// ─── Props ──────────────────────────────────────────────────────────
-interface ActionRequiredPanelProps {
- pendingApprovals: ApprovalRequest[];
- unackedCriticalAlerts: Alert[];
- findingsNeedingAttention: UnifiedFinding[];
-}
-
-// ─── Pending Approvals sub-section ──────────────────────────────────
-function PendingApprovalRows(props: { approvals: ApprovalRequest[] }) {
- const [actionLoading, setActionLoading] = createSignal<string | null>(null);
- const [tick, setTick] = createSignal(Date.now());
-
- createEffect(() => {
- if (props.approvals.length > 0) {
- const interval = setInterval(() => setTick(Date.now()), 1000);
- onCleanup(() => clearInterval(interval));
- }
- });
-
- const timeRemaining = (expiresAt: string) => {
- void tick();
- const diff = new Date(expiresAt).getTime() - Date.now();
- if (diff <= 0) return 'expired';
- const mins = Math.floor(diff / 60000);
- const secs = Math.floor((diff % 60000) / 1000);
- if (mins > 0) return `${mins}m ${secs}s`;
- return `${secs}s`;
- };
-
- const handleApprove = async (approval: ApprovalRequest) => {
- setActionLoading(approval.id);
- try {
- const result = await aiIntelligenceStore.approvePendingApproval(approval.id);
- if (!result) {
- notificationStore.error('Failed to approve action');
- } else if (result.success === false || result.approved === false) {
- notificationStore.error(result?.error || result?.message || 'Approval execution failed');
- } else {
- notificationStore.success(result?.message || 'Approval granted');
- }
- } catch (err) {
- notificationStore.error((err as Error).message || 'Failed to approve action');
- } finally {
- setActionLoading(null);
- }
- };
-
- const handleDeny = async (approval: ApprovalRequest) => {
- setActionLoading(approval.id);
- try {
- const success = await aiIntelligenceStore.denyPendingApproval(approval.id);
- if (success) {
- notificationStore.success('Approval denied');
- } else {
- notificationStore.error('Failed to deny approval');
- }
- } catch (err) {
- notificationStore.error((err as Error).message || 'Failed to deny approval');
- } finally {
- setActionLoading(null);
- }
- };
-
- const approvalKindLabel = (approval: ApprovalRequest) =>
- approval.toolId === 'investigation_fix' ? 'Patrol fix' : 'Assistant action';
-
- const approvalTitle = (approval: ApprovalRequest) =>
- approval.context ||
- approval.plan?.summary ||
- approval.plan?.message ||
- approval.preflight?.intendedChange ||
- approval.command;
-
- const approvalDetail = (approval: ApprovalRequest) =>
- approval.preflight?.dryRunSummary ||
- approval.plan?.message ||
- approval.plan?.summary ||
- approval.targetName ||
- approval.command;
-
- return (
- <div class="space-y-1.5">
- <p class="text-[11px] font-semibold uppercase tracking-wide text-muted">Pending Approvals</p>
- <ul class="space-y-1" role="list">
- <For each={props.approvals}>
- {(approval) => {
- const approvalRisk = getApprovalRiskPresentation(approval.riskLevel);
- return (
- <li class="flex items-start gap-2 py-1.5 px-2 -mx-2 rounded hover:bg-surface-hover transition-colors">
- <span
- class={`mt-0.5 shrink-0 px-1.5 py-0.5 text-[10px] font-medium rounded ${approvalRisk.badgeClass}`}
- >
- {approvalRisk.label}
- </span>
- <div class="min-w-0 flex-1">
- <div class="flex min-w-0 items-center gap-1.5">
- <span class="shrink-0 rounded bg-surface-alt px-1.5 py-0.5 text-[10px] font-medium text-muted">
- {approvalKindLabel(approval)}
- </span>
- <p
- class="min-w-0 truncate text-xs text-base-content"
- title={approvalTitle(approval)}
- >
- {approvalTitle(approval)}
- </p>
- </div>
- <Show when={approvalDetail(approval) !== approvalTitle(approval)}>
- <p
- class="mt-0.5 truncate text-[11px] text-muted"
- title={approvalDetail(approval)}
- >
- {approvalDetail(approval)}
- </p>
- </Show>
- </div>
- <span class="mt-0.5 shrink-0 text-[10px] font-mono text-amber-600 dark:text-amber-400">
- {timeRemaining(approval.expiresAt)}
- </span>
- <div class="shrink-0 flex items-center gap-1">
- <button
- type="button"
- onClick={() => handleApprove(approval)}
- disabled={actionLoading() === approval.id}
- class="flex items-center gap-1 px-2 py-1 bg-green-600 hover:bg-green-700 disabled:bg-green-400 text-white text-[10px] font-medium rounded transition-colors"
- >
- <Show
- when={actionLoading() !== approval.id}
- fallback={
- <span class="h-3 w-3 border-2 border-white border-t-transparent rounded-full animate-spin" />
- }
- >
- <CheckIcon class="w-3 h-3" />
- </Show>
- Approve
- </button>
- <button
- type="button"
- onClick={() => handleDeny(approval)}
- disabled={actionLoading() === approval.id}
- class="flex items-center gap-1 px-2 py-1 bg-surface-alt hover:bg-surface-hover disabled:opacity-50 text-base-content text-[10px] font-medium rounded transition-colors"
- >
- <XIcon class="w-3 h-3" />
- Deny
- </button>
- </div>
- </li>
- );
- }}
- </For>
- </ul>
- </div>
- );
-}
-
-// ─── Unacked Critical Alerts sub-section ────────────────────────────
-function UnackedAlertRows(props: { alerts: Alert[] }) {
- const [ackLoading, setAckLoading] = createSignal<string | null>(null);
- const MAX_SHOWN = 5;
-
- const displayed = createMemo(() => props.alerts.slice(0, MAX_SHOWN));
-
- const handleAck = async (alert: Alert) => {
- setAckLoading(alert.id);
- try {
- await AlertsAPI.acknowledge(alert.id);
- notificationStore.success('Alert acknowledged');
- } catch (err) {
- notificationStore.error((err as Error).message || 'Failed to acknowledge alert');
- } finally {
- setAckLoading(null);
- }
- };
-
- // Alert.type is the metric/threshold type (e.g. 'cpu', 'powered-off'), not resource type.
- // Link to alerts overview since we can't reliably determine resource page from alert data.
- const alertLink = () => ALERTS_OVERVIEW_PATH;
-
- return (
- <div class="space-y-1.5">
- <p class="text-[11px] font-semibold uppercase tracking-wide text-muted">
- Unacknowledged Critical Alerts
- </p>
- <ul class="space-y-1" role="list">
- <For each={displayed()}>
- {(alert) => (
- <li class="flex items-center gap-2 py-1.5 px-2 -mx-2 rounded hover:bg-surface-hover transition-colors">
- <StatusDot variant="danger" size="sm" pulse />
- <a
- href={alertLink()}
- class="min-w-0 text-xs font-medium text-base-content truncate hover:underline"
- >
- {alert.resourceName}
- </a>
- <p class="min-w-0 text-xs text-muted truncate flex-1">{alert.message}</p>
- <span class="shrink-0 text-[10px] font-mono text-slate-400">
- {formatRelativeTime(alert.startTime, { compact: true })}
- </span>
- <button
- type="button"
- onClick={() => handleAck(alert)}
- disabled={ackLoading() === alert.id}
- class="shrink-0 px-2 py-1 text-[10px] font-medium text-base-content bg-surface-alt hover:bg-surface-hover disabled:opacity-50 rounded transition-colors"
- >
- {ackLoading() === alert.id ? 'Acking...' : 'Ack'}
- </button>
- </li>
- )}
- </For>
- </ul>
- <Show when={props.alerts.length > MAX_SHOWN}>
- <a
- href={ALERTS_OVERVIEW_PATH}
- class="text-[11px] text-blue-600 hover:underline dark:text-blue-400"
- >
- +{props.alerts.length - MAX_SHOWN} more
- </a>
- </Show>
- </div>
- );
-}
-
-// ─── Findings Needing Attention sub-section ─────────────────────────
-function FindingsAttentionRows(props: { findings: UnifiedFinding[] }) {
- const [actionLoading, setActionLoading] = createSignal<string | null>(null);
-
- const handleReinvestigate = async (finding: UnifiedFinding) => {
- setActionLoading(finding.id);
- try {
- const { reinvestigateFinding } = await import('@/api/patrol');
- await reinvestigateFinding(finding.id);
- await aiIntelligenceStore.loadFindings();
- notificationStore.success('Re-investigation triggered');
- } catch (err) {
- notificationStore.error((err as Error).message || 'Failed to reinvestigate');
- } finally {
- setActionLoading(null);
- }
- };
-
- const handleSnooze = async (finding: UnifiedFinding) => {
- setActionLoading(finding.id);
- try {
- const success = await aiIntelligenceStore.snoozeFinding(finding.id, 24);
- if (success) {
- notificationStore.success('Finding snoozed for 24h');
- } else {
- notificationStore.error('Failed to snooze finding');
- }
- } catch (err) {
- notificationStore.error((err as Error).message || 'Failed to snooze finding');
- } finally {
- setActionLoading(null);
- }
- };
-
- const handleDismiss = async (finding: UnifiedFinding) => {
- setActionLoading(finding.id);
- try {
- const success = await aiIntelligenceStore.dismissFinding(finding.id, 'not_an_issue');
- if (success) {
- notificationStore.success('Finding dismissed');
- } else {
- notificationStore.error('Failed to dismiss finding');
- }
- } catch (err) {
- notificationStore.error((err as Error).message || 'Failed to dismiss finding');
- } finally {
- setActionLoading(null);
- }
- };
-
- return (
- <div class="space-y-1.5">
- <p class="text-[11px] font-semibold uppercase tracking-wide text-muted">
- Findings Needing Attention
- </p>
- <ul class="space-y-1" role="list">
- <For each={props.findings}>
- {(finding) => {
- const compactBadge = getFindingCompactBadgePresentation(finding);
- const title = getFindingTitlePresentation(finding).label;
- const primaryAction = getFindingPrimaryActionPresentation(finding);
- const manualControls = getFindingManualControlsPresentation(finding);
-
- return (
- <li class="flex items-center gap-2 py-1.5 px-2 -mx-2 rounded hover:bg-surface-hover transition-colors">
- <span class={compactBadge.badgeClasses}>{compactBadge.label}</span>
- <p
- class="min-w-0 text-xs font-medium text-base-content truncate flex-1"
- title={title}
- >
- {title}
- </p>
- <Show when={finding.investigationOutcome}>
- {(outcome) => (
- <span
- class={`shrink-0 inline-flex items-center rounded border px-1.5 py-0.5 text-[10px] font-medium ${getInvestigationOutcomeBadgeClasses(outcome())}`}
- >
- {getInvestigationOutcomeLabel(outcome())}
- </span>
- )}
- </Show>
- <div class="shrink-0 flex items-center gap-1">
- <Show
- when={primaryAction}
- fallback={
- <button
- type="button"
- onClick={() => handleReinvestigate(finding)}
- disabled={actionLoading() === finding.id}
- class="flex items-center gap-1 px-2 py-1 text-[10px] font-medium text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900 rounded transition-colors disabled:opacity-50"
- title="Re-investigate this finding"
- >
- <RefreshCwIcon
- class={`w-3 h-3 ${actionLoading() === finding.id ? 'animate-spin' : ''}`}
- />
- Retry
- </button>
- }
- >
- {(action) => (
- <a
- href={action().href}
- class="px-2 py-1 text-[10px] font-medium text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900 rounded transition-colors"
- >
- {action().label}
- </a>
- )}
- </Show>
- <Show when={manualControls.snooze}>
- <button
- type="button"
- onClick={() => handleSnooze(finding)}
- disabled={actionLoading() === finding.id}
- class="px-2 py-1 text-[10px] font-medium text-muted hover:bg-surface-hover rounded transition-colors disabled:opacity-50"
- title="Snooze for 24 hours"
- >
- Snooze
- </button>
- </Show>
- <Show when={manualControls.dismiss}>
- <button
- type="button"
- onClick={() => handleDismiss(finding)}
- disabled={actionLoading() === finding.id}
- class="px-2 py-1 text-[10px] font-medium text-muted hover:bg-surface-hover rounded transition-colors disabled:opacity-50"
- title="Dismiss this finding"
- >
- Dismiss
- </button>
- </Show>
- </div>
- </li>
- );
- }}
- </For>
- </ul>
- <Show when={props.findings.length > 5}>
- <a
- href={AI_PATROL_PATH}
- class="text-[11px] text-blue-600 hover:underline dark:text-blue-400"
- >
- View all findings
- </a>
- </Show>
- </div>
- );
-}
-
-// ─── Main Panel ─────────────────────────────────────────────────────
-export function ActionRequiredPanel(props: ActionRequiredPanelProps) {
- const hasPatrol = () => hasFeature('ai_patrol');
- const hasApprovals = () => props.pendingApprovals.length > 0;
- const hasAlerts = () => props.unackedCriticalAlerts.length > 0;
- const hasFindings = () => hasPatrol() && props.findingsNeedingAttention.length > 0;
- const hasAny = () => hasApprovals() || hasAlerts() || hasFindings();
-
- return (
- <Show when={hasAny()}>
- <Card
- padding="none"
- tone="default"
- class="border-amber-200 dark:border-amber-800 overflow-hidden"
- >
- <div class="bg-amber-50/50 dark:bg-amber-950/30 px-4 py-3 border-b border-amber-100 dark:border-amber-900/50">
- <div class="flex items-center gap-2">
- <div class="flex items-center justify-center w-6 h-6 rounded-full bg-amber-100 dark:bg-amber-900/50">
- <AlertTriangleIcon
- class="w-3.5 h-3.5 text-amber-600 dark:text-amber-400"
- aria-hidden="true"
- />
- </div>
- <h2 class="text-sm font-semibold text-base-content">Action Required</h2>
- <span class="ml-auto text-[10px] font-medium text-amber-700 dark:text-amber-300 bg-amber-100 dark:bg-amber-900/50 px-1.5 py-0.5 rounded-full">
- {(hasApprovals() ? props.pendingApprovals.length : 0) +
- (hasAlerts() ? props.unackedCriticalAlerts.length : 0) +
- (hasFindings() ? props.findingsNeedingAttention.length : 0)}
- </span>
- </div>
- </div>
-
- <div class="px-4 py-3 divide-y divide-border">
- <Show when={hasApprovals()}>
- <div class="py-3 first:pt-0 last:pb-0">
- <PendingApprovalRows approvals={props.pendingApprovals} />
- </div>
- </Show>
-
- <Show when={hasAlerts()}>
- <div class="py-3 first:pt-0 last:pb-0">
- <UnackedAlertRows alerts={props.unackedCriticalAlerts} />
- </div>
- </Show>
-
- <Show when={hasFindings()}>
- <div class="py-3 first:pt-0 last:pb-0">
- <FindingsAttentionRows findings={props.findingsNeedingAttention} />
- </div>
- </Show>
- </div>
- </Card>
- </Show>
- );
-}
-
-export default ActionRequiredPanel;
diff --git a/frontend-modern/src/features/dashboardOverview/DashboardCustomizer.tsx b/frontend-modern/src/features/dashboardOverview/DashboardCustomizer.tsx
deleted file mode 100644
index 72af4c5225..0000000000
--- a/frontend-modern/src/features/dashboardOverview/DashboardCustomizer.tsx
+++ /dev/null
@@ -1,157 +0,0 @@
-import { For, Show, createEffect, createSignal, onCleanup, type Accessor } from 'solid-js';
-import type { DashboardWidgetDef, DashboardWidgetId } from './dashboardWidgets';
-
-type DashboardCustomizerProps = {
- allWidgets: Accessor<DashboardWidgetDef[]>;
- isHidden: (id: DashboardWidgetId) => boolean;
- toggleWidget: (id: DashboardWidgetId) => void;
- moveUp: (id: DashboardWidgetId) => void;
- moveDown: (id: DashboardWidgetId) => void;
- resetToDefaults: () => void;
- isDefault: Accessor<boolean>;
-};
-
-export function DashboardCustomizer(props: DashboardCustomizerProps) {
- const [open, setOpen] = createSignal(false);
- let rootRef: HTMLDivElement | undefined;
-
- const handleOutsideClick = (event: MouseEvent) => {
- if (!rootRef) return;
- if (!rootRef.contains(event.target as Node)) {
- setOpen(false);
- }
- };
-
- createEffect(() => {
- if (open()) {
- document.addEventListener('mousedown', handleOutsideClick);
- } else {
- document.removeEventListener('mousedown', handleOutsideClick);
- }
- });
-
- onCleanup(() => {
- document.removeEventListener('mousedown', handleOutsideClick);
- });
-
- return (
- <div class="relative shrink-0" ref={rootRef}>
- <button
- type="button"
- class={`inline-flex items-center gap-1.5 whitespace-nowrap px-2.5 py-1.5 text-xs font-medium rounded-md transition-all ${
- open()
- ? 'bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300'
- : 'bg-surface-hover text-muted hover:bg-surface-hover'
- }`}
- title="Customize dashboard widgets"
- onClick={() => setOpen(!open())}
- >
- <svg
- class="w-3.5 h-3.5"
- fill="none"
- viewBox="0 0 24 24"
- stroke="currentColor"
- stroke-width="2"
- >
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- d="M11.983 5.25a2.25 2.25 0 100-4.5 2.25 2.25 0 000 4.5zM11.983 23.25a2.25 2.25 0 100-4.5 2.25 2.25 0 000 4.5zM3.862 8.113a2.25 2.25 0 10-3.182-3.182 2.25 2.25 0 003.182 3.182zM23.286 19.355a2.25 2.25 0 10-3.182-3.182 2.25 2.25 0 003.182 3.182zM5.25 11.983a2.25 2.25 0 10-4.5 0 2.25 2.25 0 004.5 0zM23.25 11.983a2.25 2.25 0 10-4.5 0 2.25 2.25 0 004.5 0zM3.862 15.855a2.25 2.25 0 10-3.182 3.182 2.25 2.25 0 003.182-3.182zM23.286 4.611a2.25 2.25 0 10-3.182 3.182 2.25 2.25 0 003.182-3.182z"
- />
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- d="M11.983 6.75v10.5M6.75 11.983h10.5M16.868 7.098l-9.77 9.77M16.868 16.868l-9.77-9.77"
- />
- </svg>
- <span>Customize</span>
- </button>
-
- <Show when={open()}>
- <div class="absolute right-0 mt-1 w-64 rounded-md border border-border bg-surface shadow-sm z-50">
- <div class="px-3 py-2 border-b border-border-subtle">
- <div class="flex items-center justify-between">
- <span class="text-xs font-medium text-base-content">Dashboard Widgets</span>
- <Show when={!props.isDefault()}>
- <button
- type="button"
- class="text-[10px] text-blue-600 dark:text-blue-400 hover:underline"
- onClick={() => props.resetToDefaults()}
- >
- Reset
- </button>
- </Show>
- </div>
- </div>
-
- <div class="max-h-64 overflow-y-auto py-1">
- <For each={props.allWidgets()}>
- {(widget, index) => {
- const visible = () => !props.isHidden(widget.id);
- const isFirst = () => index() === 0;
- const isLast = () => index() === props.allWidgets().length - 1;
-
- return (
- <div class="flex items-center gap-2.5 px-3 py-2 hover:bg-surface-hover transition-colors">
- <label class="flex min-w-0 flex-1 items-center gap-2.5 cursor-pointer">
- <input
- type="checkbox"
- class="w-3.5 h-3.5 rounded border-border text-blue-600 focus:ring-blue-500 focus:ring-offset-0 dark:checked:bg-blue-600"
- checked={visible()}
- onChange={() => props.toggleWidget(widget.id)}
- />
- <span
- class={`truncate text-sm ${visible() ? 'text-base-content' : 'text-muted'}`}
- >
- {widget.label}
- </span>
- </label>
-
- <div class="flex items-center gap-0.5">
- <button
- type="button"
- class="rounded p-1 transition-colors hover:bg-surface-hover hover:text-muted disabled:opacity-30 disabled:cursor-not-allowed"
- title="Move up"
- aria-label={`Move ${widget.label} up`}
- disabled={isFirst()}
- onClick={() => props.moveUp(widget.id)}
- >
- <svg
- class="w-4 h-4"
- fill="none"
- viewBox="0 0 24 24"
- stroke="currentColor"
- stroke-width="2"
- >
- <path stroke-linecap="round" stroke-linejoin="round" d="m18 15-6-6-6 6" />
- </svg>
- </button>
- <button
- type="button"
- class="rounded p-1 transition-colors hover:bg-surface-hover hover:text-muted disabled:opacity-30 disabled:cursor-not-allowed"
- title="Move down"
- aria-label={`Move ${widget.label} down`}
- disabled={isLast()}
- onClick={() => props.moveDown(widget.id)}
- >
- <svg
- class="w-4 h-4"
- fill="none"
- viewBox="0 0 24 24"
- stroke="currentColor"
- stroke-width="2"
- >
- <path stroke-linecap="round" stroke-linejoin="round" d="m6 9 6 6 6-6" />
- </svg>
- </button>
- </div>
- </div>
- );
- }}
- </For>
- </div>
- </div>
- </Show>
- </div>
- );
-}
diff --git a/frontend-modern/src/features/dashboardOverview/EstateSummaryPanel.tsx b/frontend-modern/src/features/dashboardOverview/EstateSummaryPanel.tsx
deleted file mode 100644
index 63ce1e4c44..0000000000
--- a/frontend-modern/src/features/dashboardOverview/EstateSummaryPanel.tsx
+++ /dev/null
@@ -1,279 +0,0 @@
-import { For, Show, type JSX } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { INFRASTRUCTURE_PATH } from '@/routing/resourceLinks';
-import { formatRelativeTime } from '@/utils/format';
-import {
- DASHBOARD_ALERTS_SECTION_ID,
- DASHBOARD_PROBLEM_RESOURCES_SECTION_ID,
-} from './dashboardSectionIds';
-import type {
- DashboardEstateHealthTone,
- DashboardEstateSummary,
- DashboardEstateSurfaceSummary,
-} from './estateSummaryModel';
-import ActivityIcon from 'lucide-solid/icons/activity';
-import ArrowRightIcon from 'lucide-solid/icons/arrow-right';
-import ClockIcon from 'lucide-solid/icons/clock';
-import ServerIcon from 'lucide-solid/icons/server';
-
-interface EstateSummaryPanelProps {
- summary: DashboardEstateSummary;
- resourceIssueCount?: number;
- activeAlertCount?: number;
-}
-
-const toneDotClass: Record<DashboardEstateHealthTone, string> = {
- healthy: 'bg-emerald-500',
- warning: 'bg-amber-500',
- danger: 'bg-red-500',
- muted: 'bg-slate-400',
-};
-
-const toneTextClass: Record<DashboardEstateHealthTone, string> = {
- healthy: 'text-emerald-600 dark:text-emerald-400',
- warning: 'text-amber-600 dark:text-amber-400',
- danger: 'text-red-600 dark:text-red-400',
- muted: 'text-muted',
-};
-
-function formatSurfaceSummary(surfaces: DashboardEstateSurfaceSummary[]): string {
- if (surfaces.length === 0) return 'No source links yet';
- return surfaces
- .slice(0, 4)
- .map((surface) =>
- surface.label === 'Agent' && surface.count !== 1
- ? `${surface.count} agents`
- : `${surface.count} ${surface.label}`,
- )
- .join(' Β· ');
-}
-
-const pluralize = (count: number, singular: string, plural = `${singular}s`): string =>
- `${count} ${count === 1 ? singular : plural}`;
-
-const reviewText = (count: number): string =>
- `${pluralize(count, 'system')} ${count === 1 ? 'needs' : 'need'} review`;
-
-const sectionLinkClass =
- 'font-medium text-blue-600 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/50 dark:text-blue-400';
-
-function normalizedIssueCounts(props: EstateSummaryPanelProps): {
- resourceIssueCount: number;
- activeAlertCount: number;
-} {
- return {
- resourceIssueCount: Math.max(0, Math.trunc(props.resourceIssueCount ?? 0)),
- activeAlertCount: Math.max(0, Math.trunc(props.activeAlertCount ?? 0)),
- };
-}
-
-function focusDashboardSection(event: MouseEvent & { currentTarget: HTMLAnchorElement }) {
- const targetId = event.currentTarget.hash.slice(1);
- if (!targetId) return;
-
- const target = document.getElementById(targetId);
- if (!target) return;
-
- event.preventDefault();
- if (window.location.hash !== `#${targetId}`) {
- window.history.pushState(null, '', `#${targetId}`);
- }
- target.scrollIntoView({ block: 'start', behavior: 'smooth' });
- target.focus({ preventScroll: true });
-}
-
-function DashboardSectionLink(props: { href: string; children: JSX.Element }) {
- return (
- <a href={props.href} onClick={focusDashboardSection} class={sectionLinkClass}>
- {props.children}
- </a>
- );
-}
-
-function DashboardIssueLinks(props: EstateSummaryPanelProps) {
- const { resourceIssueCount, activeAlertCount } = normalizedIssueCounts(props);
-
- if (resourceIssueCount > 0 && activeAlertCount > 0) {
- return (
- <>
- <DashboardSectionLink href={`#${DASHBOARD_PROBLEM_RESOURCES_SECTION_ID}`}>
- {pluralize(resourceIssueCount, 'resource issue')}
- </DashboardSectionLink>
- <span> and </span>
- <DashboardSectionLink href={`#${DASHBOARD_ALERTS_SECTION_ID}`}>
- {pluralize(activeAlertCount, 'alert')}
- </DashboardSectionLink>
- <span> below</span>
- </>
- );
- }
- if (resourceIssueCount > 0) {
- return (
- <>
- <DashboardSectionLink href={`#${DASHBOARD_PROBLEM_RESOURCES_SECTION_ID}`}>
- {pluralize(resourceIssueCount, 'resource issue')}
- </DashboardSectionLink>
- <span> below</span>
- </>
- );
- }
- if (activeAlertCount > 0) {
- return (
- <>
- <DashboardSectionLink href={`#${DASHBOARD_ALERTS_SECTION_ID}`}>
- {pluralize(activeAlertCount, 'alert')}
- </DashboardSectionLink>
- <span> below</span>
- </>
- );
- }
- return null;
-}
-
-function hasDashboardIssueLinks(props: EstateSummaryPanelProps): boolean {
- const { resourceIssueCount, activeAlertCount } = normalizedIssueCounts(props);
- return resourceIssueCount > 0 || activeAlertCount > 0;
-}
-
-function dashboardIssueSubtext(props: EstateSummaryPanelProps): string | null {
- const resourceIssueCount = Math.max(0, Math.trunc(props.resourceIssueCount ?? 0));
- const activeAlertCount = Math.max(0, Math.trunc(props.activeAlertCount ?? 0));
-
- if (resourceIssueCount > 0 && activeAlertCount > 0) {
- return 'Resource issues and alerts listed below';
- }
- if (resourceIssueCount > 0) return 'Resource issues listed below';
- if (activeAlertCount > 0) return 'Alerts listed below';
- return null;
-}
-
-function latestSignalSubtext(props: EstateSummaryPanelProps): string {
- const issueSubtext = dashboardIssueSubtext(props);
-
- if (props.summary.attentionSystems > 0) {
- if (issueSubtext) return `${reviewText(props.summary.attentionSystems)}; details below`;
- return reviewText(props.summary.attentionSystems);
- }
- if (issueSubtext) return issueSubtext;
- if (!props.summary.hasCanonicalProjection) return 'System map syncing';
- return 'No infrastructure or alert issues found';
-}
-
-export function EstateSummaryPanel(props: EstateSummaryPanelProps) {
- const latestSeenLabel = () =>
- props.summary.latestSeen
- ? formatRelativeTime(props.summary.latestSeen, { compact: true })
- : !props.summary.hasCanonicalProjection && props.summary.totalSystems > 0
- ? 'Syncing'
- : 'Waiting for signal';
-
- return (
- <Card
- padding="none"
- tone="default"
- class="overflow-hidden"
- data-testid="dashboard-estate-summary"
- >
- <div class="flex flex-col gap-3 border-b border-border px-4 py-3 sm:flex-row sm:items-center sm:justify-between">
- <div class="flex min-w-0 items-center gap-3">
- <div class="flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-blue-50 text-blue-600 dark:bg-blue-900/40 dark:text-blue-300">
- <ServerIcon class="h-4 w-4" aria-hidden="true" />
- </div>
- <div class="min-w-0">
- <div class="flex items-center gap-2">
- <h2 class="text-sm font-semibold text-base-content">Connected infrastructure</h2>
- <span class={`h-2 w-2 rounded-full ${toneDotClass[props.summary.tone]}`} />
- </div>
- <p class="mt-0.5 text-xs text-muted">
- <span class={`font-medium ${toneTextClass[props.summary.tone]}`}>
- {props.summary.headline}
- </span>
- <span> Β· {props.summary.detail}</span>
- <Show when={hasDashboardIssueLinks(props)}>
- <span> Β· </span>
- <DashboardIssueLinks {...props} />
- </Show>
- </p>
- </div>
- </div>
- <a
- href={INFRASTRUCTURE_PATH}
- class="inline-flex shrink-0 items-center gap-1.5 self-start rounded-md border border-border px-2.5 py-1.5 text-xs font-medium text-base-content hover:bg-surface-hover sm:self-auto"
- >
- View infrastructure
- <ArrowRightIcon class="h-3.5 w-3.5" aria-hidden="true" />
- </a>
- </div>
-
- <div class="grid grid-cols-1 gap-3 px-4 py-3 sm:grid-cols-3">
- <div>
- <p class="text-[11px] font-medium uppercase tracking-wide text-muted">Systems</p>
- <p class="mt-1 text-xl font-mono font-semibold text-base-content">
- {props.summary.totalSystems}
- </p>
- <p class="mt-0.5 text-xs text-muted">
- {props.summary.hasCanonicalProjection
- ? `${props.summary.activeSystems} active`
- : 'System map syncing'}
- </p>
- </div>
-
- <div>
- <p class="text-[11px] font-medium uppercase tracking-wide text-muted">Source coverage</p>
- <p class="mt-1 break-words text-sm font-medium leading-snug text-base-content">
- {props.summary.hasCanonicalProjection
- ? formatSurfaceSummary(props.summary.surfaces)
- : 'Coverage syncing'}
- </p>
- <p class="mt-0.5 text-xs text-muted">
- {props.summary.hasCanonicalProjection
- ? props.summary.surfaces.length > 0
- ? 'Grouped by monitored system'
- : 'Add source coverage from Infrastructure'
- : 'Awaiting connected-infrastructure map'}
- </p>
- </div>
-
- <div>
- <p class="text-[11px] font-medium uppercase tracking-wide text-muted">Latest signal</p>
- <p class="mt-1 inline-flex items-center gap-1.5 text-sm font-medium text-base-content">
- <ClockIcon class="h-3.5 w-3.5 text-muted" aria-hidden="true" />
- {latestSeenLabel()}
- </p>
- <p class="mt-0.5 text-xs text-muted">{latestSignalSubtext(props)}</p>
- </div>
- </div>
-
- <Show when={props.summary.systems.length > 0}>
- <div class="border-t border-border px-4 py-2.5">
- <div class="flex flex-wrap items-center gap-2">
- <For each={props.summary.systems.slice(0, 5)}>
- {(system) => (
- <a
- href={INFRASTRUCTURE_PATH}
- class="inline-flex max-w-full items-center gap-1.5 rounded border border-border-subtle bg-base px-2 py-1 text-xs text-base-content hover:bg-surface-hover"
- title={`${system.name} Β· ${system.statusLabel}`}
- >
- <span class={`h-1.5 w-1.5 shrink-0 rounded-full ${toneDotClass[system.tone]}`} />
- <span class="max-w-[12rem] truncate font-medium">{system.name}</span>
- <span class="text-muted">{system.statusLabel}</span>
- </a>
- )}
- </For>
- <Show when={props.summary.systems.length > 5}>
- <a
- href={INFRASTRUCTURE_PATH}
- class="inline-flex items-center gap-1 text-xs font-medium text-blue-600 hover:underline dark:text-blue-400"
- >
- +{props.summary.systems.length - 5} more
- <ActivityIcon class="h-3 w-3" aria-hidden="true" />
- </a>
- </Show>
- </div>
- </div>
- </Show>
- </Card>
- );
-}
-
-export default EstateSummaryPanel;
diff --git a/frontend-modern/src/features/dashboardOverview/KPIStrip.tsx b/frontend-modern/src/features/dashboardOverview/KPIStrip.tsx
deleted file mode 100644
index 5c86bdc1c0..0000000000
--- a/frontend-modern/src/features/dashboardOverview/KPIStrip.tsx
+++ /dev/null
@@ -1,197 +0,0 @@
-import { Show } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import {
- ALERTS_OVERVIEW_PATH,
- INFRASTRUCTURE_PATH,
- WORKLOADS_PATH,
- buildStoragePath,
-} from '@/routing/resourceLinks';
-import { getDashboardAlertTone } from '@/utils/alertOverviewPresentation';
-import { getDashboardKpiPresentation } from '@/utils/dashboardKpiPresentation';
-import { getAlertSeverityTextClass } from '@/utils/alertSeverityPresentation';
-import { formatBytes } from '@/utils/format';
-
-export type KPIStripCardId = 'infrastructure' | 'workloads' | 'storage' | 'alerts';
-
-interface KPIStripProps {
- infrastructure: {
- total: number;
- online: number;
- attention?: number;
- };
- workloads: {
- total: number;
- running: number;
- stopped?: number;
- };
- storage: {
- capacityPercent: number;
- totalUsed: number;
- totalCapacity: number;
- };
- alerts: {
- activeCritical: number;
- activeWarning: number;
- total: number;
- };
- // Cards to hide. Use when another panel on the same page already carries the
- // same datum (e.g. Pulse Brief + Estate cover Infrastructure + Alerts counts).
- exclude?: KPIStripCardId[];
-}
-
-export function KPIStrip(props: KPIStripProps) {
- const infrastructurePresentation = getDashboardKpiPresentation('infrastructure');
- const workloadsPresentation = getDashboardKpiPresentation('workloads');
- const storagePresentation = getDashboardKpiPresentation('storage');
- const alertsPresentation = getDashboardKpiPresentation('alerts');
- const InfrastructureIcon = infrastructurePresentation.icon;
- const WorkloadsIcon = workloadsPresentation.icon;
- const StorageIcon = storagePresentation.icon;
- const AlertsIcon = alertsPresentation.icon;
-
- const isVisible = (id: KPIStripCardId) => !props.exclude?.includes(id);
- const visibleCount = () =>
- (['infrastructure', 'workloads', 'storage', 'alerts'] as const).filter(isVisible).length;
- const gridCols = () => {
- const count = visibleCount();
- if (count <= 1) return 'grid-cols-1';
- if (count === 2) return 'grid-cols-2';
- if (count === 3) return 'grid-cols-1 sm:grid-cols-3';
- return 'grid-cols-2 lg:grid-cols-4';
- };
-
- return (
- <div class={`grid gap-3 ${gridCols()}`}>
- <Show when={isVisible('infrastructure')}>
- <a
- href={INFRASTRUCTURE_PATH}
- class="group block"
- data-testid="dashboard-kpi-infrastructure"
- >
- <Card hoverable padding="none" class={infrastructurePresentation.cardClassName}>
- <div class="px-3.5 py-3">
- <div class="flex items-center justify-between">
- <p class="text-[11px] font-medium text-muted uppercase tracking-wide">
- {infrastructurePresentation.label}
- </p>
- <InfrastructureIcon
- class={infrastructurePresentation.iconClassName}
- aria-hidden="true"
- />
- </div>
- <p class="text-2xl font-mono font-semibold text-base-content mt-1">
- {props.infrastructure.total}
- </p>
- <p class="text-xs text-muted mt-0.5">
- <span class="font-mono font-medium text-emerald-600 dark:text-emerald-400">
- {props.infrastructure.online}
- </span>{' '}
- online
- {props.infrastructure.attention !== undefined &&
- props.infrastructure.attention > 0 ? (
- <>
- {' Β· '}
- <span class="font-mono font-medium text-amber-600 dark:text-amber-400">
- {props.infrastructure.attention}
- </span>{' '}
- attention
- </>
- ) : null}
- </p>
- </div>
- </Card>
- </a>
- </Show>
-
- <Show when={isVisible('workloads')}>
- <a href={WORKLOADS_PATH} class="group block" data-testid="dashboard-kpi-workloads">
- <Card hoverable padding="none" class={workloadsPresentation.cardClassName}>
- <div class="px-3.5 py-3">
- <div class="flex items-center justify-between">
- <p class="text-[11px] font-medium text-muted uppercase tracking-wide">
- {workloadsPresentation.label}
- </p>
- <WorkloadsIcon class={workloadsPresentation.iconClassName} aria-hidden="true" />
- </div>
- <p class="text-2xl font-mono font-semibold text-base-content mt-1">
- {props.workloads.total}
- </p>
- <p class="text-[11px] text-muted mt-0.5">{workloadsPresentation.supportingText}</p>
- <p class="text-xs text-muted mt-0.5">
- <span class="font-mono font-medium text-emerald-600 dark:text-emerald-400">
- {props.workloads.running}
- </span>{' '}
- running
- {props.workloads.stopped !== undefined && props.workloads.stopped > 0 ? (
- <>
- {' Β· '}
- <span class="font-mono font-medium text-base-content">
- {props.workloads.stopped}
- </span>{' '}
- stopped
- </>
- ) : null}
- </p>
- </div>
- </Card>
- </a>
- </Show>
-
- <Show when={isVisible('storage')}>
- <a href={buildStoragePath()} class="group block" data-testid="dashboard-kpi-storage">
- <Card hoverable padding="none" class={storagePresentation.cardClassName}>
- <div class="px-3.5 py-3">
- <div class="flex items-center justify-between">
- <p class="text-[11px] font-medium text-muted uppercase tracking-wide">
- {storagePresentation.label}
- </p>
- <StorageIcon class={storagePresentation.iconClassName} aria-hidden="true" />
- </div>
- <p class="text-2xl font-mono font-semibold text-base-content mt-1">
- {Math.round(props.storage.capacityPercent)}%
- </p>
- <p class="text-xs text-muted mt-0.5">
- {formatBytes(props.storage.totalUsed)} / {formatBytes(props.storage.totalCapacity)}
- </p>
- </div>
- </Card>
- </a>
- </Show>
-
- <Show when={isVisible('alerts')}>
- <a href={ALERTS_OVERVIEW_PATH} class="group block" data-testid="dashboard-kpi-alerts">
- <Card
- hoverable
- tone={getDashboardAlertTone(props.alerts)}
- padding="none"
- class={alertsPresentation.cardClassName}
- >
- <div class="px-3.5 py-3">
- <div class="flex items-center justify-between">
- <p class="text-[11px] font-medium text-muted uppercase tracking-wide">
- {alertsPresentation.label}
- </p>
- <AlertsIcon class={alertsPresentation.iconClassName} aria-hidden="true" />
- </div>
- <p class="text-2xl font-mono font-semibold text-base-content mt-1">
- {props.alerts.total}
- </p>
- <p class="text-xs text-muted mt-0.5">
- <span class={`font-mono font-medium ${getAlertSeverityTextClass('critical')}`}>
- {props.alerts.activeCritical}
- </span>{' '}
- critical Β·{' '}
- <span class={`font-mono font-medium ${getAlertSeverityTextClass('warning')}`}>
- {props.alerts.activeWarning}
- </span>{' '}
- warning
- </p>
- </div>
- </Card>
- </a>
- </Show>
- </div>
- );
-}
-
-export default KPIStrip;
diff --git a/frontend-modern/src/features/dashboardOverview/ProblemResourcesTable.tsx b/frontend-modern/src/features/dashboardOverview/ProblemResourcesTable.tsx
deleted file mode 100644
index 58ef3652ad..0000000000
--- a/frontend-modern/src/features/dashboardOverview/ProblemResourcesTable.tsx
+++ /dev/null
@@ -1,250 +0,0 @@
-import { createMemo, For, Show } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { StatusDot } from '@/components/shared/StatusDot';
-import {
- Table,
- TableHeader,
- TableBody,
- TableRow,
- TableHead,
- TableCell,
-} from '@/components/shared/Table';
-import type { ProblemResource } from '@/hooks/useDashboardOverview';
-import { isInfrastructure, isStorage } from '@/types/resource';
-import {
- INFRASTRUCTURE_PATH,
- buildInfrastructureResourceHref,
- buildWorkloadsPath,
- buildStoragePath,
-} from '@/routing/resourceLinks';
-import { getResourceTypeLabel } from '@/utils/resourceTypePresentation';
-import { getTypeColumnLabel } from '@/utils/typeColumnPresentation';
-import { getSimpleStatusIndicator, getStatusIndicatorBadgeToneClasses } from '@/utils/status';
-import {
- getProblemResourceIssueLabel,
- getProblemResourceMemberLabel,
- getProblemResourceStatusVariant,
-} from '@/utils/problemResourcePresentation';
-import AlertTriangleIcon from 'lucide-solid/icons/alert-triangle';
-
-interface ProblemResourcesTableProps {
- problems: ProblemResource[];
-}
-
-interface ProblemResourceGroup {
- representative: ProblemResource;
- resources: ProblemResource[];
- displayName: string;
- typeLabel: string;
- worstValue: number;
- memberDisplayNames: string[];
-}
-
-function resourceLink(pr: ProblemResource): string {
- if (isInfrastructure(pr.resource)) {
- return buildInfrastructureResourceHref(pr.resource.id) ?? INFRASTRUCTURE_PATH;
- }
- if (isStorage(pr.resource)) {
- return buildStoragePath();
- }
- return buildWorkloadsPath({ resource: pr.resource.id });
-}
-
-function normalizeGroupValue(value: string): string {
- return value.trim().toLowerCase();
-}
-
-function problemResourceDisplayName(pr: ProblemResource): string {
- return getProblemResourceIssueLabel(pr.resource, pr.problems);
-}
-
-function problemResourceMemberDisplayName(pr: ProblemResource): string | null {
- return getProblemResourceMemberLabel(pr.resource, pr.problems);
-}
-
-function problemGroupKey(pr: ProblemResource): string {
- const displayName = problemResourceDisplayName(pr);
- const problems = pr.problems.map(normalizeGroupValue).sort().join('|');
- return [normalizeGroupValue(displayName), pr.resource.type, problems].join('::');
-}
-
-function problemResourceGroups(problems: ProblemResource[]): ProblemResourceGroup[] {
- const groups = new Map<string, ProblemResourceGroup>();
-
- for (const problem of problems) {
- const key = problemGroupKey(problem);
- const existing = groups.get(key);
- if (existing) {
- existing.resources.push(problem);
- existing.worstValue = Math.max(existing.worstValue, problem.worstValue);
- const memberName = problemResourceMemberDisplayName(problem);
- if (memberName && !existing.memberDisplayNames.includes(memberName)) {
- existing.memberDisplayNames.push(memberName);
- }
- continue;
- }
-
- const displayName = problemResourceDisplayName(problem);
- const memberName = problemResourceMemberDisplayName(problem);
- groups.set(key, {
- representative: problem,
- resources: [problem],
- displayName,
- typeLabel: getResourceTypeLabel(problem.resource.type) || problem.resource.type,
- worstValue: problem.worstValue,
- memberDisplayNames: memberName ? [memberName] : [],
- });
- }
-
- return Array.from(groups.values());
-}
-
-function groupedResourceLink(group: ProblemResourceGroup): string {
- if (group.resources.length === 1) {
- return resourceLink(group.representative);
- }
- if (group.resources.every((problem) => isStorage(problem.resource))) {
- return buildStoragePath();
- }
- if (group.resources.every((problem) => isInfrastructure(problem.resource))) {
- return INFRASTRUCTURE_PATH;
- }
- return buildWorkloadsPath({ type: group.representative.resource.type });
-}
-
-function pluralizeTypeLabel(count: number, label: string): string {
- const normalized = (label || 'resource').trim().toLowerCase();
- if (count === 1) return normalized;
- if (normalized === 'storage') return 'storage resources';
- if (normalized.endsWith('s')) return normalized;
- if (normalized.endsWith('y')) return `${normalized.slice(0, -1)}ies`;
- return `${normalized}s`;
-}
-
-export function ProblemResourcesTable(props: ProblemResourcesTableProps) {
- const groupedProblems = createMemo(() => problemResourceGroups(props.problems));
-
- return (
- <Show when={props.problems.length > 0}>
- <Card padding="none" tone="default" class="overflow-hidden">
- <div class="px-4 py-3 flex items-center gap-2 bg-red-50/40 dark:bg-red-950/20 border-b border-red-100 dark:border-red-900/30">
- <div class="flex items-center justify-center w-6 h-6 rounded-full bg-red-100 dark:bg-red-900/50">
- <AlertTriangleIcon
- class="w-3.5 h-3.5 text-red-600 dark:text-red-400"
- aria-hidden="true"
- />
- </div>
- <h2 class="text-sm font-semibold text-base-content">Problem Resources</h2>
- <span class="ml-auto text-[10px] font-medium text-red-700 dark:text-red-300 bg-red-100 dark:bg-red-900/50 px-1.5 py-0.5 rounded-full">
- {props.problems.length}
- </span>
- </div>
-
- <Table>
- <TableHeader>
- <TableRow>
- <TableHead class="w-8" />
- <TableHead>Resource</TableHead>
- <TableHead class="hidden sm:table-cell">{getTypeColumnLabel()}</TableHead>
- <TableHead>Problem</TableHead>
- </TableRow>
- </TableHeader>
- <TableBody>
- <For each={groupedProblems()}>
- {(group) => (
- <TableRow>
- <TableCell>
- <StatusDot
- variant={getProblemResourceStatusVariant(group.worstValue)}
- size="sm"
- pulse={group.worstValue >= 200}
- />
- </TableCell>
- <TableCell>
- <Show
- when={group.resources.length > 1}
- fallback={
- <a
- href={groupedResourceLink(group)}
- class="text-xs font-medium text-base-content hover:underline truncate block max-w-[200px]"
- title={group.displayName}
- >
- {group.displayName}
- </a>
- }
- >
- <a
- href={groupedResourceLink(group)}
- class="text-xs font-medium text-base-content hover:underline truncate block max-w-[200px]"
- title={
- group.memberDisplayNames.length > 0
- ? group.memberDisplayNames.join(', ')
- : `${group.resources.length} ${pluralizeTypeLabel(group.resources.length, group.typeLabel)}`
- }
- >
- {group.resources.length}{' '}
- {pluralizeTypeLabel(group.resources.length, group.typeLabel)}
- </a>
- <Show when={group.memberDisplayNames.length > 0}>
- <span
- class="mt-0.5 block text-[10px] text-muted truncate max-w-[220px]"
- title={group.memberDisplayNames.join(', ')}
- >
- {group.memberDisplayNames.join(', ')}
- </span>
- </Show>
- </Show>
- </TableCell>
- <TableCell class="hidden sm:table-cell">
- <span class="text-xs text-muted">{group.typeLabel}</span>
- </TableCell>
- <TableCell>
- <div class="flex items-center gap-1.5 flex-wrap">
- <For each={group.representative.problems}>
- {(problem) => {
- const indicator = getSimpleStatusIndicator(problem);
- return (
- <span
- class={`inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium ${getStatusIndicatorBadgeToneClasses(indicator.variant)}`}
- >
- {indicator.label}
- </span>
- );
- }}
- </For>
- </div>
- </TableCell>
- </TableRow>
- )}
- </For>
- </TableBody>
- </Table>
-
- <Show when={props.problems.length >= 8}>
- <div class="px-4 py-2 border-t border-border flex items-center gap-3">
- <a
- href={INFRASTRUCTURE_PATH}
- class="text-[11px] text-blue-600 hover:underline dark:text-blue-400"
- >
- Infrastructure
- </a>
- <a
- href={buildWorkloadsPath()}
- class="text-[11px] text-blue-600 hover:underline dark:text-blue-400"
- >
- Workloads
- </a>
- <a
- href={buildStoragePath()}
- class="text-[11px] text-blue-600 hover:underline dark:text-blue-400"
- >
- Storage
- </a>
- </div>
- </Show>
- </Card>
- </Show>
- );
-}
-
-export default ProblemResourcesTable;
diff --git a/frontend-modern/src/features/dashboardOverview/PulseBriefPanel.tsx b/frontend-modern/src/features/dashboardOverview/PulseBriefPanel.tsx
deleted file mode 100644
index b582b18445..0000000000
--- a/frontend-modern/src/features/dashboardOverview/PulseBriefPanel.tsx
+++ /dev/null
@@ -1,102 +0,0 @@
-import { For } from 'solid-js';
-import { PulsePatrolLogo } from '@/components/Brand/PulsePatrolLogo';
-import { Card } from '@/components/shared/Card';
-import { AI_PATROL_PATH } from '@/routing/resourceLinks';
-import type { DashboardPulseBrief, DashboardPulseBriefTone } from './dashboardPulseBriefModel';
-import ArrowRightIcon from 'lucide-solid/icons/arrow-right';
-import MessageCircleIcon from 'lucide-solid/icons/message-circle';
-
-interface PulseBriefPanelProps {
- brief: DashboardPulseBrief;
- onAskAssistant: () => void;
- /**
- * When true, the panel stacks its content, actions, and evidence vertically
- * instead of flowing the actions to the right of the narrative. Use when
- * placing the Brief in a narrow column alongside another header card.
- */
- compact?: boolean;
- class?: string;
-}
-
-const toneClass: Record<DashboardPulseBriefTone, string> = {
- healthy: 'border-l-emerald-500',
- attention: 'border-l-amber-500',
- critical: 'border-l-red-500',
-};
-
-const badgeClass: Record<DashboardPulseBriefTone, string> = {
- healthy: 'bg-emerald-50 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300',
- attention: 'bg-amber-50 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300',
- critical: 'bg-red-50 text-red-700 dark:bg-red-900/40 dark:text-red-300',
-};
-
-export function PulseBriefPanel(props: PulseBriefPanelProps) {
- return (
- <Card
- padding="none"
- class={`overflow-hidden border-l-[3px] ${toneClass[props.brief.tone]} ${props.class ?? ''}`.trim()}
- data-testid="dashboard-pulse-brief"
- >
- <div
- class={`flex h-full flex-col gap-3 px-4 py-3 ${
- props.compact ? '' : 'lg:flex-row lg:items-start lg:justify-between'
- }`}
- >
- <div class="min-w-0 flex-1">
- <div class="flex flex-wrap items-center gap-2">
- <span class="inline-flex h-7 w-7 items-center justify-center rounded-md bg-cyan-50 text-cyan-700 dark:bg-cyan-900/40 dark:text-cyan-300">
- <PulsePatrolLogo class="h-4 w-4" title="Pulse Brief" />
- </span>
- <div class="min-w-0">
- <h2 class="text-sm font-semibold text-base-content">Pulse Brief</h2>
- <p class="text-[11px] font-medium uppercase tracking-wide text-muted">
- Patrol + Assistant
- </p>
- </div>
- <span
- class={`rounded px-2 py-0.5 text-[11px] font-medium ${badgeClass[props.brief.tone]}`}
- >
- {props.brief.title}
- </span>
- </div>
-
- <p class={`mt-2 text-sm leading-6 text-base-content ${props.compact ? '' : 'max-w-5xl'}`}>
- {props.brief.body}
- </p>
-
- <div class="mt-2 flex flex-wrap gap-1.5">
- <For each={props.brief.evidence}>
- {(item) => (
- <span class="rounded border border-border-subtle bg-base px-2 py-0.5 text-[11px] text-muted">
- {item}
- </span>
- )}
- </For>
- </div>
- </div>
-
- <div
- class={`flex shrink-0 flex-wrap items-center gap-2 ${
- props.compact ? '' : 'lg:justify-end'
- }`}
- >
- <button
- type="button"
- onClick={() => props.onAskAssistant()}
- class="inline-flex items-center gap-1.5 rounded-md bg-blue-600 px-2.5 py-1.5 text-xs font-medium text-white hover:bg-blue-700"
- >
- <MessageCircleIcon class="h-3.5 w-3.5" aria-hidden="true" />
- Ask Assistant
- </button>
- <a
- href={AI_PATROL_PATH}
- class="inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5 text-xs font-medium text-base-content hover:bg-surface-hover"
- >
- Open Patrol
- <ArrowRightIcon class="h-3.5 w-3.5" aria-hidden="true" />
- </a>
- </div>
- </div>
- </Card>
- );
-}
diff --git a/frontend-modern/src/features/dashboardOverview/TrendCharts.tsx b/frontend-modern/src/features/dashboardOverview/TrendCharts.tsx
deleted file mode 100644
index 26816aeb81..0000000000
--- a/frontend-modern/src/features/dashboardOverview/TrendCharts.tsx
+++ /dev/null
@@ -1,178 +0,0 @@
-import { For, Show, createMemo } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import {
- InteractiveSparkline,
- type InteractiveSparklineSeries,
-} from '@/components/shared/InteractiveSparkline';
-import {
- SUMMARY_TIME_RANGES,
- SUMMARY_TIME_RANGE_LABEL,
- isSummaryTimeRange,
- type SummaryTimeRange,
-} from '@/components/shared/summaryTimeRange';
-import type { HistoryTimeRange, MetricPoint } from '@/api/charts';
-import {
- getDashboardTrendColor,
- getDashboardTrendErrorState,
-} from '@/utils/dashboardTrendPresentation';
-import { segmentedButtonClass } from '@/utils/segmentedButton';
-import TrendingUpIcon from 'lucide-solid/icons/trending-up';
-
-interface TrendChartsProps {
- trends: import('@/hooks/useDashboardTrends').DashboardTrends;
- overview: import('@/hooks/useDashboardOverview').DashboardOverview;
- trendRange: import('solid-js').Accessor<HistoryTimeRange>;
- setTrendRange: (range: HistoryTimeRange) => void;
-}
-
-function normalizeRange(range: HistoryTimeRange): SummaryTimeRange {
- if (isSummaryTimeRange(range)) return range;
- switch (range) {
- case '6h':
- return '12h';
- case '30d':
- case '90d':
- return '7d';
- default:
- return '24h';
- }
-}
-
-export function TrendCharts(props: TrendChartsProps) {
- const selectedRange = createMemo(() => normalizeRange(props.trendRange()));
- const emptyStateTitle = createMemo(() =>
- props.overview.infrastructure.total > 0 ? 'History is warming up' : 'No infrastructure trends yet',
- );
- const emptyStateBody = createMemo(() =>
- props.overview.infrastructure.total > 0
- ? 'Pulse needs a couple of CPU and memory samples from connected infrastructure before these charts render.'
- : 'These charts appear after connected systems start reporting infrastructure CPU and memory history.',
- );
-
- const cpuSeries = createMemo<InteractiveSparklineSeries[]>(() => {
- const resources = props.overview.infrastructure.topCPU.slice(0, 5);
- const series: InteractiveSparklineSeries[] = [];
-
- for (let i = 0; i < resources.length; i++) {
- const resource = resources[i];
- const trend = props.trends.infrastructure.cpu.get(resource.id);
- if (!trend) continue;
-
- const data = trend.points.map(
- (point): MetricPoint => ({ timestamp: point.timestamp, value: point.value }),
- );
-
- series.push({
- id: resource.id,
- data,
- color: getDashboardTrendColor(i),
- name: resource.name,
- });
- }
-
- return series;
- });
-
- const memorySeries = createMemo<InteractiveSparklineSeries[]>(() => {
- const resources = props.overview.infrastructure.topMemory.slice(0, 5);
- const series: InteractiveSparklineSeries[] = [];
-
- for (let i = 0; i < resources.length; i++) {
- const resource = resources[i];
- const trend = props.trends.infrastructure.memory.get(resource.id);
- if (!trend) continue;
-
- const data = trend.points.map(
- (point): MetricPoint => ({ timestamp: point.timestamp, value: point.value }),
- );
-
- series.push({
- id: resource.id,
- data,
- color: getDashboardTrendColor(i),
- name: resource.name,
- });
- }
-
- return series;
- });
-
- const rangeLabel = createMemo(() => SUMMARY_TIME_RANGE_LABEL[selectedRange()]);
-
- return (
- <div>
- <div class="flex items-center justify-between mb-2">
- <div class="flex items-center gap-1.5">
- <TrendingUpIcon class="w-4 h-4 text-muted" aria-hidden="true" />
- <p class="text-xs font-semibold text-muted uppercase tracking-wide">Trends</p>
- </div>
- <div class="flex items-center gap-1.5">
- <For each={SUMMARY_TIME_RANGES}>
- {(range) => {
- const active = () => selectedRange() === range;
- const className = () =>
- `px-2 py-0.5 text-[11px] ${segmentedButtonClass(active(), false, 'accent')}`;
-
- return (
- <button
- type="button"
- class={className()}
- onClick={() => props.setTrendRange(range)}
- >
- {SUMMARY_TIME_RANGE_LABEL[range]}
- </button>
- );
- }}
- </For>
- </div>
- </div>
-
- <Show when={props.trends.error}>
- <div class="mb-2 rounded border border-amber-200 bg-amber-50 px-2 py-1.5 text-[11px] text-amber-800 dark:border-amber-700 dark:bg-amber-900/50 dark:text-amber-200">
- {getDashboardTrendErrorState().text}
- </div>
- </Show>
- <Show when={!props.trends.error && props.trends.infrastructure.emptyMessage}>
- <div class="mb-2 rounded border border-border bg-surface px-3 py-2 text-[11px] text-muted">
- <p class="font-medium text-base-content">{emptyStateTitle()}</p>
- <p class="mt-1">{emptyStateBody()}</p>
- <p class="mt-1 text-[10px] uppercase tracking-wide text-muted/80">
- {props.trends.infrastructure.emptyMessage}
- </p>
- </div>
- </Show>
-
- <div class="grid grid-cols-1 lg:grid-cols-2 gap-3">
- <Card padding="none" tone="default" class="px-4 py-3 border-border-subtle">
- <p class="text-[11px] font-medium text-muted uppercase tracking-wide">CPU</p>
- <div class="h-[240px] mt-1">
- <InteractiveSparkline
- series={cpuSeries()}
- yMode="percent"
- highlightNearestSeriesOnHover
- timeRange={selectedRange()}
- rangeLabel={rangeLabel()}
- size="lg"
- />
- </div>
- </Card>
-
- <Card padding="none" tone="default" class="px-4 py-3 border-border-subtle">
- <p class="text-[11px] font-medium text-muted uppercase tracking-wide">Memory</p>
- <div class="h-[240px] mt-1">
- <InteractiveSparkline
- series={memorySeries()}
- yMode="percent"
- highlightNearestSeriesOnHover
- timeRange={selectedRange()}
- rangeLabel={rangeLabel()}
- size="lg"
- />
- </div>
- </Card>
- </div>
- </div>
- );
-}
-
-export default TrendCharts;
diff --git a/frontend-modern/src/features/dashboardOverview/__tests__/ActionRequiredPanel.test.tsx b/frontend-modern/src/features/dashboardOverview/__tests__/ActionRequiredPanel.test.tsx
deleted file mode 100644
index 4f2d0553e2..0000000000
--- a/frontend-modern/src/features/dashboardOverview/__tests__/ActionRequiredPanel.test.tsx
+++ /dev/null
@@ -1,101 +0,0 @@
-import { readFileSync } from 'node:fs';
-import { resolve } from 'node:path';
-import { describe, expect, it } from 'vitest';
-import {
- getFindingCompactBadgePresentation,
- getFindingManualControlsPresentation,
- getFindingPrimaryActionPresentation,
- getFindingTitlePresentation,
-} from '@/utils/aiFindingPresentation';
-
-const actionRequiredPanelSource = readFileSync(
- resolve(__dirname, '..', 'ActionRequiredPanel.tsx'),
- 'utf-8',
-);
-
-describe('ActionRequiredPanel', () => {
- it('uses runtime-qualified compact badges for Patrol runtime findings', () => {
- expect(
- getFindingCompactBadgePresentation({
- severity: 'warning',
- resourceId: 'ai-service',
- resourceName: 'Pulse Patrol Service',
- title: 'Pulse Patrol: Provider billing or quota issue',
- }),
- ).toEqual({
- label: 'Runtime issue',
- badgeClasses:
- 'border-sky-200 bg-sky-50 text-sky-700 dark:border-sky-800 dark:bg-sky-900 dark:text-sky-300',
- });
- });
-
- it('keeps compact severity labels for infrastructure findings', () => {
- expect(
- getFindingCompactBadgePresentation({
- severity: 'warning',
- resourceId: 'vm-101',
- resourceName: 'db-01',
- title: 'Disk nearly full',
- }),
- ).toEqual({
- label: 'WARN',
- badgeClasses:
- 'border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-800 dark:bg-amber-900 dark:text-amber-300',
- });
- });
-
- it('routes dashboard finding rows through the shared Patrol title and action helpers', () => {
- expect(actionRequiredPanelSource).toContain(
- 'const compactBadge = getFindingCompactBadgePresentation(finding);',
- );
- expect(actionRequiredPanelSource).toContain(
- 'const title = getFindingTitlePresentation(finding).label;',
- );
- expect(actionRequiredPanelSource).toContain(
- 'const primaryAction = getFindingPrimaryActionPresentation(finding);',
- );
- expect(actionRequiredPanelSource).toContain(
- 'const manualControls = getFindingManualControlsPresentation(finding);',
- );
- expect(actionRequiredPanelSource).toContain('{compactBadge.label}');
- expect(actionRequiredPanelSource).toContain('title={title}');
- expect(actionRequiredPanelSource).toContain('{title}');
- });
-
- it('uses the Patrol provider settings action instead of rejected generic controls for Patrol runtime findings', () => {
- expect(
- getFindingTitlePresentation({
- resourceId: 'ai-service',
- resourceName: 'Pulse Patrol Service',
- title: 'Pulse Patrol: Provider billing or quota issue',
- }),
- ).toEqual({
- label: 'Provider billing or quota issue',
- });
- expect(
- getFindingPrimaryActionPresentation({
- resourceId: 'ai-service',
- resourceName: 'Pulse Patrol Service',
- title: 'Pulse Patrol: Provider billing or quota issue',
- }),
- ).toEqual({
- label: 'Open Patrol provider settings',
- href: '/settings/system-ai',
- });
- expect(
- getFindingManualControlsPresentation({
- resourceId: 'ai-service',
- resourceName: 'Pulse Patrol Service',
- title: 'Pulse Patrol: Provider billing or quota issue',
- }),
- ).toEqual({
- acknowledge: false,
- snooze: false,
- dismiss: false,
- });
- expect(actionRequiredPanelSource).toContain('when={primaryAction}');
- expect(actionRequiredPanelSource).toContain('{action().label}');
- expect(actionRequiredPanelSource).toContain('manualControls.snooze');
- expect(actionRequiredPanelSource).toContain('manualControls.dismiss');
- });
-});
diff --git a/frontend-modern/src/features/dashboardOverview/__tests__/KPIStrip.test.tsx b/frontend-modern/src/features/dashboardOverview/__tests__/KPIStrip.test.tsx
deleted file mode 100644
index 0b65fe14dd..0000000000
--- a/frontend-modern/src/features/dashboardOverview/__tests__/KPIStrip.test.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import { render, screen } from '@solidjs/testing-library';
-import { KPIStrip } from '../KPIStrip';
-
-describe('KPIStrip', () => {
- it('keeps the workloads card explicitly discoverable for containers, VMs, and pods', () => {
- render(() => (
- <KPIStrip
- infrastructure={{ total: 5, online: 5 }}
- workloads={{ total: 33, running: 28 }}
- storage={{ capacityPercent: 27, totalUsed: 20, totalCapacity: 75 }}
- alerts={{ activeCritical: 1, activeWarning: 16, total: 17 }}
- />
- ));
-
- const workloadsLink = screen.getByRole('link', { name: /workloads/i });
- expect(workloadsLink.getAttribute('href')).toBe('/workloads');
- expect(screen.getByText('VMs, containers, and pods')).toBeInTheDocument();
- expect(screen.getByText('28')).toBeInTheDocument();
- expect(screen.getByText(/running/i)).toBeInTheDocument();
- });
-});
diff --git a/frontend-modern/src/features/dashboardOverview/__tests__/ProblemResourcesTable.test.tsx b/frontend-modern/src/features/dashboardOverview/__tests__/ProblemResourcesTable.test.tsx
deleted file mode 100644
index 5d8eb7d988..0000000000
--- a/frontend-modern/src/features/dashboardOverview/__tests__/ProblemResourcesTable.test.tsx
+++ /dev/null
@@ -1,172 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import { render, screen } from '@solidjs/testing-library';
-import { ProblemResourcesTable } from '../ProblemResourcesTable';
-import type { ProblemResource } from '@/hooks/useDashboardOverview';
-import type { Resource } from '@/types/resource';
-
-function makeResource(overrides: Partial<Resource> = {}): Resource {
- return {
- id: 'test-1',
- type: 'agent',
- name: 'test-node',
- displayName: 'Test Node',
- platformId: 'pve-1',
- platformType: 'proxmox',
- sourceType: 'proxmox',
- status: 'offline',
- ...overrides,
- } as Resource;
-}
-
-function makeProblems(count: number): ProblemResource[] {
- return Array.from({ length: count }, (_, i) => ({
- resource: makeResource({ id: `res-${i}`, name: `Resource ${i}`, displayName: `Resource ${i}` }),
- problems: ['Offline'],
- worstValue: 200,
- }));
-}
-
-describe('ProblemResourcesTable', () => {
- it('does not render overflow footer when fewer than 8 problems', () => {
- render(() => <ProblemResourcesTable problems={makeProblems(7)} />);
- // Footer links should not appear
- expect(screen.queryByText('Infrastructure')).toBeNull();
- expect(screen.queryByText('Workloads')).toBeNull();
- expect(screen.queryByText('Storage')).toBeNull();
- });
-
- it('renders overflow footer with Infrastructure, Workloads, and Storage links when 8+ problems', () => {
- render(() => <ProblemResourcesTable problems={makeProblems(8)} />);
-
- const resourceLink = screen.getByText('Resource 0');
- expect(resourceLink.tagName).toBe('A');
- expect(resourceLink.getAttribute('href')).toBe('/infrastructure?resource=res-0');
-
- const infraLink = screen.getByText('Infrastructure');
- expect(infraLink.tagName).toBe('A');
- expect(infraLink.getAttribute('href')).toBe('/infrastructure');
-
- const workloadsLink = screen.getByText('Workloads');
- expect(workloadsLink.tagName).toBe('A');
- expect(workloadsLink.getAttribute('href')).toBe('/workloads');
-
- const storageLink = screen.getByText('Storage');
- expect(storageLink.tagName).toBe('A');
- expect(storageLink.getAttribute('href')).toBe('/storage');
- });
-
- it('groups repeated resource labels with the same type and problem signal', () => {
- render(() => (
- <ProblemResourcesTable
- problems={['one', 'two', 'three'].map((id) => ({
- resource: makeResource({
- id: `container-${id}`,
- type: 'system-container',
- name: `container-${id}`,
- displayName: 'Duplicate Container',
- }),
- problems: ['Offline'],
- worstValue: 200,
- }))}
- />
- ));
-
- // Grouped row shows count-led primary label linking to the overflow page.
- const resourceLink = screen.getByText('3 containers');
- expect(resourceLink.tagName).toBe('A');
- expect(resourceLink.getAttribute('href')).toBe('/workloads?type=system-container');
- // The individual member display name is shown on the sub-line so the user
- // can see what the group actually is. Duplicate names collapse to one.
- const memberLine = screen.getByText('Duplicate Container');
- expect(memberLine.tagName).toBe('SPAN');
- expect(screen.getAllByText('Offline')).toHaveLength(1);
- });
-
- it('lists distinct member names on the sub-line when they differ', () => {
- render(() => (
- <ProblemResourcesTable
- problems={[
- {
- resource: makeResource({
- id: 'storage-delly',
- type: 'storage',
- name: 'storage-delly',
- displayName: 'storage',
- }),
- problems: ['Offline'],
- worstValue: 200,
- },
- {
- resource: makeResource({
- id: 'storage-minipc',
- type: 'storage',
- name: 'storage-minipc',
- displayName: 'storage',
- }),
- problems: ['Offline'],
- worstValue: 200,
- },
- ]}
- />
- ));
-
- // Storage groups use resource wording instead of the awkward "storages".
- expect(screen.getByText('2 storage resources')).toBeInTheDocument();
- expect(screen.queryByText('2 storages')).toBeNull();
- expect(screen.queryByText('storage')).toBeNull();
- });
-
- it('hides generated status-shaped member names on grouped rows', () => {
- render(() => (
- <ProblemResourcesTable
- problems={['one', 'two'].map((id) => ({
- resource: makeResource({
- id: `container-${id}`,
- type: 'system-container',
- name: 'system container (offline)',
- displayName: 'system container (offline)',
- }),
- problems: ['Offline'],
- worstValue: 200,
- }))}
- />
- ));
-
- expect(screen.getByText('2 containers')).toBeInTheDocument();
- expect(screen.queryByText('system container (offline)')).toBeNull();
- });
-
- it('renders governed labels for policy-aware problem resources', () => {
- render(() => (
- <ProblemResourcesTable
- problems={[
- {
- resource: makeResource({
- id: 'governed-1',
- name: 'sensitive-host',
- displayName: 'Sensitive Host',
- aiSafeSummary: 'restricted host summary safe for remote AI consumption',
- policy: {
- sensitivity: 'restricted',
- routing: {
- scope: 'local-only',
- redact: ['hostname', 'alias'],
- },
- },
- }),
- problems: ['Offline'],
- worstValue: 200,
- },
- ]}
- />
- ));
-
- const resourceLink = screen.getByText('restricted host summary safe for remote AI consumption');
- expect(resourceLink.tagName).toBe('A');
- expect(resourceLink.getAttribute('title')).toBe(
- 'restricted host summary safe for remote AI consumption',
- );
- expect(screen.queryByText('Sensitive Host')).toBeNull();
- expect(screen.queryByText('sensitive-host')).toBeNull();
- });
-});
diff --git a/frontend-modern/src/features/dashboardOverview/__tests__/TrendCharts.test.tsx b/frontend-modern/src/features/dashboardOverview/__tests__/TrendCharts.test.tsx
deleted file mode 100644
index 7b832d5235..0000000000
--- a/frontend-modern/src/features/dashboardOverview/__tests__/TrendCharts.test.tsx
+++ /dev/null
@@ -1,93 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import { render, screen } from '@solidjs/testing-library';
-import { createSignal } from 'solid-js';
-import { TrendCharts } from '../TrendCharts';
-import type { DashboardTrends } from '@/hooks/useDashboardTrends';
-import type { DashboardOverview } from '@/hooks/useDashboardOverview';
-import type { HistoryTimeRange } from '@/api/charts';
-
-function makeOverview(overrides: Partial<DashboardOverview> = {}): DashboardOverview {
- return {
- health: { totalResources: 0, byStatus: {}, criticalAlerts: 0, warningAlerts: 0 },
- infrastructure: { total: 0, byStatus: {}, byType: {}, topCPU: [], topMemory: [] },
- workloads: { total: 0, running: 0, stopped: 0, byType: {} },
- storage: { total: 0, totalCapacity: 0, totalUsed: 0, warningCount: 0, criticalCount: 0 },
- alerts: { activeCritical: 0, activeWarning: 0, total: 0 },
- problemResources: [],
- ...overrides,
- };
-}
-
-function makeTrends(overrides: Partial<DashboardTrends> = {}): DashboardTrends {
- return {
- infrastructure: { cpu: new Map(), memory: new Map(), emptyMessage: null },
- storage: { capacity: null },
- loading: false,
- error: null,
- ...overrides,
- };
-}
-
-describe('TrendCharts', () => {
- it('does not render an error banner when trends.error is null', () => {
- const [range, setRange] = createSignal<HistoryTimeRange>('1h');
- render(() => (
- <TrendCharts
- trends={makeTrends({ error: null })}
- overview={makeOverview()}
- trendRange={range}
- setTrendRange={setRange}
- />
- ));
-
- expect(screen.queryByText('Unable to load trends')).toBeNull();
- });
-
- it('renders an error banner when trends.error is set', () => {
- const [range, setRange] = createSignal<HistoryTimeRange>('1h');
- render(() => (
- <TrendCharts
- trends={makeTrends({ error: 'metrics store unreachable' })}
- overview={makeOverview()}
- trendRange={range}
- setTrendRange={setRange}
- />
- ));
-
- expect(screen.getByText('Unable to load trends')).toBeTruthy();
- });
-
- it('renders the infrastructure empty-state message when the charts have no renderable history', () => {
- const [range, setRange] = createSignal<HistoryTimeRange>('1h');
- render(() => (
- <TrendCharts
- overview={makeOverview({
- infrastructure: {
- total: 2,
- byStatus: {},
- byType: {},
- topCPU: [],
- topMemory: [],
- },
- })}
- trends={makeTrends({
- infrastructure: {
- cpu: new Map(),
- memory: new Map(),
- emptyMessage: 'Gathering first sample…',
- },
- })}
- trendRange={range}
- setTrendRange={setRange}
- />
- ));
-
- expect(screen.getByText('History is warming up')).toBeTruthy();
- expect(
- screen.getByText(
- 'Pulse needs a couple of CPU and memory samples from connected infrastructure before these charts render.',
- ),
- ).toBeTruthy();
- expect(screen.getByText('Gathering first sample…')).toBeTruthy();
- });
-});
diff --git a/frontend-modern/src/features/dashboardOverview/__tests__/dashboardPulseBriefModel.test.ts b/frontend-modern/src/features/dashboardOverview/__tests__/dashboardPulseBriefModel.test.ts
deleted file mode 100644
index d066988469..0000000000
--- a/frontend-modern/src/features/dashboardOverview/__tests__/dashboardPulseBriefModel.test.ts
+++ /dev/null
@@ -1,153 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import type { DashboardOverview } from '@/hooks/useDashboardOverview';
-import type { DashboardRecoverySummary } from '@/hooks/useDashboardRecovery';
-import { buildDashboardPulseBrief } from '../dashboardPulseBriefModel';
-import type { DashboardEstateSummary } from '../estateSummaryModel';
-
-const estate = (overrides: Partial<DashboardEstateSummary> = {}): DashboardEstateSummary => ({
- hasCanonicalProjection: true,
- totalSystems: 2,
- activeSystems: 2,
- healthySystems: 2,
- degradedSystems: 0,
- offlineSystems: 0,
- unknownSystems: 0,
- ignoredSystems: 0,
- outdatedSystems: 0,
- attentionSystems: 0,
- headline: '2 systems reporting',
- detail: '2 online',
- tone: 'healthy',
- surfaces: [],
- systems: [],
- ...overrides,
-});
-
-const overview = (overrides: Partial<DashboardOverview> = {}): DashboardOverview => ({
- health: {
- totalResources: 3,
- byStatus: {},
- criticalAlerts: 0,
- warningAlerts: 0,
- },
- infrastructure: {
- total: 2,
- byStatus: {},
- byType: {},
- topCPU: [],
- topMemory: [],
- },
- workloads: {
- total: 4,
- running: 4,
- stopped: 0,
- byType: {},
- },
- storage: {
- total: 1,
- totalCapacity: 100,
- totalUsed: 40,
- warningCount: 0,
- criticalCount: 0,
- },
- alerts: {
- activeCritical: 0,
- activeWarning: 0,
- total: 0,
- },
- problemResources: [],
- ...overrides,
-});
-
-const recovery = (overrides: Partial<DashboardRecoverySummary> = {}): DashboardRecoverySummary => ({
- totalProtected: 2,
- byOutcome: { success: 2 },
- latestEventTimestamp: Date.parse('2026-04-23T12:00:00Z'),
- hasData: true,
- ...overrides,
-});
-
-describe('dashboard Pulse Brief model', () => {
- it('builds a steady operator brief from dashboard facts', () => {
- const brief = buildDashboardPulseBrief({
- estate: estate(),
- overview: overview(),
- storageCapacityPercent: 40,
- recovery: recovery(),
- pendingApprovalCount: 0,
- patrolFindingCount: 0,
- });
-
- expect(brief.tone).toBe('healthy');
- expect(brief.body).toContain('All 2 monitored systems are reporting cleanly');
- expect(brief.body).toContain('no pending approvals, active alerts, or Patrol findings');
- expect(brief.evidence).toContain('No active dashboard issues');
- expect(brief.assistantPrompt).toContain('Use only these dashboard facts');
- expect(brief.assistantPrompt).toContain('do not run commands or change anything');
- });
-
- it('prioritizes concrete problem resources before lower-level context', () => {
- const brief = buildDashboardPulseBrief({
- estate: estate({ headline: '1 system needs attention', attentionSystems: 1 }),
- overview: overview({
- alerts: { activeCritical: 1, activeWarning: 1, total: 2 },
- problemResources: [
- {
- resource: {
- id: 'vm-101',
- type: 'vm',
- name: 'vm-101',
- displayName: 'database-vm',
- status: 'offline',
- } as DashboardOverview['problemResources'][number]['resource'],
- problems: ['Offline'],
- worstValue: 200,
- },
- ],
- }),
- storageCapacityPercent: 40,
- recovery: recovery(),
- pendingApprovalCount: 0,
- patrolFindingCount: 1,
- });
-
- expect(brief.tone).toBe('critical');
- expect(brief.body).toContain('1 system needs attention');
- expect(brief.body).toContain('Review database-vm (Offline) first');
- expect(brief.evidence).toEqual(
- expect.arrayContaining(['1 resource issue', '2 active alerts', '1 Patrol finding']),
- );
- expect(brief.assistantContext.problemResources).toEqual([
- { id: 'vm-101', name: 'database-vm', problems: ['Offline'] },
- ]);
- });
-
- it('normalizes generic status-shaped problem resource names', () => {
- const brief = buildDashboardPulseBrief({
- estate: estate({ headline: '1 system needs attention', attentionSystems: 1 }),
- overview: overview({
- problemResources: [
- {
- resource: {
- id: 'storage-offline',
- type: 'storage',
- name: 'storage (offline)',
- displayName: 'storage (offline)',
- status: 'offline',
- } as DashboardOverview['problemResources'][number]['resource'],
- problems: ['Offline'],
- worstValue: 200,
- },
- ],
- }),
- storageCapacityPercent: 40,
- recovery: recovery(),
- pendingApprovalCount: 0,
- patrolFindingCount: 0,
- });
-
- expect(brief.body).toContain('Review the storage issue first');
- expect(brief.body).not.toContain('Review storage (offline) first');
- expect(brief.body).not.toContain('storage (offline) (Offline)');
- });
-});
diff --git a/frontend-modern/src/features/dashboardOverview/__tests__/estateSummaryModel.test.ts b/frontend-modern/src/features/dashboardOverview/__tests__/estateSummaryModel.test.ts
deleted file mode 100644
index 86b6b3b74f..0000000000
--- a/frontend-modern/src/features/dashboardOverview/__tests__/estateSummaryModel.test.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import type { ConnectedInfrastructureItem } from '@/types/api';
-import { buildDashboardEstateSummary } from '../estateSummaryModel';
-
-const item = (
- overrides: Partial<ConnectedInfrastructureItem> = {},
-): ConnectedInfrastructureItem => ({
- id: 'host-1',
- name: 'host-1',
- status: 'active',
- healthStatus: 'online',
- lastSeen: Date.parse('2026-04-23T10:00:00.000Z'),
- surfaces: [{ id: 'agent:host-1', kind: 'agent', label: 'Host telemetry' }],
- ...overrides,
-});
-
-describe('buildDashboardEstateSummary', () => {
- it('summarizes connected infrastructure as monitored systems, not platform tabs', () => {
- const summary = buildDashboardEstateSummary([
- item({
- id: 'pve-1',
- name: 'pve-1',
- surfaces: [
- { id: 'agent:pve-1', kind: 'agent', label: 'Host telemetry' },
- { id: 'proxmox:pve-1', kind: 'proxmox', label: 'Proxmox VE data' },
- ],
- }),
- item({
- id: 'nas-1',
- name: 'nas-1',
- healthStatus: 'degraded',
- surfaces: [{ id: 'truenas:nas-1', kind: 'truenas', label: 'TrueNAS API data' }],
- }),
- item({
- id: 'k8s-1',
- name: 'k8s-1',
- surfaces: [
- { id: 'kubernetes:k8s-1', kind: 'kubernetes', label: 'Kubernetes cluster data' },
- ],
- }),
- ]);
-
- expect(summary.totalSystems).toBe(3);
- expect(summary.activeSystems).toBe(3);
- expect(summary.healthySystems).toBe(2);
- expect(summary.degradedSystems).toBe(1);
- expect(summary.headline).toBe('1 system needs attention');
- expect(summary.surfaces.map((surface) => surface.label)).toEqual([
- 'Agent',
- 'Kubernetes',
- 'Proxmox',
- 'TrueNAS',
- ]);
- });
-
- it('uses the compact dashboard fallback when the connected projection has not arrived yet', () => {
- const summary = buildDashboardEstateSummary([], {
- total: 4,
- online: 3,
- });
-
- expect(summary.hasCanonicalProjection).toBe(false);
- expect(summary.totalSystems).toBe(4);
- expect(summary.healthySystems).toBe(3);
- expect(summary.unknownSystems).toBe(1);
- expect(summary.headline).toBe('4 systems reporting');
- expect(summary.detail).toBe('3 systems online while the system map syncs');
- });
-
- it('counts each active system needing attention once', () => {
- const summary = buildDashboardEstateSummary([
- item({ id: 'pve-1', healthStatus: 'degraded', isOutdatedBinary: true }),
- item({ id: 'ignored-1', status: 'ignored', isOutdatedBinary: true }),
- ]);
-
- expect(summary.totalSystems).toBe(2);
- expect(summary.degradedSystems).toBe(1);
- expect(summary.outdatedSystems).toBe(1);
- expect(summary.ignoredSystems).toBe(1);
- expect(summary.attentionSystems).toBe(1);
- expect(summary.headline).toBe('1 system needs attention');
- });
-});
diff --git a/frontend-modern/src/features/dashboardOverview/dashboardPulseBriefModel.ts b/frontend-modern/src/features/dashboardOverview/dashboardPulseBriefModel.ts
deleted file mode 100644
index 12f1fdc552..0000000000
--- a/frontend-modern/src/features/dashboardOverview/dashboardPulseBriefModel.ts
+++ /dev/null
@@ -1,219 +0,0 @@
-import type { DashboardRecoverySummary } from '@/hooks/useDashboardRecovery';
-import type { DashboardOverview, ProblemResource } from '@/hooks/useDashboardOverview';
-import {
- getProblemResourceDisplayName,
- getProblemResourceIssueLabel,
-} from '@/utils/problemResourcePresentation';
-import type { DashboardEstateSummary } from './estateSummaryModel';
-
-export type DashboardPulseBriefTone = 'healthy' | 'attention' | 'critical';
-
-export interface DashboardPulseBriefInput {
- estate: DashboardEstateSummary;
- overview: DashboardOverview;
- storageCapacityPercent: number;
- recovery: DashboardRecoverySummary;
- pendingApprovalCount: number;
- patrolFindingCount: number;
-}
-
-export interface DashboardPulseBrief {
- tone: DashboardPulseBriefTone;
- title: string;
- body: string;
- evidence: string[];
- assistantPrompt: string;
- assistantContext: Record<string, unknown>;
-}
-
-const pluralize = (count: number, singular: string, plural = `${singular}s`): string =>
- `${count} ${count === 1 ? singular : plural}`;
-
-function joinNatural(items: string[]): string {
- if (items.length <= 1) return items[0] ?? '';
- if (items.length === 2) return `${items[0]} and ${items[1]}`;
- return `${items.slice(0, -1).join(', ')}, and ${items[items.length - 1]}`;
-}
-
-function normalizeCount(value: number | undefined): number {
- if (!Number.isFinite(value)) return 0;
- return Math.max(0, Math.trunc(value ?? 0));
-}
-
-function problemResourceLabel(problem: ProblemResource | undefined): string | null {
- if (!problem) return null;
- const name = getProblemResourceIssueLabel(problem.resource, problem.problems).trim();
- if (!name) return null;
- const normalizedName = getProblemResourceDisplayName(problem.resource).trim().toLowerCase();
- const normalizedIssueLabel = name.toLowerCase();
- const reasons = problem.problems
- .filter((reason) => {
- const normalizedReason = reason.toLowerCase();
- return (
- !normalizedName.includes(normalizedReason) &&
- !normalizedIssueLabel.includes(normalizedReason)
- );
- })
- .slice(0, 2)
- .join(', ')
- .trim();
- return reasons ? `${name} (${reasons})` : name;
-}
-
-function buildAttentionParts(input: DashboardPulseBriefInput): string[] {
- const parts: string[] = [];
- const resourceIssues = input.overview.problemResources.length;
- const activeAlerts = normalizeCount(input.overview.alerts.total);
- const storageWarnings = normalizeCount(input.overview.storage.warningCount);
- const storageCritical = normalizeCount(input.overview.storage.criticalCount);
- const recoveryFailures =
- normalizeCount(input.recovery.byOutcome.failed) +
- normalizeCount(input.recovery.byOutcome.error);
-
- if (resourceIssues > 0) parts.push(pluralize(resourceIssues, 'resource issue'));
- if (activeAlerts > 0) parts.push(pluralize(activeAlerts, 'active alert'));
- if (storageCritical > 0) parts.push(pluralize(storageCritical, 'critical storage signal'));
- if (storageWarnings > 0) parts.push(pluralize(storageWarnings, 'storage warning'));
- if (recoveryFailures > 0) parts.push(pluralize(recoveryFailures, 'recovery failure'));
- if (input.pendingApprovalCount > 0) {
- parts.push(pluralize(input.pendingApprovalCount, 'pending approval'));
- }
- if (input.patrolFindingCount > 0) {
- parts.push(pluralize(input.patrolFindingCount, 'Patrol finding'));
- }
-
- return parts;
-}
-
-function buildBody(input: DashboardPulseBriefInput, attentionParts: string[]): string {
- const systems = input.estate.totalSystems;
- const storagePercent = Math.round(input.storageCapacityPercent);
- const topProblem = problemResourceLabel(input.overview.problemResources[0]);
- const activeAlerts = normalizeCount(input.overview.alerts.total);
- const criticalAlerts = normalizeCount(input.overview.alerts.activeCritical);
- const warningAlerts = normalizeCount(input.overview.alerts.activeWarning);
- const recoveryFailures =
- normalizeCount(input.recovery.byOutcome.failed) +
- normalizeCount(input.recovery.byOutcome.error);
-
- const opening =
- attentionParts.length > 0
- ? `${input.estate.headline}. Pulse sees ${joinNatural(attentionParts)} in the current dashboard signals.`
- : `All ${pluralize(systems, 'monitored system')} ${
- systems === 1 ? 'is' : 'are'
- } reporting cleanly across the current dashboard signals.`;
-
- const review =
- topProblem !== null
- ? `Review ${topProblem} first; it is the top-ranked problem resource.`
- : criticalAlerts > 0
- ? `Start with ${pluralize(criticalAlerts, 'critical alert')} before reviewing lower-severity work.`
- : activeAlerts > 0
- ? `There ${activeAlerts === 1 ? 'is' : 'are'} ${pluralize(warningAlerts || activeAlerts, 'warning alert')} to review.`
- : input.pendingApprovalCount > 0
- ? `There ${input.pendingApprovalCount === 1 ? 'is' : 'are'} ${pluralize(
- input.pendingApprovalCount,
- 'Assistant approval',
- )} waiting for a decision.`
- : input.patrolFindingCount > 0
- ? `Pulse Patrol has ${pluralize(input.patrolFindingCount, 'finding')} waiting for review.`
- : 'There are no pending approvals, active alerts, or Patrol findings waiting in the dashboard.';
-
- const supporting =
- input.overview.storage.criticalCount > 0 || input.overview.storage.warningCount > 0
- ? `Storage is at ${storagePercent}% capacity with storage health signals present.`
- : recoveryFailures > 0
- ? `Recovery has ${pluralize(recoveryFailures, 'failed outcome')} in the latest rollup.`
- : input.recovery.hasData
- ? `Recovery is tracking ${pluralize(input.recovery.totalProtected, 'protected item')}.`
- : 'Recovery has no protected-item rollup yet.';
-
- return `${opening} ${review} ${supporting}`;
-}
-
-function buildEvidence(input: DashboardPulseBriefInput, attentionParts: string[]): string[] {
- const evidence = [
- pluralize(input.estate.totalSystems, 'system'),
- pluralize(input.overview.workloads.total, 'workload'),
- ];
-
- if (attentionParts.length > 0) {
- evidence.push(...attentionParts.slice(0, 3));
- } else {
- evidence.push('No active dashboard issues');
- }
-
- if (input.recovery.hasData) {
- evidence.push(pluralize(input.recovery.totalProtected, 'protected item'));
- }
-
- return evidence.slice(0, 5);
-}
-
-function buildAssistantPrompt(input: DashboardPulseBriefInput, body: string): string {
- const topProblems = input.overview.problemResources
- .slice(0, 3)
- .map(problemResourceLabel)
- .filter((label): label is string => label !== null);
-
- return [
- 'Summarize the current Pulse dashboard for an operator. Use only these dashboard facts unless you need to ask for more context, and do not run commands or change anything unless the operator explicitly asks for a follow-up action.',
- '',
- `Current brief: ${body}`,
- `Systems: ${input.estate.totalSystems} total, ${input.estate.healthySystems} healthy, ${input.estate.attentionSystems} needing attention.`,
- `Alerts: ${input.overview.alerts.total} active, ${input.overview.alerts.activeCritical} critical, ${input.overview.alerts.activeWarning} warning.`,
- `Storage: ${Math.round(input.storageCapacityPercent)}% capacity, ${input.overview.storage.criticalCount} critical signals, ${input.overview.storage.warningCount} warnings.`,
- `Recovery: ${input.recovery.hasData ? `${input.recovery.totalProtected} protected items` : 'no rollup available'}.`,
- topProblems.length > 0
- ? `Top problem resources: ${topProblems.join('; ')}.`
- : 'Top problem resources: none.',
- ].join('\n');
-}
-
-export function buildDashboardPulseBrief(input: DashboardPulseBriefInput): DashboardPulseBrief {
- const attentionParts = buildAttentionParts(input);
- const body = buildBody(input, attentionParts);
- const hasCriticalSignals =
- input.estate.offlineSystems > 0 ||
- input.overview.alerts.activeCritical > 0 ||
- input.overview.storage.criticalCount > 0 ||
- input.overview.problemResources.some((problem) => problem.worstValue >= 200);
- const tone: DashboardPulseBriefTone =
- hasCriticalSignals || input.pendingApprovalCount > 0
- ? 'critical'
- : attentionParts.length > 0
- ? 'attention'
- : 'healthy';
-
- return {
- tone,
- title: tone === 'healthy' ? 'Estate looks steady' : 'Review recommended',
- body,
- evidence: buildEvidence(input, attentionParts),
- assistantPrompt: buildAssistantPrompt(input, body),
- assistantContext: {
- dashboardBrief: body,
- estate: {
- totalSystems: input.estate.totalSystems,
- healthySystems: input.estate.healthySystems,
- attentionSystems: input.estate.attentionSystems,
- },
- alerts: input.overview.alerts,
- storage: {
- capacityPercent: Math.round(input.storageCapacityPercent),
- warningCount: input.overview.storage.warningCount,
- criticalCount: input.overview.storage.criticalCount,
- },
- recovery: input.recovery,
- problemResources: input.overview.problemResources.slice(0, 3).map((problem) => ({
- id: problem.resource.id,
- name: getProblemResourceIssueLabel(problem.resource, problem.problems),
- problems: problem.problems,
- })),
- patrol: {
- findingCount: input.patrolFindingCount,
- pendingApprovalCount: input.pendingApprovalCount,
- },
- },
- };
-}
diff --git a/frontend-modern/src/features/dashboardOverview/dashboardSectionIds.ts b/frontend-modern/src/features/dashboardOverview/dashboardSectionIds.ts
deleted file mode 100644
index 0c6b601b88..0000000000
--- a/frontend-modern/src/features/dashboardOverview/dashboardSectionIds.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export const DASHBOARD_PROBLEM_RESOURCES_SECTION_ID = 'dashboard-problem-resources';
-export const DASHBOARD_ALERTS_SECTION_ID = 'dashboard-alerts';
diff --git a/frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts b/frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts
deleted file mode 100644
index 5dc65f1079..0000000000
--- a/frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-export type DashboardWidgetId = 'trends' | 'alerts' | 'recovery' | 'storage';
-
-export interface DashboardWidgetDef {
- id: DashboardWidgetId;
- label: string;
- size: 'full' | 'quarter';
- defaultVisible: boolean;
- defaultOrder: number;
-}
-
-export const DASHBOARD_WIDGETS: DashboardWidgetDef[] = [
- { id: 'alerts', label: 'Recent Alerts', size: 'full', defaultVisible: true, defaultOrder: 0 },
- { id: 'trends', label: 'Trend Charts', size: 'full', defaultVisible: true, defaultOrder: 1 },
- {
- id: 'recovery',
- label: 'Recovery Status',
- size: 'quarter',
- defaultVisible: true,
- defaultOrder: 2,
- },
- { id: 'storage', label: 'Storage', size: 'quarter', defaultVisible: true, defaultOrder: 3 },
-];
-
-export function getDashboardWidget(id: DashboardWidgetId): DashboardWidgetDef | undefined {
- return DASHBOARD_WIDGETS.find((widget) => widget.id === id);
-}
diff --git a/frontend-modern/src/features/dashboardOverview/estateSummaryModel.ts b/frontend-modern/src/features/dashboardOverview/estateSummaryModel.ts
deleted file mode 100644
index ccae997b09..0000000000
--- a/frontend-modern/src/features/dashboardOverview/estateSummaryModel.ts
+++ /dev/null
@@ -1,267 +0,0 @@
-import type { ConnectedInfrastructureItem, ConnectedInfrastructureSurface } from '@/types/api';
-import { getMonitoredSystemSourceLabel } from '@/utils/monitoredSystemPresentation';
-
-export type DashboardEstateHealthTone = 'healthy' | 'warning' | 'danger' | 'muted';
-
-export interface DashboardEstateFallback {
- total: number;
- online: number;
-}
-
-export interface DashboardEstateSurfaceSummary {
- kind: ConnectedInfrastructureSurface['kind'];
- label: string;
- count: number;
-}
-
-export interface DashboardEstateSystemSummary {
- id: string;
- name: string;
- statusLabel: string;
- tone: DashboardEstateHealthTone;
- lastSeen?: number;
- surfaces: DashboardEstateSurfaceSummary[];
-}
-
-export interface DashboardEstateSummary {
- hasCanonicalProjection: boolean;
- totalSystems: number;
- activeSystems: number;
- healthySystems: number;
- degradedSystems: number;
- offlineSystems: number;
- unknownSystems: number;
- ignoredSystems: number;
- outdatedSystems: number;
- attentionSystems: number;
- latestSeen?: number;
- headline: string;
- detail: string;
- tone: DashboardEstateHealthTone;
- surfaces: DashboardEstateSurfaceSummary[];
- systems: DashboardEstateSystemSummary[];
-}
-
-const OFFLINE_HEALTH_STATUSES = new Set(['offline', 'stopped', 'down', 'unreachable']);
-const DEGRADED_HEALTH_STATUSES = new Set(['critical', 'degraded', 'error', 'failed', 'warning']);
-const HEALTHY_HEALTH_STATUSES = new Set(['active', 'healthy', 'ok', 'online', 'ready', 'running']);
-
-const normalizeValue = (value: string | undefined): string => value?.trim().toLowerCase() ?? '';
-
-const pluralize = (count: number, singular: string, plural = `${singular}s`): string =>
- `${count} ${count === 1 ? singular : plural}`;
-
-function classifyHealth(item: ConnectedInfrastructureItem): {
- label: string;
- tone: DashboardEstateHealthTone;
- bucket: 'healthy' | 'degraded' | 'offline' | 'unknown' | 'ignored';
-} {
- if (item.status === 'ignored') {
- return { label: 'Ignored', tone: 'muted', bucket: 'ignored' };
- }
-
- const health = normalizeValue(item.healthStatus);
- if (OFFLINE_HEALTH_STATUSES.has(health)) {
- return { label: 'Offline', tone: 'danger', bucket: 'offline' };
- }
- if (DEGRADED_HEALTH_STATUSES.has(health)) {
- return { label: 'Degraded', tone: 'warning', bucket: 'degraded' };
- }
- if (health === '' || HEALTHY_HEALTH_STATUSES.has(health)) {
- return { label: 'Online', tone: 'healthy', bucket: 'healthy' };
- }
- return { label: 'Unknown', tone: 'warning', bucket: 'unknown' };
-}
-
-function surfaceLabel(kind: ConnectedInfrastructureSurface['kind']): string {
- const label = getMonitoredSystemSourceLabel(kind);
- return label || kind;
-}
-
-function summarizeSurfaces(
- surfaces: ConnectedInfrastructureSurface[],
-): DashboardEstateSurfaceSummary[] {
- const counts = new Map<ConnectedInfrastructureSurface['kind'], number>();
-
- for (const surface of surfaces) {
- counts.set(surface.kind, (counts.get(surface.kind) ?? 0) + 1);
- }
-
- return Array.from(counts.entries())
- .map(([kind, count]) => ({
- kind,
- label: surfaceLabel(kind),
- count,
- }))
- .sort((left, right) => {
- if (right.count !== left.count) return right.count - left.count;
- return left.label.localeCompare(right.label);
- });
-}
-
-function buildFallbackSummary(fallback: DashboardEstateFallback): DashboardEstateSummary {
- const total = Math.max(0, Math.trunc(fallback.total));
- const healthy = Math.max(0, Math.min(total, Math.trunc(fallback.online)));
- const unknown = Math.max(0, total - healthy);
- const tone: DashboardEstateHealthTone =
- total === 0 ? 'muted' : unknown > 0 ? 'warning' : 'healthy';
-
- return {
- hasCanonicalProjection: false,
- totalSystems: total,
- activeSystems: total,
- healthySystems: healthy,
- degradedSystems: 0,
- offlineSystems: 0,
- unknownSystems: unknown,
- ignoredSystems: 0,
- outdatedSystems: 0,
- attentionSystems: unknown,
- headline:
- total === 0 ? 'No infrastructure reporting' : `${pluralize(total, 'system')} reporting`,
- detail:
- total === 0
- ? 'Connected systems appear here after the first infrastructure source reports.'
- : unknown > 0
- ? `${pluralize(healthy, 'system')} online while the system map syncs`
- : 'System map still syncing',
- tone,
- surfaces: [],
- systems: [],
- };
-}
-
-export function buildDashboardEstateSummary(
- items: ConnectedInfrastructureItem[],
- fallback?: DashboardEstateFallback,
-): DashboardEstateSummary {
- if (items.length === 0 && fallback) {
- return buildFallbackSummary(fallback);
- }
-
- let activeSystems = 0;
- let healthySystems = 0;
- let degradedSystems = 0;
- let offlineSystems = 0;
- let unknownSystems = 0;
- let ignoredSystems = 0;
- let outdatedSystems = 0;
- let latestSeen: number | undefined;
- const attentionSystemIds = new Set<string>();
- const allSurfaces: ConnectedInfrastructureSurface[] = [];
-
- const systems = items
- .map((item): DashboardEstateSystemSummary => {
- const health = classifyHealth(item);
- const name =
- item.displayName?.trim() || item.name?.trim() || item.hostname?.trim() || item.id;
- const itemSurfaces = summarizeSurfaces(item.surfaces ?? []);
-
- if (item.status === 'ignored') {
- ignoredSystems += 1;
- } else {
- activeSystems += 1;
- }
-
- switch (health.bucket) {
- case 'healthy':
- healthySystems += 1;
- break;
- case 'degraded':
- degradedSystems += 1;
- break;
- case 'offline':
- offlineSystems += 1;
- break;
- case 'unknown':
- unknownSystems += 1;
- break;
- case 'ignored':
- break;
- }
-
- if (item.isOutdatedBinary && item.status !== 'ignored') {
- outdatedSystems += 1;
- }
- if (
- item.status !== 'ignored' &&
- (health.bucket === 'degraded' ||
- health.bucket === 'offline' ||
- health.bucket === 'unknown' ||
- item.isOutdatedBinary)
- ) {
- attentionSystemIds.add(item.id);
- }
- if (typeof item.lastSeen === 'number' && Number.isFinite(item.lastSeen)) {
- latestSeen = Math.max(latestSeen ?? 0, item.lastSeen);
- }
- allSurfaces.push(...(item.surfaces ?? []));
-
- return {
- id: item.id,
- name,
- statusLabel: item.isOutdatedBinary ? `${health.label} Β· update available` : health.label,
- tone: item.isOutdatedBinary && health.tone === 'healthy' ? 'warning' : health.tone,
- lastSeen: item.lastSeen,
- surfaces: itemSurfaces,
- };
- })
- .sort((left, right) => {
- const toneRank: Record<DashboardEstateHealthTone, number> = {
- danger: 0,
- warning: 1,
- muted: 2,
- healthy: 3,
- };
- if (toneRank[left.tone] !== toneRank[right.tone]) {
- return toneRank[left.tone] - toneRank[right.tone];
- }
- return left.name.localeCompare(right.name);
- });
-
- const attentionSystems = attentionSystemIds.size;
- const tone: DashboardEstateHealthTone =
- offlineSystems > 0
- ? 'danger'
- : attentionSystems > 0
- ? 'warning'
- : activeSystems > 0
- ? 'healthy'
- : 'muted';
-
- const headline =
- items.length === 0
- ? 'No infrastructure reporting'
- : attentionSystems > 0
- ? `${pluralize(attentionSystems, 'system')} ${
- attentionSystems === 1 ? 'needs' : 'need'
- } attention`
- : `${pluralize(activeSystems, 'system')} reporting`;
-
- const statusParts: string[] = [];
- if (healthySystems > 0) statusParts.push(`${healthySystems} online`);
- if (degradedSystems > 0) statusParts.push(`${degradedSystems} degraded`);
- if (offlineSystems > 0) statusParts.push(`${offlineSystems} offline`);
- if (unknownSystems > 0) statusParts.push(`${unknownSystems} unknown`);
- if (ignoredSystems > 0) statusParts.push(`${ignoredSystems} ignored`);
- if (outdatedSystems > 0) statusParts.push(`${outdatedSystems} update available`);
-
- return {
- hasCanonicalProjection: true,
- totalSystems: items.length,
- activeSystems,
- healthySystems,
- degradedSystems,
- offlineSystems,
- unknownSystems,
- ignoredSystems,
- outdatedSystems,
- attentionSystems,
- latestSeen,
- headline,
- detail: statusParts.length > 0 ? statusParts.join(' Β· ') : 'Waiting for system status.',
- tone,
- surfaces: summarizeSurfaces(allSurfaces),
- systems,
- };
-}
diff --git a/frontend-modern/src/features/dashboardOverview/index.ts b/frontend-modern/src/features/dashboardOverview/index.ts
deleted file mode 100644
index 2a0127f5b9..0000000000
--- a/frontend-modern/src/features/dashboardOverview/index.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export { ActionRequiredPanel } from './ActionRequiredPanel';
-export { DashboardCustomizer } from './DashboardCustomizer';
-export { EstateSummaryPanel } from './EstateSummaryPanel';
-export { KPIStrip } from './KPIStrip';
-export { ProblemResourcesTable } from './ProblemResourcesTable';
-export { PulseBriefPanel } from './PulseBriefPanel';
-export { TrendCharts } from './TrendCharts';
-export { useDashboardPulseBrief } from './useDashboardPulseBrief';
diff --git a/frontend-modern/src/features/dashboardOverview/useDashboardPulseBrief.ts b/frontend-modern/src/features/dashboardOverview/useDashboardPulseBrief.ts
deleted file mode 100644
index 511c6b4406..0000000000
--- a/frontend-modern/src/features/dashboardOverview/useDashboardPulseBrief.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { createEffect, createMemo, type Accessor } from 'solid-js';
-import type { DashboardRecoverySummary } from '@/hooks/useDashboardRecovery';
-import type { DashboardOverview } from '@/hooks/useDashboardOverview';
-import { aiRuntimeSettings, loadAIRuntimeSettings } from '@/stores/aiRuntimeState';
-import { hasFeature } from '@/stores/license';
-import type { DashboardEstateSummary } from './estateSummaryModel';
-import { buildDashboardPulseBrief, type DashboardPulseBrief } from './dashboardPulseBriefModel';
-
-interface UseDashboardPulseBriefInput {
- estate: Accessor<DashboardEstateSummary>;
- overview: Accessor<DashboardOverview>;
- storageCapacityPercent: Accessor<number>;
- recovery: Accessor<DashboardRecoverySummary>;
- pendingApprovalCount: Accessor<number>;
- patrolFindingCount: Accessor<number>;
-}
-
-export function useDashboardPulseBrief(
- input: UseDashboardPulseBriefInput,
-): Accessor<DashboardPulseBrief | null> {
- createEffect(() => {
- if (!hasFeature('ai_patrol')) return;
- void loadAIRuntimeSettings().catch(() => undefined);
- });
-
- return createMemo(() => {
- const settings = aiRuntimeSettings();
- if (!hasFeature('ai_patrol') || !settings?.enabled || !settings.configured) {
- return null;
- }
-
- return buildDashboardPulseBrief({
- estate: input.estate(),
- overview: input.overview(),
- storageCapacityPercent: input.storageCapacityPercent(),
- recovery: input.recovery(),
- pendingApprovalCount: input.pendingApprovalCount(),
- patrolFindingCount: input.patrolFindingCount(),
- });
- });
-}
diff --git a/frontend-modern/src/hooks/__tests__/useDashboardActions.test.ts b/frontend-modern/src/hooks/__tests__/useDashboardActions.test.ts
deleted file mode 100644
index 6e6cb24de5..0000000000
--- a/frontend-modern/src/hooks/__tests__/useDashboardActions.test.ts
+++ /dev/null
@@ -1,190 +0,0 @@
-import { createRoot, createSignal } from 'solid-js';
-import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
-import type { Alert } from '@/types/api';
-
-vi.mock('@/api/ai', () => ({
- AIAPI: {
- getUnifiedFindings: vi.fn(),
- getPendingApprovals: vi.fn(),
- },
-}));
-
-vi.mock('@/api/patrol', () => ({
- acknowledgeFinding: vi.fn(),
- snoozeFinding: vi.fn(),
- dismissFinding: vi.fn(),
- setFindingNote: vi.fn(),
-}));
-
-vi.mock('@/stores/license', () => ({
- hasFeature: (feature: string) => feature === 'ai_patrol',
-}));
-
-vi.mock('@/utils/logger', () => ({
- logger: {
- debug: vi.fn(),
- info: vi.fn(),
- warn: vi.fn(),
- error: vi.fn(),
- },
-}));
-
-import { AIAPI } from '@/api/ai';
-import { useDashboardActions } from '@/hooks/useDashboardActions';
-
-describe('useDashboardActions', () => {
- beforeEach(() => {
- vi.clearAllMocks();
- vi.useFakeTimers();
- vi.setSystemTime(new Date('2026-03-01T00:00:00Z'));
- window.history.replaceState({}, '', '/dashboard');
- });
-
- afterEach(() => {
- vi.useRealTimers();
- });
-
- it('drops expired Patrol approvals before the next dashboard refresh poll', async () => {
- vi.mocked(AIAPI.getUnifiedFindings).mockResolvedValue({
- findings: [
- {
- id: 'finding-queued',
- source: 'ai-patrol',
- severity: 'warning',
- category: 'performance',
- resource_id: 'instance:node:200',
- resource_name: 'node-200',
- resource_type: 'host',
- title: 'Queued remediation',
- description: 'Patrol queued a remediation.',
- detected_at: '2026-03-01T00:00:00Z',
- status: 'active',
- investigation_outcome: 'fix_queued',
- },
- ],
- count: 1,
- } as never);
-
- vi.mocked(AIAPI.getPendingApprovals).mockResolvedValue([
- {
- id: 'approval-fix',
- toolId: 'investigation_fix',
- command: 'systemctl restart pulse-agent',
- targetType: 'host',
- targetId: 'finding-queued',
- targetName: 'node-200',
- context: 'Restart the agent',
- riskLevel: 'medium',
- status: 'pending',
- requestedAt: '2026-03-01T00:01:00Z',
- expiresAt: '2026-03-01T00:00:20Z',
- },
- ] as never);
-
- let dispose!: () => void;
- let actions!: ReturnType<typeof useDashboardActions>;
-
- createRoot((d) => {
- dispose = d;
- const [alertsList] = createSignal<Alert[]>([]);
- actions = useDashboardActions(alertsList);
- });
-
- await Promise.resolve();
- await Promise.resolve();
-
- expect(actions.pendingApprovals().map((approval) => approval.id)).toEqual(['approval-fix']);
- expect(actions.findingsNeedingAttention()).toEqual([]);
- expect(actions.totalActionCount()).toBe(1);
-
- await vi.advanceTimersByTimeAsync(21_000);
-
- expect(actions.pendingApprovals()).toEqual([]);
- expect(actions.findingsNeedingAttention().map((finding) => finding.id)).toEqual([
- 'finding-queued',
- ]);
- expect(actions.totalActionCount()).toBe(1);
- expect(vi.mocked(AIAPI.getPendingApprovals)).toHaveBeenCalledTimes(1);
-
- dispose();
- });
-
- it('surfaces the store-owned attention ordering unchanged', async () => {
- vi.mocked(AIAPI.getUnifiedFindings).mockResolvedValue({
- findings: [
- {
- id: 'infra-warning',
- source: 'ai-patrol',
- severity: 'warning',
- category: 'infrastructure',
- resource_id: 'instance:node:101',
- resource_name: 'db-01',
- resource_type: 'host',
- title: 'Disk nearly full',
- description: 'Storage usage is high.',
- detected_at: '2026-03-01T00:00:00Z',
- status: 'active',
- investigation_outcome: 'fix_verification_unknown',
- },
- {
- id: 'runtime-warning',
- source: 'ai-patrol',
- severity: 'warning',
- category: 'service',
- resource_id: 'ai-service',
- resource_name: 'Pulse Patrol Service',
- resource_type: 'service',
- title: 'Pulse Patrol: Provider billing or quota issue',
- description: 'Provider billing or quota needs attention.',
- detected_at: '2026-03-01T00:01:00Z',
- last_seen_at: '2026-03-01T00:05:00Z',
- status: 'active',
- investigation_outcome: 'fix_failed',
- },
- ],
- count: 2,
- } as never);
- vi.mocked(AIAPI.getPendingApprovals).mockResolvedValue([] as never);
-
- let dispose!: () => void;
- let actions!: ReturnType<typeof useDashboardActions>;
-
- createRoot((d) => {
- dispose = d;
- const [alertsList] = createSignal<Alert[]>([]);
- actions = useDashboardActions(alertsList);
- });
-
- await Promise.resolve();
- await Promise.resolve();
-
- expect(actions.findingsNeedingAttention().map((finding) => finding.id)).toEqual([
- 'runtime-warning',
- 'infra-warning',
- ]);
-
- dispose();
- });
-
- it('stays idle when the dashboard action surface is not enabled', async () => {
- let dispose!: () => void;
- let actions!: ReturnType<typeof useDashboardActions>;
-
- createRoot((d) => {
- dispose = d;
- const [alertsList] = createSignal<Alert[]>([]);
- const [enabled] = createSignal(false);
- actions = useDashboardActions(alertsList, { enabled });
- });
-
- await Promise.resolve();
- await Promise.resolve();
-
- expect(vi.mocked(AIAPI.getUnifiedFindings)).not.toHaveBeenCalled();
- expect(vi.mocked(AIAPI.getPendingApprovals)).not.toHaveBeenCalled();
- expect(actions.pendingApprovals()).toEqual([]);
- expect(actions.findingsNeedingAttention()).toEqual([]);
-
- dispose();
- });
-});
diff --git a/frontend-modern/src/hooks/__tests__/useDashboardOverview.test.ts b/frontend-modern/src/hooks/__tests__/useDashboardOverview.test.ts
deleted file mode 100644
index 966dce835f..0000000000
--- a/frontend-modern/src/hooks/__tests__/useDashboardOverview.test.ts
+++ /dev/null
@@ -1,289 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import type { Alert } from '@/types/api';
-import type { Resource } from '@/types/resource';
-import { computeDashboardOverview } from '@/hooks/useDashboardOverview';
-
-const EMPTY_STATUS_COUNTS: Record<string, number> = {
- online: 0,
- offline: 0,
- running: 0,
- stopped: 0,
- degraded: 0,
- paused: 0,
- unknown: 0,
-};
-
-function createResource(overrides: Partial<Resource> = {}): Resource {
- return {
- id: 'resource-1',
- type: 'agent',
- name: 'resource-1',
- displayName: 'Resource 1',
- platformId: 'platform-1',
- platformType: 'agent',
- sourceType: 'agent',
- status: 'online',
- lastSeen: Date.now(),
- ...overrides,
- };
-}
-
-function createAlert(overrides: Partial<Alert> = {}): Alert {
- return {
- id: 'alert-1',
- type: 'cpu',
- level: 'warning',
- resourceId: 'resource-1',
- resourceName: 'Resource 1',
- node: 'node-1',
- instance: 'instance-1',
- message: 'CPU high',
- value: 91,
- threshold: 80,
- startTime: '2026-02-01T00:00:00.000Z',
- acknowledged: false,
- ...overrides,
- };
-}
-
-describe('computeDashboardOverview', () => {
- it('returns a fully-zeroed summary for empty state', () => {
- const overview = computeDashboardOverview([], []);
-
- expect(overview.health.totalResources).toBe(0);
- expect(overview.health.byStatus).toEqual(EMPTY_STATUS_COUNTS);
- expect(overview.infrastructure.total).toBe(0);
- expect(overview.infrastructure.byStatus).toEqual(EMPTY_STATUS_COUNTS);
- expect(overview.infrastructure.byType).toEqual({});
- expect(overview.infrastructure.topCPU).toEqual([]);
- expect(overview.infrastructure.topMemory).toEqual([]);
- expect(overview.workloads).toEqual({
- total: 0,
- running: 0,
- stopped: 0,
- byType: {},
- });
- expect(overview.storage).toEqual({
- total: 0,
- totalCapacity: 0,
- totalUsed: 0,
- warningCount: 0,
- criticalCount: 0,
- });
- expect(overview.alerts).toEqual({
- activeCritical: 0,
- activeWarning: 0,
- total: 0,
- });
- });
-
- it('handles infrastructure-only resources and returns top CPU/memory lists', () => {
- const resources: Resource[] = [
- createResource({
- id: 'infra-1',
- type: 'agent',
- displayName: 'Host 1',
- status: 'online',
- cpu: { current: 10 },
- memory: { current: 40 },
- }),
- createResource({
- id: 'infra-2',
- type: 'agent',
- displayName: 'Node 2',
- status: 'online',
- cpu: { current: 90 },
- memory: { current: 70 },
- }),
- createResource({
- id: 'infra-3',
- type: 'k8s-node',
- displayName: 'K8S 3',
- status: 'degraded',
- cpu: { current: 50 },
- memory: { current: 60 },
- }),
- createResource({
- id: 'infra-4',
- type: 'docker-host',
- displayName: 'Docker 4',
- status: 'offline',
- cpu: { current: 30 },
- memory: { current: 10 },
- }),
- createResource({
- id: 'infra-5',
- type: 'agent',
- displayName: 'NAS 5',
- platformType: 'truenas',
- status: 'online',
- cpu: { current: 70 },
- memory: { current: 50 },
- }),
- createResource({
- id: 'infra-6',
- type: 'k8s-cluster',
- displayName: 'Cluster 6',
- status: 'online',
- cpu: { current: 20 },
- memory: { current: 80 },
- }),
- ];
-
- const overview = computeDashboardOverview(resources, []);
-
- expect(overview.infrastructure.total).toBe(6);
- expect(overview.infrastructure.byType).toEqual({
- agent: 3,
- 'k8s-node': 1,
- 'docker-host': 1,
- 'k8s-cluster': 1,
- });
- expect(overview.infrastructure.byStatus.online).toBe(4);
- expect(overview.infrastructure.byStatus.offline).toBe(1);
- expect(overview.infrastructure.byStatus.degraded).toBe(1);
-
- expect(overview.infrastructure.topCPU).toHaveLength(5);
- expect(overview.infrastructure.topCPU.map((item) => item.id)).toEqual([
- 'infra-2',
- 'infra-5',
- 'infra-3',
- 'infra-4',
- 'infra-6',
- ]);
- expect(overview.infrastructure.topMemory.map((item) => item.id)).toEqual([
- 'infra-6',
- 'infra-2',
- 'infra-3',
- 'infra-5',
- 'infra-1',
- ]);
- expect(overview.infrastructure.topCPU[0]?.name).toBe('Node 2');
- expect(overview.infrastructure.topMemory[0]?.name).toBe('Cluster 6');
-
- expect(overview.workloads.total).toBe(0);
- expect(overview.storage.total).toBe(0);
- });
-
- it('handles workloads-only resources and computes running/stopped counts', () => {
- const resources: Resource[] = [
- createResource({ id: 'wl-1', type: 'vm', status: 'running' }),
- createResource({ id: 'wl-2', type: 'system-container', status: 'online' }),
- createResource({ id: 'wl-3', type: 'app-container', status: 'stopped' }),
- createResource({ id: 'wl-4', type: 'pod', status: 'offline' }),
- ];
-
- const overview = computeDashboardOverview(resources, []);
-
- expect(overview.workloads.total).toBe(4);
- expect(overview.workloads.running).toBe(2);
- expect(overview.workloads.stopped).toBe(2);
- expect(overview.workloads.byType).toEqual({
- vm: 1,
- 'system-container': 1,
- 'app-container': 1,
- pod: 1,
- });
- expect(overview.infrastructure.total).toBe(0);
- expect(overview.storage.total).toBe(0);
- });
-
- it('uses governed labels in dashboard summary rows when policy requires them', () => {
- const resources: Resource[] = [
- createResource({
- id: 'infra-sensitive',
- type: 'agent',
- displayName: 'Sensitive Host',
- name: 'sensitive-host',
- aiSafeSummary: 'restricted host summary safe for remote AI consumption',
- policy: {
- sensitivity: 'restricted',
- routing: {
- scope: 'local-only',
- redact: ['hostname', 'alias'],
- },
- },
- status: 'online',
- cpu: { current: 95 },
- memory: { current: 88 },
- }),
- ];
-
- const overview = computeDashboardOverview(resources, []);
-
- expect(overview.infrastructure.topCPU[0]?.name).toBe(
- 'restricted host summary safe for remote AI consumption',
- );
- expect(overview.infrastructure.topMemory[0]?.name).toBe(
- 'restricted host summary safe for remote AI consumption',
- );
- });
-
- it('handles full mixed resources including storage thresholds and byte totals', () => {
- const resources: Resource[] = [
- createResource({
- id: 'infra-a',
- type: 'agent',
- status: 'online',
- cpu: { current: 25 },
- memory: { current: 55 },
- }),
- createResource({
- id: 'workload-a',
- type: 'vm',
- status: 'running',
- }),
- createResource({
- id: 'storage-warning',
- type: 'dataset',
- status: 'online',
- disk: { current: 85, total: 1_000, used: 850 },
- }),
- createResource({
- id: 'storage-critical',
- type: 'pool',
- status: 'degraded',
- disk: { current: 95, total: 2_000, used: 1_950 },
- }),
- createResource({
- id: 'storage-no-disk',
- type: 'storage',
- status: 'unknown',
- }),
- ];
-
- const overview = computeDashboardOverview(resources, []);
-
- expect(overview.health.totalResources).toBe(5);
- expect(overview.health.byStatus.online).toBe(2);
- expect(overview.health.byStatus.running).toBe(1);
- expect(overview.health.byStatus.degraded).toBe(1);
- expect(overview.health.byStatus.unknown).toBe(1);
-
- expect(overview.infrastructure.total).toBe(1);
- expect(overview.workloads.total).toBe(1);
- expect(overview.storage.total).toBe(3);
- expect(overview.storage.totalCapacity).toBe(3_000);
- expect(overview.storage.totalUsed).toBe(2_800);
- expect(overview.storage.warningCount).toBe(1);
- expect(overview.storage.criticalCount).toBe(1);
- });
-
- it('counts alerts by severity for both health and alerts sections', () => {
- const alerts: Alert[] = [
- createAlert({ id: 'a-1', level: 'critical' }),
- createAlert({ id: 'a-2', level: 'warning' }),
- createAlert({ id: 'a-3', level: 'critical' }),
- ];
-
- const overview = computeDashboardOverview([], alerts);
-
- expect(overview.alerts).toEqual({
- activeCritical: 2,
- activeWarning: 1,
- total: 3,
- });
- expect(overview.health.criticalAlerts).toBe(2);
- expect(overview.health.warningAlerts).toBe(1);
- });
-});
diff --git a/frontend-modern/src/hooks/__tests__/useDashboardTrends.test.ts b/frontend-modern/src/hooks/__tests__/useDashboardTrends.test.ts
deleted file mode 100644
index 67d0e76048..0000000000
--- a/frontend-modern/src/hooks/__tests__/useDashboardTrends.test.ts
+++ /dev/null
@@ -1,462 +0,0 @@
-import { createRoot, createSignal } from 'solid-js';
-import { beforeEach, describe, expect, it, vi } from 'vitest';
-import type { DashboardOverviewSummary } from '@/hooks/useDashboardOverview';
-
-vi.mock('@/utils/apiClient', () => ({
- getOrgID: () => 'test-org',
-}));
-
-vi.mock('@/stores/events', () => ({
- eventBus: {
- on: vi.fn(() => () => {}),
- },
-}));
-
-vi.mock('@/utils/infrastructureSummaryCache', () => ({
- fetchInfrastructureSummaryAndCache: vi.fn(),
- readInfrastructureSummaryCache: vi.fn(),
-}));
-
-vi.mock('@/utils/storageSummaryTrendCache', () => ({
- fetchStorageSummaryTrendAndCache: vi.fn(),
- readStorageSummaryTrendCache: vi.fn(),
-}));
-
-import useDashboardTrendsSource from '@/hooks/useDashboardTrends.ts?raw';
-import {
- buildStorageCapacityTrendPoints,
- computeTrendDelta,
- extractTrendData,
- useDashboardTrends,
- type TrendPoint,
-} from '@/hooks/useDashboardTrends';
-import {
- fetchInfrastructureSummaryAndCache,
- readInfrastructureSummaryCache,
-} from '@/utils/infrastructureSummaryCache';
-import {
- fetchStorageSummaryTrendAndCache,
- readStorageSummaryTrendCache,
-} from '@/utils/storageSummaryTrendCache';
-
-function createOverviewSummary(
- overrides: Partial<DashboardOverviewSummary> = {},
-): DashboardOverviewSummary {
- return {
- health: {
- totalResources: 0,
- byStatus: {},
- ...overrides.health,
- },
- infrastructure: {
- total: 0,
- byStatus: {},
- byType: {},
- topCPU: [],
- topMemory: [],
- ...overrides.infrastructure,
- },
- workloads: {
- total: 0,
- running: 0,
- stopped: 0,
- byType: {},
- ...overrides.workloads,
- },
- storage: {
- total: 0,
- totalCapacity: 0,
- totalUsed: 0,
- warningCount: 0,
- criticalCount: 0,
- ...overrides.storage,
- },
- problemResources: [],
- ...overrides,
- };
-}
-
-function createPoints(values: number[]): TrendPoint[] {
- const start = 1_700_000_000_000;
- return values.map((value, index) => ({
- timestamp: start + index * 60_000,
- value,
- }));
-}
-
-describe('computeTrendDelta', () => {
- it('returns null for empty points', () => {
- expect(computeTrendDelta([])).toBeNull();
- });
-
- it('returns null for a single point', () => {
- expect(computeTrendDelta(createPoints([42]))).toBeNull();
- });
-
- it('returns positive delta for an increasing trend', () => {
- const delta = computeTrendDelta(createPoints([10, 12, 14, 16, 18, 20, 22, 24]));
- expect(delta).not.toBeNull();
- expect(delta ?? 0).toBeGreaterThan(0);
- });
-
- it('returns negative delta for a decreasing trend', () => {
- const delta = computeTrendDelta(createPoints([24, 22, 20, 18, 16, 14, 12, 10]));
- expect(delta).not.toBeNull();
- expect(delta ?? 0).toBeLessThan(0);
- });
-
- it('returns near-zero delta for a flat trend', () => {
- const delta = computeTrendDelta(createPoints([55, 55, 55, 55, 55, 55, 55, 55]));
- expect(delta).not.toBeNull();
- expect(delta ?? 0).toBeCloseTo(0, 10);
- });
-
- it('supports exactly two points', () => {
- const delta = computeTrendDelta(createPoints([10, 20]));
- expect(delta).not.toBeNull();
- expect(delta ?? 0).toBeCloseTo(100, 6);
- });
-});
-
-describe('extractTrendData', () => {
- it('returns empty trend data for empty input', () => {
- expect(extractTrendData([])).toEqual({
- points: [],
- delta: null,
- currentValue: null,
- });
- });
-
- it('returns empty trend data for a single point input', () => {
- expect(extractTrendData(createPoints([80]))).toEqual({
- points: [],
- delta: null,
- currentValue: null,
- });
- });
-
- it('normalizes, sorts, and computes trend fields for real-ish data', () => {
- const rawPoints = [
- { timestamp: 1_700_000_360_000, value: 65 },
- { timestamp: 1_700_000_000_000, value: 50 },
- { timestamp: 1_700_000_180_000, value: 55 },
- { timestamp: 1_700_000_540_000, value: 72 },
- ];
-
- const trend = extractTrendData(rawPoints);
-
- expect(trend.points.map((point) => point.timestamp)).toEqual([
- 1_700_000_000_000, 1_700_000_180_000, 1_700_000_360_000, 1_700_000_540_000,
- ]);
- expect(trend.currentValue).toBe(72);
- expect(trend.delta).not.toBeNull();
- expect(trend.delta ?? 0).toBeGreaterThan(0);
- });
-});
-
-describe('buildStorageCapacityTrendPoints', () => {
- it('aggregates used and available bytes into total capacity percentages', () => {
- const points = buildStorageCapacityTrendPoints({
- 'pool-a': {
- name: 'Pool A',
- usage: [],
- used: createPoints([400, 600]),
- avail: createPoints([600, 400]),
- },
- 'pool-b': {
- name: 'Pool B',
- usage: [],
- used: createPoints([100, 300]),
- avail: createPoints([900, 700]),
- },
- });
-
- expect(points).toEqual([
- { timestamp: 1_700_000_000_000, value: 25 },
- { timestamp: 1_700_000_060_000, value: 45 },
- ]);
- });
-
- it('drops timestamps without both used and available capacity', () => {
- const points = buildStorageCapacityTrendPoints({
- 'pool-a': {
- name: 'Pool A',
- usage: [],
- used: createPoints([400, 600]),
- avail: [{ timestamp: 1_700_000_000_000, value: 600 }],
- },
- });
-
- expect(points).toEqual([{ timestamp: 1_700_000_000_000, value: 40 }]);
- });
-});
-
-describe('useDashboardTrends fetch scoping', () => {
- beforeEach(() => {
- vi.clearAllMocks();
- vi.mocked(readInfrastructureSummaryCache).mockReturnValue(null);
- vi.mocked(fetchInfrastructureSummaryAndCache).mockResolvedValue({
- map: new Map([
- [
- 'infra-a',
- {
- cpu: createPoints([20, 30]),
- memory: createPoints([40, 50]),
- },
- ],
- [
- 'infra-b',
- {
- cpu: createPoints([45, 55]),
- memory: createPoints([65, 75]),
- },
- ],
- ]),
- oldestDataTimestamp: null,
- });
- vi.mocked(readStorageSummaryTrendCache).mockReturnValue(null);
- vi.mocked(fetchStorageSummaryTrendAndCache).mockResolvedValue({
- capacity: createPoints([40, 50]),
- timestamp: 1_700_000_060_000,
- stats: {} as never,
- });
- });
-
- it('does not refetch dashboard summary charts as the compact overview expands within the same scope', async () => {
- const initialOverview = createOverviewSummary({
- health: { totalResources: 2, byStatus: { online: 2 } },
- infrastructure: {
- total: 1,
- byStatus: { online: 1 },
- byType: { agent: 1 },
- topCPU: [{ id: 'infra-a', name: 'Infra A', percent: 55 }],
- topMemory: [{ id: 'infra-a', name: 'Infra A', percent: 75 }],
- },
- storage: {
- total: 1,
- totalCapacity: 1000,
- totalUsed: 500,
- warningCount: 0,
- criticalCount: 0,
- },
- });
- const expandedOverview = createOverviewSummary({
- ...initialOverview,
- health: { totalResources: 4, byStatus: { online: 4 } },
- infrastructure: {
- total: 2,
- byStatus: { online: 2 },
- byType: { agent: 2 },
- topCPU: [
- { id: 'infra-a', name: 'Infra A', percent: 55 },
- { id: 'infra-b', name: 'Infra B', percent: 45 },
- ],
- topMemory: [
- { id: 'infra-a', name: 'Infra A', percent: 75 },
- { id: 'infra-b', name: 'Infra B', percent: 65 },
- ],
- },
- });
-
- let dispose!: () => void;
- let trends!: ReturnType<typeof useDashboardTrends>;
- let setOverview!: (value: DashboardOverviewSummary) => void;
-
- createRoot((d) => {
- dispose = d;
- const [overview, setOverviewSignal] = createSignal(initialOverview);
- setOverview = setOverviewSignal;
- const [range] = createSignal<'1h'>('1h');
- trends = useDashboardTrends(overview, range);
- });
-
- await vi.waitFor(() => {
- expect(vi.mocked(fetchInfrastructureSummaryAndCache)).toHaveBeenCalledTimes(1);
- expect(vi.mocked(fetchStorageSummaryTrendAndCache)).toHaveBeenCalledTimes(1);
- expect(vi.mocked(fetchInfrastructureSummaryAndCache)).toHaveBeenCalledWith('1h', {
- caller: 'useDashboardTrends',
- metrics: ['cpu', 'memory'],
- });
- });
-
- setOverview(expandedOverview);
-
- await Promise.resolve();
- await Promise.resolve();
-
- expect(vi.mocked(fetchInfrastructureSummaryAndCache)).toHaveBeenCalledTimes(1);
- expect(vi.mocked(fetchStorageSummaryTrendAndCache)).toHaveBeenCalledTimes(1);
- expect(Array.from(trends().infrastructure.cpu.keys())).toEqual(['infra-a', 'infra-b']);
-
- dispose();
- });
-
- it('joins dashboard sparkline rankings through canonical metrics targets instead of unified resource ids', async () => {
- const overview = createOverviewSummary({
- health: { totalResources: 2, byStatus: { online: 2 } },
- infrastructure: {
- total: 1,
- byStatus: { online: 1 },
- byType: { agent: 1 },
- topCPU: [
- {
- id: 'agent-a',
- name: 'Infra A',
- percent: 55,
- metricsTarget: { resourceType: 'agent', resourceId: 'infra-a' },
- },
- ],
- topMemory: [
- {
- id: 'agent-a',
- name: 'Infra A',
- percent: 75,
- metricsTarget: { resourceType: 'agent', resourceId: 'infra-a' },
- },
- ],
- },
- });
-
- let dispose!: () => void;
- let trends!: ReturnType<typeof useDashboardTrends>;
-
- createRoot((d) => {
- dispose = d;
- const [summary] = createSignal(overview);
- const [range] = createSignal<'1h'>('1h');
- trends = useDashboardTrends(summary, range);
- });
-
- await vi.waitFor(() => {
- expect(vi.mocked(fetchInfrastructureSummaryAndCache)).toHaveBeenCalledTimes(1);
- });
-
- expect(Array.from(trends().infrastructure.cpu.keys())).toEqual(['agent-a']);
- expect(trends().infrastructure.cpu.get('agent-a')?.points).toEqual(createPoints([20, 30]));
- expect(Array.from(trends().infrastructure.memory.keys())).toEqual(['agent-a']);
- expect(trends().infrastructure.memory.get('agent-a')?.points).toEqual(createPoints([40, 50]));
-
- dispose();
- });
-
- it('refetches infrastructure charts when the dashboard trend range changes without refetching storage charts', async () => {
- const overview = createOverviewSummary({
- health: { totalResources: 2, byStatus: { online: 2 } },
- infrastructure: {
- total: 1,
- byStatus: { online: 1 },
- byType: { agent: 1 },
- topCPU: [{ id: 'infra-a', name: 'Infra A', percent: 55 }],
- topMemory: [{ id: 'infra-a', name: 'Infra A', percent: 75 }],
- },
- storage: {
- total: 1,
- totalCapacity: 1000,
- totalUsed: 500,
- warningCount: 0,
- criticalCount: 0,
- },
- });
-
- let dispose!: () => void;
- let setRange!: (value: '1h' | '12h') => void;
-
- createRoot((d) => {
- dispose = d;
- const [summary] = createSignal(overview);
- const [range, setRangeSignal] = createSignal<'1h' | '12h'>('1h');
- setRange = setRangeSignal;
- useDashboardTrends(summary, range);
- });
-
- await vi.waitFor(() => {
- expect(vi.mocked(fetchInfrastructureSummaryAndCache)).toHaveBeenCalledTimes(1);
- expect(vi.mocked(fetchStorageSummaryTrendAndCache)).toHaveBeenCalledTimes(1);
- expect(vi.mocked(fetchInfrastructureSummaryAndCache)).toHaveBeenCalledWith('1h', {
- caller: 'useDashboardTrends',
- metrics: ['cpu', 'memory'],
- });
- });
-
- setRange('12h');
-
- await vi.waitFor(() => {
- expect(vi.mocked(fetchInfrastructureSummaryAndCache)).toHaveBeenCalledTimes(2);
- });
- expect(vi.mocked(fetchInfrastructureSummaryAndCache)).toHaveBeenLastCalledWith('12h', {
- caller: 'useDashboardTrends',
- metrics: ['cpu', 'memory'],
- });
- expect(vi.mocked(fetchStorageSummaryTrendAndCache)).toHaveBeenCalledTimes(1);
-
- dispose();
- });
-
- it('reuses a fresh infrastructure summary cache instead of immediately refetching the same scope', async () => {
- const overview = createOverviewSummary({
- health: { totalResources: 2, byStatus: { online: 2 } },
- infrastructure: {
- total: 1,
- byStatus: { online: 1 },
- byType: { agent: 1 },
- topCPU: [{ id: 'infra-a', name: 'Infra A', percent: 55 }],
- topMemory: [{ id: 'infra-a', name: 'Infra A', percent: 75 }],
- },
- storage: {
- total: 1,
- totalCapacity: 1000,
- totalUsed: 500,
- warningCount: 0,
- criticalCount: 0,
- },
- });
-
- vi.mocked(readInfrastructureSummaryCache).mockReturnValue({
- map: new Map(),
- oldestDataTimestamp: null,
- cachedAt: Date.now(),
- });
-
- let dispose!: () => void;
-
- createRoot((d) => {
- dispose = d;
- const [summary] = createSignal(overview);
- const [range] = createSignal<'1h'>('1h');
- useDashboardTrends(summary, range);
- });
-
- await Promise.resolve();
- await Promise.resolve();
-
- expect(vi.mocked(fetchInfrastructureSummaryAndCache)).not.toHaveBeenCalled();
- expect(vi.mocked(fetchStorageSummaryTrendAndCache)).toHaveBeenCalledTimes(1);
-
- dispose();
- });
-});
-
-describe('useDashboardTrends infrastructure routing', () => {
- it('routes dashboard infrastructure sparklines through the infrastructure summary chart cache', () => {
- expect(useDashboardTrendsSource).toContain('readInfrastructureSummaryCache');
- expect(useDashboardTrendsSource).toContain('fetchInfrastructureSummaryAndCache');
- expect(useDashboardTrendsSource).toContain("caller: 'useDashboardTrends'");
- expect(useDashboardTrendsSource).toContain('const DASHBOARD_INFRASTRUCTURE_METRICS');
- expect(useDashboardTrendsSource).toContain('metrics: DASHBOARD_INFRASTRUCTURE_METRICS');
- expect(useDashboardTrendsSource).toContain('const infrastructureScopeKey');
- expect(useDashboardTrendsSource).toContain('const hasInfrastructureResources');
- expect(useDashboardTrendsSource).toContain('buildMetricTrendMap');
- expect(useDashboardTrendsSource).not.toContain('buildInfrastructureSummarySeries');
- expect(useDashboardTrendsSource).not.toContain('request.cpu.map(async');
- expect(useDashboardTrendsSource).not.toContain('request.memory.map(async');
- });
-
- it('routes storage trends through the storage summary charts endpoint', () => {
- expect(useDashboardTrendsSource).toContain('readStorageSummaryTrendCache');
- expect(useDashboardTrendsSource).toContain('fetchStorageSummaryTrendAndCache(STORAGE_RANGE');
- expect(useDashboardTrendsSource).toContain('const storageScopeKey');
- expect(useDashboardTrendsSource).toContain('extractTrendData(storageSummary.capacity)');
- expect(useDashboardTrendsSource).not.toContain('/api/storage-charts');
- expect(useDashboardTrendsSource).not.toContain('request.storage.map(async');
- });
-});
diff --git a/frontend-modern/src/hooks/useDashboardActions.ts b/frontend-modern/src/hooks/useDashboardActions.ts
deleted file mode 100644
index 13864a5917..0000000000
--- a/frontend-modern/src/hooks/useDashboardActions.ts
+++ /dev/null
@@ -1,89 +0,0 @@
-import { createMemo, createEffect, onCleanup, type Accessor } from 'solid-js';
-import type { Alert } from '@/types/api';
-import type { UnifiedFinding } from '@/stores/aiIntelligence';
-import { aiIntelligenceStore } from '@/stores/aiIntelligence';
-import type { ApprovalRequest } from '@/api/ai';
-import { hasFeature } from '@/stores/license';
-import { DASHBOARD_PATH } from '@/routing/resourceLinks';
-
-export interface DashboardActions {
- pendingApprovals: Accessor<ApprovalRequest[]>;
- unackedCriticalAlerts: Accessor<Alert[]>;
- findingsNeedingAttention: Accessor<UnifiedFinding[]>;
- hasAnyActions: Accessor<boolean>;
- totalActionCount: Accessor<number>;
-}
-
-interface UseDashboardActionsOptions {
- enabled?: Accessor<boolean>;
-}
-
-const APPROVAL_REFRESH_INTERVAL_MS = 30_000;
-
-export function useDashboardActions(
- alertsList: Accessor<Alert[]>,
- options: UseDashboardActionsOptions = {},
-): DashboardActions {
- const enabled = () =>
- options.enabled?.() ??
- (typeof window === 'undefined' || window.location.pathname === DASHBOARD_PATH);
- const hasPatrol = () => enabled() && hasFeature('ai_patrol');
-
- // Load dashboard action data on mount when the dashboard is active.
- createEffect(() => {
- if (enabled()) {
- void aiIntelligenceStore.loadPendingApprovals();
- }
- if (hasPatrol()) {
- void aiIntelligenceStore.loadFindings();
- }
- });
-
- // Refresh approvals every 30s (they have 5-min expiry)
- let refreshInterval: number | undefined;
- createEffect(() => {
- if (refreshInterval) {
- window.clearInterval(refreshInterval);
- refreshInterval = undefined;
- }
- if (enabled()) {
- refreshInterval = window.setInterval(() => {
- void aiIntelligenceStore.loadPendingApprovals();
- }, APPROVAL_REFRESH_INTERVAL_MS);
- }
- });
- onCleanup(() => {
- if (refreshInterval) window.clearInterval(refreshInterval);
- });
-
- const pendingApprovals = createMemo(() => {
- if (!enabled()) return [];
- return aiIntelligenceStore.pendingApprovals;
- });
-
- const unackedCriticalAlerts = createMemo(() =>
- alertsList().filter((a) => a.level === 'critical' && !a.acknowledged),
- );
-
- const findingsNeedingAttention = createMemo(() => {
- if (!hasPatrol()) return [];
- return aiIntelligenceStore.findingsNeedingAttention;
- });
-
- const totalActionCount = createMemo(
- () =>
- pendingApprovals().length +
- unackedCriticalAlerts().length +
- findingsNeedingAttention().length,
- );
-
- const hasAnyActions = createMemo(() => totalActionCount() > 0);
-
- return {
- pendingApprovals,
- unackedCriticalAlerts,
- findingsNeedingAttention,
- hasAnyActions,
- totalActionCount,
- };
-}
diff --git a/frontend-modern/src/hooks/useDashboardLayout.ts b/frontend-modern/src/hooks/useDashboardLayout.ts
deleted file mode 100644
index d0a69c48f3..0000000000
--- a/frontend-modern/src/hooks/useDashboardLayout.ts
+++ /dev/null
@@ -1,142 +0,0 @@
-import { createMemo } from 'solid-js';
-import { usePersistentSignal } from '@/hooks/usePersistentSignal';
-import {
- DASHBOARD_WIDGETS,
- getDashboardWidget,
- type DashboardWidgetDef,
- type DashboardWidgetId,
-} from '@/features/dashboardOverview/dashboardWidgets';
-
-type DashboardLayoutState = {
- order: DashboardWidgetId[];
- hidden: DashboardWidgetId[];
-};
-
-const DASHBOARD_WIDGET_LAYOUT_STORAGE_KEY = 'dashboardWidgetLayout_v2';
-const DEFAULT_ORDER = [...DASHBOARD_WIDGETS]
- .sort((a, b) => a.defaultOrder - b.defaultOrder)
- .map((widget) => widget.id);
-const DEFAULT_HIDDEN = DASHBOARD_WIDGETS.filter((widget) => !widget.defaultVisible).map(
- (widget) => widget.id,
-);
-const WIDGET_IDS = new Set<DashboardWidgetId>(DASHBOARD_WIDGETS.map((widget) => widget.id));
-const DEFAULT_LAYOUT: DashboardLayoutState = {
- order: [...DEFAULT_ORDER],
- hidden: [...DEFAULT_HIDDEN],
-};
-
-function normalizeLayout(layout: DashboardLayoutState): DashboardLayoutState {
- const order = layout.order.filter((id): id is DashboardWidgetId => WIDGET_IDS.has(id));
- const hidden = layout.hidden.filter((id): id is DashboardWidgetId => WIDGET_IDS.has(id));
-
- for (const id of DEFAULT_ORDER) {
- if (!order.includes(id)) {
- order.push(id);
- }
- }
-
- return { order, hidden };
-}
-
-function parseLayout(raw: string): DashboardLayoutState {
- try {
- const parsed = JSON.parse(raw) as Partial<DashboardLayoutState>;
- if (Array.isArray(parsed.order) && Array.isArray(parsed.hidden)) {
- return normalizeLayout({
- order: parsed.order as DashboardWidgetId[],
- hidden: parsed.hidden as DashboardWidgetId[],
- });
- }
- } catch {
- // Fall through to defaults.
- }
-
- return DEFAULT_LAYOUT;
-}
-
-function arrayEquals<T>(left: T[], right: T[]): boolean {
- if (left.length !== right.length) return false;
- for (let i = 0; i < left.length; i += 1) {
- if (left[i] !== right[i]) return false;
- }
- return true;
-}
-
-export function useDashboardLayout() {
- const [layout, setLayout] = usePersistentSignal<DashboardLayoutState>(
- DASHBOARD_WIDGET_LAYOUT_STORAGE_KEY,
- DEFAULT_LAYOUT,
- {
- serialize: (value) => JSON.stringify(value),
- deserialize: parseLayout,
- },
- );
-
- const visibleWidgets = createMemo<DashboardWidgetDef[]>(() => {
- const hidden = new Set(layout().hidden);
- return layout()
- .order.filter((id) => !hidden.has(id))
- .map((id) => getDashboardWidget(id))
- .filter((widget): widget is DashboardWidgetDef => widget !== undefined);
- });
-
- const allWidgetsOrdered = createMemo<DashboardWidgetDef[]>(() =>
- layout()
- .order.map((id) => getDashboardWidget(id))
- .filter((widget): widget is DashboardWidgetDef => widget !== undefined),
- );
-
- const isHidden = (id: DashboardWidgetId) => layout().hidden.includes(id);
-
- const toggleWidget = (id: DashboardWidgetId) => {
- setLayout((current) => {
- const hidden = current.hidden.includes(id)
- ? current.hidden.filter((entry) => entry !== id)
- : [...current.hidden, id];
- return { ...current, hidden };
- });
- };
-
- const moveUp = (id: DashboardWidgetId) => {
- setLayout((current) => {
- const order = [...current.order];
- const idx = order.indexOf(id);
- if (idx <= 0) return current;
- [order[idx - 1], order[idx]] = [order[idx], order[idx - 1]];
- return { ...current, order };
- });
- };
-
- const moveDown = (id: DashboardWidgetId) => {
- setLayout((current) => {
- const order = [...current.order];
- const idx = order.indexOf(id);
- if (idx < 0 || idx >= order.length - 1) return current;
- [order[idx], order[idx + 1]] = [order[idx + 1], order[idx]];
- return { ...current, order };
- });
- };
-
- const resetToDefaults = () => {
- setLayout({
- order: [...DEFAULT_ORDER],
- hidden: [...DEFAULT_HIDDEN],
- });
- };
-
- const isDefault = createMemo(() => {
- const current = layout();
- return arrayEquals(current.order, DEFAULT_ORDER) && arrayEquals(current.hidden, DEFAULT_HIDDEN);
- });
-
- return {
- visibleWidgets,
- allWidgetsOrdered,
- isHidden,
- toggleWidget,
- moveUp,
- moveDown,
- resetToDefaults,
- isDefault,
- };
-}
diff --git a/frontend-modern/src/hooks/useDashboardOverview.ts b/frontend-modern/src/hooks/useDashboardOverview.ts
deleted file mode 100644
index de655a88d5..0000000000
--- a/frontend-modern/src/hooks/useDashboardOverview.ts
+++ /dev/null
@@ -1,615 +0,0 @@
-import { batch, createEffect, createMemo, createSignal, onCleanup, type Accessor } from 'solid-js';
-import {
- ResourceAPI,
- type DashboardOverviewSummaryProblemResource,
- type DashboardOverviewSummaryResponse,
-} from '@/api/resources';
-import type { Alert } from '@/types/api';
-import type {
- Resource,
- ResourceMetric,
- ResourceMetricsTarget,
- ResourceStatus,
- ResourceType,
-} from '@/types/resource';
-import { isInfrastructure, isStorage, isWorkload } from '@/types/resource';
-import { getOrgID } from '@/utils/apiClient';
-import { METRIC_THRESHOLDS, getMetricSeverity } from '@/utils/metricThresholds';
-import { normalizeOrgScope } from '@/utils/orgScope';
-import { getPreferredResourceDisplayName } from '@/utils/resourceIdentity';
-import { resolvePlatformTypeFromSources, resolveSourceTypeFromSources } from '@/utils/sourcePlatforms';
-import { OFFLINE_HEALTH_STATUSES, DEGRADED_HEALTH_STATUSES } from '@/utils/status';
-import { eventBus } from '@/stores/events';
-import { getGlobalWebSocketStore } from '@/stores/websocket-global';
-
-export interface ProblemResource {
- resource: Resource;
- problems: string[];
- worstValue: number; // 0–100 for metrics, 200 for offline, 150 for degraded
-}
-
-export interface DashboardOverviewSummary {
- health: {
- totalResources: number;
- byStatus: Record<string, number>;
- };
- infrastructure: {
- total: number;
- byStatus: Record<string, number>;
- byType: Record<string, number>;
- topCPU: Array<{ id: string; name: string; percent: number; metricsTarget?: ResourceMetricsTarget }>;
- topMemory: Array<{ id: string; name: string; percent: number; metricsTarget?: ResourceMetricsTarget }>;
- };
- workloads: {
- total: number;
- running: number;
- stopped: number;
- byType: Record<string, number>;
- };
- storage: {
- total: number;
- totalCapacity: number;
- totalUsed: number;
- warningCount: number;
- criticalCount: number;
- };
- problemResources: ProblemResource[];
-}
-
-export interface DashboardOverview extends DashboardOverviewSummary {
- alerts: {
- activeCritical: number;
- activeWarning: number;
- total: number;
- };
- health: DashboardOverviewSummary['health'] & {
- criticalAlerts: number;
- warningAlerts: number;
- };
-}
-
-const RESOURCE_STATUSES: ResourceStatus[] = [
- 'online',
- 'offline',
- 'running',
- 'stopped',
- 'degraded',
- 'paused',
- 'unknown',
-];
-
-const DASHBOARD_OVERVIEW_CACHE_MAX_AGE_MS = 15_000;
-const DASHBOARD_OVERVIEW_WS_DEBOUNCE_MS = 800;
-const DASHBOARD_OVERVIEW_WS_MIN_REFETCH_INTERVAL_MS = 2_500;
-
-type DashboardOverviewCacheEntry = {
- summary: DashboardOverviewSummary;
- hasSnapshot: boolean;
- cachedAt: number;
- lastFetchAt: number;
- sharedFetch: Promise<DashboardOverviewSummary> | null;
-};
-
-const dashboardOverviewCaches = new Map<string, DashboardOverviewCacheEntry>();
-
-function createStatusCounter(): Record<string, number> {
- return RESOURCE_STATUSES.reduce<Record<string, number>>((acc, status) => {
- acc[status] = 0;
- return acc;
- }, {});
-}
-
-function createEmptyDashboardOverviewSummary(): DashboardOverviewSummary {
- return {
- health: {
- totalResources: 0,
- byStatus: createStatusCounter(),
- },
- infrastructure: {
- total: 0,
- byStatus: createStatusCounter(),
- byType: {},
- topCPU: [],
- topMemory: [],
- },
- workloads: {
- total: 0,
- running: 0,
- stopped: 0,
- byType: {},
- },
- storage: {
- total: 0,
- totalCapacity: 0,
- totalUsed: 0,
- warningCount: 0,
- criticalCount: 0,
- },
- problemResources: [],
- };
-}
-
-function incrementCount(counter: Record<string, number>, key: string): void {
- counter[key] = (counter[key] ?? 0) + 1;
-}
-
-function getMetricPercent(metric?: ResourceMetric): number | null {
- if (!metric) return null;
-
- if (
- typeof metric.total === 'number' &&
- typeof metric.used === 'number' &&
- Number.isFinite(metric.total) &&
- Number.isFinite(metric.used) &&
- metric.total > 0
- ) {
- return (metric.used / metric.total) * 100;
- }
-
- if (typeof metric.current === 'number' && Number.isFinite(metric.current)) {
- return metric.current;
- }
-
- return null;
-}
-
-function buildTopInfrastructureMetrics(
- resources: Resource[],
- metric: 'cpu' | 'memory',
-): Array<{ id: string; name: string; percent: number }> {
- const rows = resources
- .map((resource) => {
- const percent =
- metric === 'cpu' ? getMetricPercent(resource.cpu) : getMetricPercent(resource.memory);
- if (percent === null) return null;
-
- return {
- id: resource.id,
- name: getPreferredResourceDisplayName(resource),
- percent,
- };
- })
- .filter((row): row is { id: string; name: string; percent: number } => row !== null);
-
- rows.sort((a, b) => b.percent - a.percent);
- return rows.slice(0, 5);
-}
-
-function buildProblemResources(resources: Resource[]): ProblemResource[] {
- const results: ProblemResource[] = [];
-
- for (const resource of resources) {
- const problems: string[] = [];
- let worstValue = 0;
-
- const status = resource.status;
- if (OFFLINE_HEALTH_STATUSES.has(status)) {
- problems.push('Offline');
- worstValue = 200;
- } else if (DEGRADED_HEALTH_STATUSES.has(status)) {
- problems.push('Degraded');
- worstValue = Math.max(worstValue, 150);
- }
-
- const cpuPercent = getMetricPercent(resource.cpu);
- if (cpuPercent !== null && getMetricSeverity(cpuPercent, 'cpu') === 'critical') {
- problems.push(`CPU ${Math.round(cpuPercent)}%`);
- worstValue = Math.max(worstValue, cpuPercent);
- }
-
- const memPercent = getMetricPercent(resource.memory);
- if (memPercent !== null && getMetricSeverity(memPercent, 'memory') === 'critical') {
- problems.push(`Memory ${Math.round(memPercent)}%`);
- worstValue = Math.max(worstValue, memPercent);
- }
-
- const diskPercent = getMetricPercent(resource.disk);
- if (diskPercent !== null && getMetricSeverity(diskPercent, 'disk') === 'critical') {
- problems.push(`Disk ${Math.round(diskPercent)}%`);
- worstValue = Math.max(worstValue, diskPercent);
- }
-
- if (problems.length > 0) {
- results.push({ resource, problems, worstValue });
- }
- }
-
- results.sort((a, b) => b.worstValue - a.worstValue);
- return results.slice(0, 8);
-}
-
-function countAlerts(alerts: Alert[]) {
- return alerts.reduce(
- (acc, alert) => {
- if (alert.level === 'critical') acc.critical += 1;
- if (alert.level === 'warning') acc.warning += 1;
- return acc;
- },
- { critical: 0, warning: 0 },
- );
-}
-
-function mergeDashboardAlertCounts(
- summary: DashboardOverviewSummary,
- alerts: Alert[],
-): DashboardOverview {
- const alertCounts = countAlerts(alerts);
- return {
- ...summary,
- health: {
- ...summary.health,
- criticalAlerts: alertCounts.critical,
- warningAlerts: alertCounts.warning,
- },
- alerts: {
- activeCritical: alertCounts.critical,
- activeWarning: alertCounts.warning,
- total: alerts.length,
- },
- };
-}
-
-function hasFreshDashboardOverviewCache(entry: DashboardOverviewCacheEntry) {
- return entry.hasSnapshot && Date.now() - entry.cachedAt <= DASHBOARD_OVERVIEW_CACHE_MAX_AGE_MS;
-}
-
-function setDashboardOverviewCache(
- entry: DashboardOverviewCacheEntry,
- summary: DashboardOverviewSummary,
- at = Date.now(),
-) {
- entry.summary = summary;
- entry.hasSnapshot = true;
- entry.cachedAt = at;
-}
-
-function getDashboardOverviewCacheEntry(cacheKey: string): DashboardOverviewCacheEntry {
- const existing = dashboardOverviewCaches.get(cacheKey);
- if (existing) {
- return existing;
- }
-
- const created: DashboardOverviewCacheEntry = {
- summary: createEmptyDashboardOverviewSummary(),
- hasSnapshot: false,
- cachedAt: 0,
- lastFetchAt: 0,
- sharedFetch: null,
- };
- dashboardOverviewCaches.set(cacheKey, created);
- return created;
-}
-
-function toSummaryProblemResource(
- problem: DashboardOverviewSummaryProblemResource,
-): ProblemResource {
- const sources = (problem.sources ?? []).filter(
- (source): source is string => typeof source === 'string' && source.trim().length > 0,
- );
- const lastSeen = problem.lastSeen ? Date.parse(problem.lastSeen) : NaN;
- const canonical = problem.canonicalIdentity;
- const displayName = canonical?.displayName?.trim() || problem.name?.trim() || problem.id;
-
- return {
- resource: {
- id: problem.id,
- type: problem.type as ResourceType,
- name: displayName,
- displayName,
- platformId: canonical?.platformId?.trim() || problem.id,
- platformType: resolvePlatformTypeFromSources(sources) || 'agent',
- sourceType: resolveSourceTypeFromSources(sources),
- status: (problem.status?.trim().toLowerCase() || 'unknown') as ResourceStatus,
- lastSeen: Number.isFinite(lastSeen) ? lastSeen : 0,
- canonicalIdentity: canonical,
- policy: problem.policy,
- aiSafeSummary: problem.aiSafeSummary,
- },
- problems: Array.isArray(problem.problems) ? problem.problems : [],
- worstValue: Number.isFinite(problem.worstValue) ? problem.worstValue : 0,
- };
-}
-
-function normalizeSummaryResponse(
- response: DashboardOverviewSummaryResponse,
-): DashboardOverviewSummary {
- const empty = createEmptyDashboardOverviewSummary();
- const healthByStatus = createStatusCounter();
- const infrastructureByStatus = createStatusCounter();
-
- for (const [status, count] of Object.entries(response.health?.byStatus ?? {})) {
- healthByStatus[status] = Number.isFinite(count) ? count : 0;
- }
- for (const [status, count] of Object.entries(response.infrastructure?.byStatus ?? {})) {
- infrastructureByStatus[status] = Number.isFinite(count) ? count : 0;
- }
-
- return {
- health: {
- totalResources: response.health?.totalResources ?? 0,
- byStatus: healthByStatus,
- },
- infrastructure: {
- total: response.infrastructure?.total ?? 0,
- byStatus: infrastructureByStatus,
- byType: { ...(response.infrastructure?.byType ?? {}) },
- topCPU: Array.isArray(response.infrastructure?.topCPU) ? response.infrastructure.topCPU : [],
- topMemory: Array.isArray(response.infrastructure?.topMemory)
- ? response.infrastructure.topMemory
- : [],
- },
- workloads: {
- total: response.workloads?.total ?? 0,
- running: response.workloads?.running ?? 0,
- stopped: response.workloads?.stopped ?? 0,
- byType: { ...(response.workloads?.byType ?? {}) },
- },
- storage: {
- total: response.storage?.total ?? 0,
- totalCapacity: response.storage?.totalCapacity ?? 0,
- totalUsed: response.storage?.totalUsed ?? 0,
- warningCount: response.storage?.warningCount ?? 0,
- criticalCount: response.storage?.criticalCount ?? 0,
- },
- problemResources: Array.isArray(response.problemResources)
- ? response.problemResources.map(toSummaryProblemResource)
- : empty.problemResources,
- };
-}
-
-async function fetchDashboardOverviewSummary(entry: DashboardOverviewCacheEntry, force = false) {
- if (!force && hasFreshDashboardOverviewCache(entry)) {
- return entry.summary;
- }
- if (entry.sharedFetch) {
- return entry.sharedFetch;
- }
-
- const request = (async () => {
- const response = await ResourceAPI.getDashboardSummary();
- const summary = normalizeSummaryResponse(response);
- const now = Date.now();
- setDashboardOverviewCache(entry, summary, now);
- entry.lastFetchAt = now;
- return summary;
- })();
-
- entry.sharedFetch = request;
- try {
- return await request;
- } finally {
- if (entry.sharedFetch === request) {
- entry.sharedFetch = null;
- }
- }
-}
-
-const shouldThrottleWsRefetch = (entry: DashboardOverviewCacheEntry) =>
- Date.now() - entry.lastFetchAt < DASHBOARD_OVERVIEW_WS_MIN_REFETCH_INTERVAL_MS;
-
-export function computeDashboardOverviewSummary(resources: Resource[]): DashboardOverviewSummary {
- const healthByStatus = createStatusCounter();
- const infrastructureByStatus = createStatusCounter();
- const infrastructureByType: Record<string, number> = {};
- const workloadsByType: Record<string, number> = {};
-
- const infrastructureResources: Resource[] = [];
-
- let workloadsRunning = 0;
- let workloadsStopped = 0;
- let storageTotal = 0;
- let storageTotalCapacity = 0;
- let storageTotalUsed = 0;
- let storageWarningCount = 0;
- let storageCriticalCount = 0;
-
- resources.forEach((resource) => {
- incrementCount(healthByStatus, resource.status);
-
- if (isInfrastructure(resource)) {
- infrastructureResources.push(resource);
- incrementCount(infrastructureByStatus, resource.status);
- incrementCount(infrastructureByType, resource.type);
- }
-
- if (isWorkload(resource)) {
- incrementCount(workloadsByType, resource.type);
- if (resource.status === 'online' || resource.status === 'running') {
- workloadsRunning += 1;
- }
- if (resource.status === 'offline' || resource.status === 'stopped') {
- workloadsStopped += 1;
- }
- }
-
- if (isStorage(resource)) {
- storageTotal += 1;
-
- if (typeof resource.disk?.total === 'number' && Number.isFinite(resource.disk.total)) {
- storageTotalCapacity += resource.disk.total;
- }
- if (typeof resource.disk?.used === 'number' && Number.isFinite(resource.disk.used)) {
- storageTotalUsed += resource.disk.used;
- }
-
- const diskPercent = getMetricPercent(resource.disk);
- if (diskPercent !== null) {
- if (diskPercent > METRIC_THRESHOLDS.disk.critical) {
- storageCriticalCount += 1;
- } else if (diskPercent > METRIC_THRESHOLDS.disk.warning) {
- storageWarningCount += 1;
- }
- }
- }
- });
-
- return {
- health: {
- totalResources: resources.length,
- byStatus: healthByStatus,
- },
- infrastructure: {
- total: infrastructureResources.length,
- byStatus: infrastructureByStatus,
- byType: infrastructureByType,
- topCPU: buildTopInfrastructureMetrics(infrastructureResources, 'cpu'),
- topMemory: buildTopInfrastructureMetrics(infrastructureResources, 'memory'),
- },
- workloads: {
- total: Object.values(workloadsByType).reduce((sum, count) => sum + count, 0),
- running: workloadsRunning,
- stopped: workloadsStopped,
- byType: workloadsByType,
- },
- storage: {
- total: storageTotal,
- totalCapacity: storageTotalCapacity,
- totalUsed: storageTotalUsed,
- warningCount: storageWarningCount,
- criticalCount: storageCriticalCount,
- },
- problemResources: buildProblemResources(resources),
- };
-}
-
-export function computeDashboardOverview(
- resources: Resource[],
- activeAlerts: Alert[],
-): DashboardOverview {
- return mergeDashboardAlertCounts(computeDashboardOverviewSummary(resources), activeAlerts);
-}
-
-export function useDashboardOverview(alerts: Accessor<Alert[]>) {
- const [orgScope, setOrgScope] = createSignal(normalizeOrgScope(getOrgID()));
- const resolveScopedCacheKey = () => `dashboard-overview:${orgScope()}`;
- let cacheEntry = getDashboardOverviewCacheEntry(resolveScopedCacheKey());
- const [summary, setSummary] = createSignal<DashboardOverviewSummary>(cacheEntry.summary);
- const [loading, setLoading] = createSignal(!cacheEntry.hasSnapshot);
- const [error, setError] = createSignal<unknown>(undefined);
- const wsStore = getGlobalWebSocketStore();
- let refreshHandle: ReturnType<typeof setTimeout> | undefined;
- let wsInitialized = false;
- let lastWsUpdateToken = '';
- let scopeVersion = 0;
-
- const runRefetch = async (options?: { force?: boolean; source?: 'initial' | 'ws' | 'manual' }) => {
- const force = options?.force === true;
- const source = options?.source ?? 'manual';
-
- if (!force && source === 'ws' && shouldThrottleWsRefetch(cacheEntry)) {
- return summary();
- }
-
- const shouldShowLoading = force || !cacheEntry.hasSnapshot;
- if (shouldShowLoading) {
- setLoading(true);
- }
-
- const requestVersion = scopeVersion;
- const entryForRequest = cacheEntry;
- try {
- const fetched = await fetchDashboardOverviewSummary(entryForRequest, force);
- if (requestVersion !== scopeVersion || entryForRequest !== cacheEntry) {
- return summary();
- }
- batch(() => {
- setSummary(fetched);
- setError(undefined);
- });
- return fetched;
- } catch (err) {
- setError(err);
- throw err;
- } finally {
- if (shouldShowLoading) {
- setLoading(false);
- }
- }
- };
-
- const refetch = async () => runRefetch({ force: true, source: 'manual' });
-
- if (!hasFreshDashboardOverviewCache(cacheEntry)) {
- void runRefetch({ source: 'initial' }).catch(() => undefined);
- }
-
- const scheduleRefetch = () => {
- if (refreshHandle !== undefined) {
- clearTimeout(refreshHandle);
- }
-
- const elapsedSinceFetch = Date.now() - cacheEntry.lastFetchAt;
- const minIntervalDelay = Math.max(
- 0,
- DASHBOARD_OVERVIEW_WS_MIN_REFETCH_INTERVAL_MS - elapsedSinceFetch,
- );
- const delay = Math.max(DASHBOARD_OVERVIEW_WS_DEBOUNCE_MS, minIntervalDelay);
-
- refreshHandle = setTimeout(() => {
- refreshHandle = undefined;
- void runRefetch({ source: 'ws' }).catch(() => undefined);
- }, delay);
- };
-
- createEffect(() => {
- orgScope();
-
- if (!wsStore.connected() || !wsStore.initialDataReceived()) {
- wsInitialized = false;
- lastWsUpdateToken = '';
- return;
- }
-
- const lastUpdateToken = String(wsStore.state.lastUpdate ?? '');
- if (!wsInitialized) {
- wsInitialized = true;
- lastWsUpdateToken = lastUpdateToken;
- return;
- }
- if (lastUpdateToken === lastWsUpdateToken) {
- return;
- }
-
- lastWsUpdateToken = lastUpdateToken;
- scheduleRefetch();
- });
-
- const unsubscribeOrgSwitch = eventBus.on('org_switched', (nextOrgID?: string) => {
- const nextOrgScope = normalizeOrgScope(nextOrgID);
- if (nextOrgScope === orgScope()) {
- return;
- }
-
- scopeVersion += 1;
- setOrgScope(nextOrgScope);
- cacheEntry = getDashboardOverviewCacheEntry(resolveScopedCacheKey());
- wsInitialized = false;
- lastWsUpdateToken = '';
-
- batch(() => {
- setSummary(cacheEntry.summary);
- setLoading(!cacheEntry.hasSnapshot);
- setError(undefined);
- });
-
- if (!hasFreshDashboardOverviewCache(cacheEntry)) {
- void runRefetch({ force: true, source: 'initial' }).catch(() => undefined);
- }
- });
-
- onCleanup(() => {
- unsubscribeOrgSwitch();
- if (refreshHandle !== undefined) {
- clearTimeout(refreshHandle);
- }
- });
-
- const overview = createMemo(() => mergeDashboardAlertCounts(summary(), alerts()));
-
- return {
- overview,
- loading,
- error,
- refetch,
- };
-}
diff --git a/frontend-modern/src/hooks/useDashboardRecovery.ts b/frontend-modern/src/hooks/useDashboardRecovery.ts
deleted file mode 100644
index 8229456920..0000000000
--- a/frontend-modern/src/hooks/useDashboardRecovery.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { createMemo } from 'solid-js';
-import { useRecoveryRollups } from '@/hooks/useRecoveryRollups';
-import type { ProtectionRollup, RecoveryOutcome } from '@/types/recovery';
-import { normalizeRecoveryOutcome } from '@/utils/recoveryOutcomePresentation';
-
-export interface DashboardRecoverySummary {
- totalProtected: number;
- byOutcome: Partial<Record<RecoveryOutcome, number>>;
- latestEventTimestamp: number | null;
- hasData: boolean;
-}
-
-const parseTimestamp = (value: string | null | undefined): number | null => {
- const parsed = Date.parse(String(value || ''));
- if (!Number.isFinite(parsed) || parsed <= 0) return null;
- return parsed;
-};
-
-export function useDashboardRecovery() {
- const rollups = useRecoveryRollups();
-
- return createMemo<DashboardRecoverySummary>(() => {
- const data: ProtectionRollup[] = rollups.rollups() || [];
-
- if (data.length === 0) {
- return { totalProtected: 0, byOutcome: {}, latestEventTimestamp: null, hasData: false };
- }
-
- const byOutcome: Partial<Record<RecoveryOutcome, number>> = {};
- let latestTimestamp: number | null = null;
-
- for (const rollup of data) {
- const outcome = normalizeRecoveryOutcome(rollup.lastOutcome);
- byOutcome[outcome] = (byOutcome[outcome] ?? 0) + 1;
-
- const ts = parseTimestamp(rollup.lastAttemptAt || null);
- if (ts !== null) {
- if (latestTimestamp === null || ts > latestTimestamp) {
- latestTimestamp = ts;
- }
- }
- }
-
- return {
- totalProtected: data.length,
- byOutcome,
- latestEventTimestamp: latestTimestamp,
- hasData: true,
- };
- });
-}
diff --git a/frontend-modern/src/hooks/useDashboardTrends.ts b/frontend-modern/src/hooks/useDashboardTrends.ts
deleted file mode 100644
index 1cacdeb4f4..0000000000
--- a/frontend-modern/src/hooks/useDashboardTrends.ts
+++ /dev/null
@@ -1,429 +0,0 @@
-import { createEffect, createMemo, createSignal, onCleanup, type Accessor } from 'solid-js';
-import {
- type ChartData,
- type HistoryTimeRange,
- type InfrastructureSummaryMetric,
- type StorageSummaryTrendResponse,
- type TimeRange,
-} from '@/api/charts';
-import { buildInfrastructureEmptyHistoryLabel } from '@/components/Infrastructure/infrastructureSummaryModel';
-import type { DashboardOverviewSummary } from '@/hooks/useDashboardOverview';
-import { eventBus } from '@/stores/events';
-import { getOrgID } from '@/utils/apiClient';
-import {
- fetchInfrastructureSummaryAndCache,
- readInfrastructureSummaryCache,
-} from '@/utils/infrastructureSummaryCache';
-import { normalizeOrgScope } from '@/utils/orgScope';
-import {
- fetchStorageSummaryTrendAndCache,
- readStorageSummaryTrendCache,
-} from '@/utils/storageSummaryTrendCache';
-
-export type TrendPoint = {
- timestamp: number;
- value: number;
-};
-
-export type TrendData = {
- points: TrendPoint[];
- delta: number | null;
- currentValue: number | null;
-};
-
-export interface DashboardTrends {
- infrastructure: {
- cpu: Map<string, TrendData>;
- memory: Map<string, TrendData>;
- emptyMessage: string | null;
- };
- storage: {
- capacity: TrendData | null;
- };
- loading: boolean;
- error: string | null;
-}
-
-const INFRASTRUCTURE_RANGE: HistoryTimeRange = '1h';
-const STORAGE_RANGE: TimeRange = '24h';
-const DASHBOARD_INFRASTRUCTURE_METRICS: InfrastructureSummaryMetric[] = ['cpu', 'memory'];
-
-function createEmptyTrendData(): TrendData {
- return {
- points: [],
- delta: null,
- currentValue: null,
- };
-}
-
-function createEmptyInfrastructureTrends(): DashboardTrends['infrastructure'] {
- return {
- cpu: new Map<string, TrendData>(),
- memory: new Map<string, TrendData>(),
- emptyMessage: null,
- };
-}
-
-function createEmptyStorageTrends(): DashboardTrends['storage'] {
- return {
- capacity: null,
- };
-}
-
-function toErrorMessage(error: unknown): string {
- if (error instanceof Error && error.message.trim().length > 0) {
- return error.message;
- }
- return 'Failed to load dashboard trends';
-}
-
-function normalizeTrendPoints(points: Array<{ timestamp: number; value: number }>): TrendPoint[] {
- const normalized = points.filter(
- (point) => Number.isFinite(point.timestamp) && Number.isFinite(point.value),
- );
- normalized.sort((a, b) => a.timestamp - b.timestamp);
- return normalized;
-}
-
-function averagePoints(points: TrendPoint[]): number {
- if (points.length === 0) return 0;
- return points.reduce((sum, point) => sum + point.value, 0) / points.length;
-}
-
-function toInfrastructureSummaryRange(range: HistoryTimeRange): TimeRange {
- switch (range) {
- case '1h':
- return '1h';
- case '6h':
- case '12h':
- return '12h';
- case '24h':
- return '24h';
- case '7d':
- return '7d';
- case '30d':
- case '90d':
- return '30d';
- default:
- return '1h';
- }
-}
-
-type DashboardTrendResourceRef = DashboardOverviewSummary['infrastructure']['topCPU'][number];
-
-function buildMetricTrendMap(
- resources: DashboardTrendResourceRef[],
- map: Map<string, ChartData>,
- metric: 'cpu' | 'memory',
-): Map<string, TrendData> {
- const result = new Map<string, TrendData>();
-
- for (const resource of resources.slice(0, 5)) {
- const historyKey = resource.metricsTarget?.resourceId || resource.id;
- const history = map.get(historyKey);
- if (!history) {
- continue;
- }
-
- const points = metric === 'cpu' ? history.cpu ?? [] : history.memory ?? [];
- result.set(resource.id, extractTrendData(points));
- }
-
- return result;
-}
-
-function buildInfrastructureTrendSnapshot(
- overview: DashboardOverviewSummary,
- map: Map<string, ChartData>,
- oldestDataTimestamp: number | null,
-): DashboardTrends['infrastructure'] {
- if (overview.infrastructure.total === 0) {
- return createEmptyInfrastructureTrends();
- }
-
- const cpu = buildMetricTrendMap(overview.infrastructure.topCPU, map, 'cpu');
- const memory = buildMetricTrendMap(overview.infrastructure.topMemory, map, 'memory');
- const hasRenderableHistory = [...cpu.values(), ...memory.values()].some(
- (trend) => trend.points.length >= 2,
- );
-
- return {
- cpu,
- memory,
- emptyMessage: hasRenderableHistory
- ? null
- : buildInfrastructureEmptyHistoryLabel(oldestDataTimestamp === null),
- };
-}
-
-export function buildStorageCapacityTrendPoints(
- pools: Record<
- string,
- {
- name?: string;
- usage?: TrendPoint[];
- used?: TrendPoint[];
- avail?: TrendPoint[];
- }
- >,
-): TrendPoint[] {
- const buckets = new Map<
- number,
- { used: number; avail: number; hasUsed: boolean; hasAvail: boolean }
- >();
-
- for (const pool of Object.values(pools)) {
- for (const point of pool.used ?? []) {
- if (!Number.isFinite(point.timestamp) || !Number.isFinite(point.value)) {
- continue;
- }
- const bucket = buckets.get(point.timestamp) ?? {
- used: 0,
- avail: 0,
- hasUsed: false,
- hasAvail: false,
- };
- bucket.used += point.value;
- bucket.hasUsed = true;
- buckets.set(point.timestamp, bucket);
- }
- for (const point of pool.avail ?? []) {
- if (!Number.isFinite(point.timestamp) || !Number.isFinite(point.value)) {
- continue;
- }
- const bucket = buckets.get(point.timestamp) ?? {
- used: 0,
- avail: 0,
- hasUsed: false,
- hasAvail: false,
- };
- bucket.avail += point.value;
- bucket.hasAvail = true;
- buckets.set(point.timestamp, bucket);
- }
- }
-
- return Array.from(buckets.entries())
- .sort((a, b) => a[0] - b[0])
- .flatMap(([timestamp, bucket]) => {
- if (!bucket.hasUsed || !bucket.hasAvail) {
- return [];
- }
- const total = bucket.used + bucket.avail;
- if (!Number.isFinite(total) || total <= 0) {
- return [];
- }
- return [
- {
- timestamp,
- value: (bucket.used / total) * 100,
- },
- ];
- });
-}
-
-export function computeTrendDelta(points: TrendPoint[]): number | null {
- if (points.length < 2) return null;
-
- const quarterSize = Math.max(1, Math.floor(points.length * 0.25));
- const firstQuarter = points.slice(0, quarterSize);
- const lastQuarter = points.slice(points.length - quarterSize);
-
- const firstAverage = averagePoints(firstQuarter);
- const lastAverage = averagePoints(lastQuarter);
-
- if (firstAverage === 0) {
- return lastAverage === 0 ? 0 : null;
- }
-
- const delta = ((lastAverage - firstAverage) / firstAverage) * 100;
- return Number.isFinite(delta) ? delta : null;
-}
-
-export function extractTrendData(points: Array<{ timestamp: number; value: number }>): TrendData {
- const normalized = normalizeTrendPoints(points);
- if (normalized.length < 2) {
- return createEmptyTrendData();
- }
-
- return {
- points: normalized,
- delta: computeTrendDelta(normalized),
- currentValue: normalized[normalized.length - 1]?.value ?? null,
- };
-}
-
-function buildStorageTrendSnapshot(
- storageSummary: StorageSummaryTrendResponse | null,
-): DashboardTrends['storage'] {
- if (!storageSummary) {
- return createEmptyStorageTrends();
- }
- return {
- capacity: extractTrendData(storageSummary.capacity),
- };
-}
-
-export function useDashboardTrends(
- overview: Accessor<DashboardOverviewSummary>,
- infrastructureRange?: Accessor<HistoryTimeRange>,
-): Accessor<DashboardTrends> {
- const [infrastructureError, setInfrastructureError] = createSignal<string | null>(null);
- const [storageError, setStorageError] = createSignal<string | null>(null);
- const [infrastructureCharts, setInfrastructureCharts] = createSignal<Map<string, ChartData>>(
- new Map(),
- );
- const [oldestDataTimestamp, setOldestDataTimestamp] = createSignal<number | null>(null);
- const [storageSummary, setStorageSummary] = createSignal<StorageSummaryTrendResponse | null>(
- null,
- );
- const [infrastructureLoading, setInfrastructureLoading] = createSignal(false);
- const [storageLoading, setStorageLoading] = createSignal(false);
- const [orgVersion, setOrgVersion] = createSignal(0);
-
- const unsubscribeOrgSwitch = eventBus.on('org_switched', () => {
- setOrgVersion((value) => value + 1);
- });
-
- onCleanup(() => {
- unsubscribeOrgSwitch();
- });
-
- const hasInfrastructureResources = createMemo(() =>
- overview().infrastructure.total > 0,
- );
- const hasStorageResources = createMemo(() => overview().storage.total > 0);
-
- const infrastructureScopeKey = createMemo(() => {
- const version = orgVersion();
- const orgScope = normalizeOrgScope(getOrgID());
- const range = infrastructureRange ? infrastructureRange() : INFRASTRUCTURE_RANGE;
- return JSON.stringify({
- orgScope,
- version,
- hasInfrastructure: hasInfrastructureResources(),
- infrastructureRange: range,
- });
- });
-
- const storageScopeKey = createMemo(() => {
- const version = orgVersion();
- const orgScope = normalizeOrgScope(getOrgID());
- return JSON.stringify({
- orgScope,
- version,
- hasStorage: hasStorageResources(),
- storageRange: STORAGE_RANGE,
- });
- });
-
- let latestInfrastructureRequestId = 0;
- let latestStorageRequestId = 0;
-
- createEffect(() => {
- infrastructureScopeKey();
- const range = infrastructureRange ? infrastructureRange() : INFRASTRUCTURE_RANGE;
- const summaryRange = toInfrastructureSummaryRange(range);
-
- if (!hasInfrastructureResources()) {
- setInfrastructureCharts(new Map());
- setOldestDataTimestamp(null);
- setInfrastructureError(null);
- setInfrastructureLoading(false);
- return;
- }
-
- const cached = readInfrastructureSummaryCache(
- summaryRange,
- undefined,
- undefined,
- DASHBOARD_INFRASTRUCTURE_METRICS,
- );
- if (cached) {
- setInfrastructureCharts(cached.map);
- setOldestDataTimestamp(cached.oldestDataTimestamp);
- setInfrastructureError(null);
- setInfrastructureLoading(false);
- return;
- }
-
- const requestId = ++latestInfrastructureRequestId;
- setInfrastructureLoading(true);
-
- fetchInfrastructureSummaryAndCache(summaryRange, {
- caller: 'useDashboardTrends',
- metrics: DASHBOARD_INFRASTRUCTURE_METRICS,
- })
- .then((result) => {
- if (requestId !== latestInfrastructureRequestId) return;
- setInfrastructureCharts(result.map);
- setOldestDataTimestamp(result.oldestDataTimestamp);
- setInfrastructureError(null);
- })
- .catch((err) => {
- if (requestId !== latestInfrastructureRequestId) return;
- if (!cached) {
- setInfrastructureCharts(new Map());
- setOldestDataTimestamp(null);
- }
- setInfrastructureError(toErrorMessage(err));
- })
- .finally(() => {
- if (requestId === latestInfrastructureRequestId) {
- setInfrastructureLoading(false);
- }
- });
- });
-
- createEffect(() => {
- storageScopeKey();
-
- if (!hasStorageResources()) {
- setStorageSummary(null);
- setStorageError(null);
- setStorageLoading(false);
- return;
- }
-
- const cached = readStorageSummaryTrendCache(STORAGE_RANGE);
- if (cached) {
- setStorageSummary(cached);
- }
-
- const requestId = ++latestStorageRequestId;
- setStorageLoading(true);
-
- fetchStorageSummaryTrendAndCache(STORAGE_RANGE, { caller: 'useDashboardTrends' })
- .then((result) => {
- if (requestId !== latestStorageRequestId) return;
- setStorageSummary(result);
- setStorageError(null);
- })
- .catch((err) => {
- if (requestId !== latestStorageRequestId) return;
- if (!cached) {
- setStorageSummary(null);
- }
- setStorageError(toErrorMessage(err));
- })
- .finally(() => {
- if (requestId === latestStorageRequestId) {
- setStorageLoading(false);
- }
- });
- });
-
- const infrastructureSnapshot = createMemo(() =>
- buildInfrastructureTrendSnapshot(overview(), infrastructureCharts(), oldestDataTimestamp()),
- );
- const storageSnapshot = createMemo(() => buildStorageTrendSnapshot(storageSummary()));
-
- return createMemo<DashboardTrends>(() => {
- return {
- infrastructure: infrastructureSnapshot(),
- storage: storageSnapshot(),
- loading: infrastructureLoading() || storageLoading(),
- error: infrastructureError() ?? storageError(),
- };
- });
-}
diff --git a/frontend-modern/src/index.tsx b/frontend-modern/src/index.tsx
index 73cbd4e5c7..b8ac0b322c 100644
--- a/frontend-modern/src/index.tsx
+++ b/frontend-modern/src/index.tsx
@@ -12,7 +12,7 @@ if (import.meta.env.DEV && !(root instanceof HTMLElement)) {
);
}
-logger.info('Pulse monitoring dashboard starting');
+logger.info('Pulse monitoring workspace starting');
if (root) {
logger.debug('[Index] Root element found, rendering App...');
diff --git a/frontend-modern/src/pages/Dashboard.tsx b/frontend-modern/src/pages/Dashboard.tsx
deleted file mode 100644
index fbeaf7c842..0000000000
--- a/frontend-modern/src/pages/Dashboard.tsx
+++ /dev/null
@@ -1,473 +0,0 @@
-import {
- For,
- Match,
- Show,
- Switch,
- createEffect,
- createMemo,
- createSignal,
- onCleanup,
-} from 'solid-js';
-import { useNavigate } from '@solidjs/router';
-import { useWebSocket } from '@/contexts/appRuntime';
-import { buildInfrastructureOnboardingPath } from '@/components/Settings/infrastructureWorkspaceModel';
-import { PageHeader } from '@/components/shared/PageHeader';
-import { useDashboardOverview } from '@/hooks/useDashboardOverview';
-import { useDashboardTrends } from '@/hooks/useDashboardTrends';
-import { useDashboardLayout } from '@/hooks/useDashboardLayout';
-import { useDashboardActions } from '@/hooks/useDashboardActions';
-import { useDashboardRecovery } from '@/hooks/useDashboardRecovery';
-import {
- getDashboardDisconnectedBannerState,
- getDashboardNoResourcesState,
- getDashboardUnavailableState,
-} from '@/utils/dashboardEmptyStatePresentation';
-import type { HistoryTimeRange } from '@/api/charts';
-import type { Alert } from '@/types/api';
-import {
- ActionRequiredPanel,
- DashboardCustomizer,
- EstateSummaryPanel,
- KPIStrip,
- ProblemResourcesTable,
- PulseBriefPanel,
- TrendCharts,
- useDashboardPulseBrief,
-} from '@/features/dashboardOverview';
-import { buildDashboardEstateSummary } from '@/features/dashboardOverview/estateSummaryModel';
-import {
- DASHBOARD_ALERTS_SECTION_ID,
- DASHBOARD_PROBLEM_RESOURCES_SECTION_ID,
-} from '@/features/dashboardOverview/dashboardSectionIds';
-import { aiChatStore } from '@/stores/aiChat';
-import { RecentAlertsPanel } from '@/components/Alerts/RecentAlertsPanel';
-import { DashboardRecoveryStatusPanel } from '@/components/Recovery/DashboardRecoveryStatusPanel';
-import { DashboardStoragePanel } from '@/components/Storage/DashboardStoragePanel';
-import type {
- DashboardWidgetDef,
- DashboardWidgetId,
-} from '@/features/dashboardOverview/dashboardWidgets';
-
-export default function Dashboard() {
- const navigate = useNavigate();
- const ws = useWebSocket();
- const { connected, reconnecting, reconnect, activeAlerts } = ws;
-
- const alertsList = createMemo<Alert[]>(() =>
- Object.values(activeAlerts as Record<string, Alert | undefined>).filter(
- (a): a is Alert => a !== undefined,
- ),
- );
-
- const overviewState = useDashboardOverview(alertsList);
- const overview = overviewState.overview;
- const [trendRange, setTrendRange] = createSignal<HistoryTimeRange>('1h');
- const trends = useDashboardTrends(overview, trendRange);
- const layout = useDashboardLayout();
- const actions = useDashboardActions(alertsList);
- const recoverySummary = useDashboardRecovery();
- const connectedInfrastructure = createMemo(() =>
- Array.isArray(ws.state.connectedInfrastructure) ? ws.state.connectedInfrastructure : [],
- );
- const estateSummary = createMemo(() =>
- buildDashboardEstateSummary(connectedInfrastructure(), {
- total: overview().infrastructure.total,
- online: overview().infrastructure.byStatus.online ?? 0,
- }),
- );
-
- // Loading timeout: if REST fetch takes >30s, treat as connection error.
- const [loadingTimedOut, setLoadingTimedOut] = createSignal(false);
- let loadingTimeout: number | undefined;
-
- const isLoading = createMemo(() => overviewState.loading());
-
- // Track whether we've completed the initial load successfully so that subsequent
- // background refetches don't tear down the content tree (which causes
- // flickering and scroll-position resets). Only set on successful load (not errors).
- const [initialLoadComplete, setInitialLoadComplete] = createSignal(false);
- createEffect(() => {
- if (!isLoading() && !initialLoadComplete() && !overviewState.error()) {
- setInitialLoadComplete(true);
- }
- });
-
- createEffect(() => {
- if (isLoading()) {
- if (!loadingTimeout) {
- loadingTimeout = window.setTimeout(() => setLoadingTimedOut(true), 30000);
- }
- return;
- }
- if (loadingTimeout) {
- window.clearTimeout(loadingTimeout);
- loadingTimeout = undefined;
- }
- setLoadingTimedOut(false);
- });
-
- onCleanup(() => {
- if (loadingTimeout) window.clearTimeout(loadingTimeout);
- });
-
- const hasConnectionError = createMemo(() => {
- if (loadingTimedOut()) return true;
- if (overviewState.error()) return true;
- return !isLoading() && !connected() && !reconnecting();
- });
-
- // True when we have renderable cached data (even if connection is now lost)
- const hasCachedData = createMemo(() => overview().health.totalResources > 0);
- const dashboardDisconnectedBannerState = createMemo(() =>
- getDashboardDisconnectedBannerState(reconnecting()),
- );
- const dashboardUnavailableState = createMemo(() => getDashboardUnavailableState());
- const dashboardNoResourcesState = createMemo(() => getDashboardNoResourcesState());
-
- const isEmpty = createMemo(() => !isLoading() && initialLoadComplete() && !hasCachedData());
-
- const storageCapacityPercent = createMemo(() => {
- const { totalUsed, totalCapacity } = overview().storage;
- if (totalCapacity <= 0) return 0;
- return Math.max(0, Math.min(100, (totalUsed / totalCapacity) * 100));
- });
-
- const pulseBrief = useDashboardPulseBrief({
- estate: estateSummary,
- overview,
- storageCapacityPercent,
- recovery: recoverySummary,
- pendingApprovalCount: () => actions.pendingApprovals().length,
- patrolFindingCount: () => actions.findingsNeedingAttention().length,
- });
-
- const openPulseBriefAssistant = () => {
- const brief = pulseBrief();
- if (!brief) return;
- aiChatStore.open({
- targetType: 'dashboard',
- targetId: 'pulse-brief',
- initialPrompt: brief.assistantPrompt,
- context: brief.assistantContext,
- autonomousMode: false,
- });
- };
-
- const renderWidget = (id: DashboardWidgetId) => {
- switch (id) {
- case 'trends':
- return (
- <TrendCharts
- trends={trends()}
- overview={overview()}
- trendRange={trendRange}
- setTrendRange={setTrendRange}
- />
- );
- case 'alerts':
- return (
- <section
- id={DASHBOARD_ALERTS_SECTION_ID}
- data-testid="dashboard-alerts-section"
- tabIndex={-1}
- class="scroll-mt-4 rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/50"
- >
- <RecentAlertsPanel alerts={alertsList()} />
- </section>
- );
- case 'recovery':
- return <DashboardRecoveryStatusPanel recovery={recoverySummary()} />;
- case 'storage':
- return (
- <DashboardStoragePanel
- storage={overview().storage}
- storageTrend={trends().storage.capacity}
- loading={trends().loading}
- />
- );
- default: {
- const unreachable: never = id;
- return unreachable;
- }
- }
- };
-
- type WidgetGroup =
- | { type: 'full'; widget: DashboardWidgetDef }
- | { type: 'grid'; widgets: DashboardWidgetDef[] };
- const widgetGroups = createMemo<WidgetGroup[]>(() => {
- const visible = layout.visibleWidgets();
- const result: WidgetGroup[] = [];
- let currentQuarters: DashboardWidgetDef[] = [];
-
- const flushQuarters = () => {
- if (currentQuarters.length > 0) {
- result.push({ type: 'grid', widgets: currentQuarters });
- currentQuarters = [];
- }
- };
-
- for (const widget of visible) {
- if (widget.size === 'full') {
- flushQuarters();
- result.push({ type: 'full', widget });
- } else {
- currentQuarters.push(widget);
- }
- }
-
- flushQuarters();
- return result;
- });
-
- return (
- <main data-testid="dashboard-page" class="space-y-6">
- <PageHeader
- title="Dashboard"
- description="Track infrastructure health, active risks, storage pressure, and recovery readiness from one overview."
- actions={
- <Show when={initialLoadComplete() && hasCachedData() && !hasConnectionError()}>
- <DashboardCustomizer
- allWidgets={layout.allWidgetsOrdered}
- isHidden={layout.isHidden}
- toggleWidget={layout.toggleWidget}
- moveUp={layout.moveUp}
- moveDown={layout.moveDown}
- resetToDefaults={layout.resetToDefaults}
- isDefault={layout.isDefault}
- />
- </Show>
- }
- />
-
- {/* Connection warning banner: shown above all content, NOT a full-page takeover */}
- <Show when={hasConnectionError() && initialLoadComplete()}>
- <div
- class="flex items-center justify-between gap-3 rounded-md border border-amber-200 dark:border-amber-800 bg-amber-50 dark:bg-amber-950 px-4 py-2.5"
- role="alert"
- aria-live="polite"
- >
- <div>
- <p class="text-sm font-medium text-amber-900 dark:text-amber-100">
- {dashboardDisconnectedBannerState().title}
- </p>
- <p class="text-xs text-amber-700 dark:text-amber-300">
- {dashboardDisconnectedBannerState().description}
- </p>
- </div>
- <button
- type="button"
- onClick={() => reconnect()}
- class="shrink-0 inline-flex items-center rounded-md border border-amber-300 dark:border-amber-700 px-3 py-1.5 text-xs font-medium text-amber-800 dark:text-amber-200 hover:bg-amber-100 dark:hover:bg-amber-900 transition-colors"
- >
- {dashboardDisconnectedBannerState().actionLabel}
- </button>
- </div>
- </Show>
-
- <Switch>
- <Match when={isLoading() && !hasCachedData() && !hasConnectionError()}>
- <section class="space-y-4" data-testid="dashboard-loading">
- {/* KPI strip skeleton */}
- <div class="grid grid-cols-2 lg:grid-cols-4 gap-3">
- {(() => {
- const colors = [
- 'border-l-blue-500/40',
- 'border-l-rose-500/40',
- 'border-l-cyan-500/40',
- 'border-l-amber-500/40',
- ];
- return (
- <For each={colors}>
- {(color) => (
- <div
- data-testid="dashboard-skeleton-block"
- class={`animate-pulse bg-surface border border-border rounded-md border-l-[3px] ${color} h-[88px]`}
- />
- )}
- </For>
- );
- })()}
- </div>
- {/* Widget skeletons */}
- <div class="grid grid-cols-1 lg:grid-cols-2 gap-3">
- <For each={Array.from({ length: 2 })}>
- {() => (
- <div
- data-testid="dashboard-skeleton-block"
- class="border border-border rounded-md bg-surface"
- >
- <div class="px-4 py-3">
- <div class="animate-pulse bg-surface-hover rounded h-3 w-16 mb-3" />
- <div class="animate-pulse bg-surface-hover rounded h-[200px]" />
- </div>
- </div>
- )}
- </For>
- </div>
- </section>
- </Match>
-
- {/* Full-page connection error only when we have NO cached data */}
- <Match when={hasConnectionError() && !initialLoadComplete()}>
- <section class="border border-border rounded-md p-4 sm:p-5 bg-surface" aria-live="polite">
- <h2 class="text-base sm:text-lg font-semibold text-base-content">
- {dashboardUnavailableState().title}
- </h2>
- <p class="mt-2 text-sm text-muted">{dashboardUnavailableState().description}</p>
- <button
- type="button"
- onClick={() => reconnect()}
- class="mt-4 inline-flex items-center rounded-md border px-3 py-1.5 text-xs font-medium hover:bg-surface-hover"
- >
- {dashboardUnavailableState().actionLabel}
- </button>
- </section>
- </Match>
-
- <Match when={isEmpty()}>
- <section class="border border-border rounded-md p-4 sm:p-5 bg-surface" aria-live="polite">
- <h2 class="text-base sm:text-lg font-semibold text-base-content">
- {dashboardNoResourcesState().title}
- </h2>
- <p class="mt-2 text-sm text-muted">{dashboardNoResourcesState().description}</p>
- <button
- type="button"
- onClick={() => navigate(buildInfrastructureOnboardingPath('pick'))}
- class="mt-4 inline-flex items-center rounded-md border border-transparent bg-blue-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-blue-700"
- >
- {dashboardNoResourcesState().actionLabel}
- </button>
- </section>
- </Match>
-
- <Match when={initialLoadComplete() && hasCachedData()}>
- <section class="space-y-5">
- {/* 1. Action Required Panel: only when actions exist */}
- <ActionRequiredPanel
- pendingApprovals={actions.pendingApprovals()}
- unackedCriticalAlerts={actions.unackedCriticalAlerts()}
- findingsNeedingAttention={actions.findingsNeedingAttention()}
- />
-
- {/* 2+3+4. Estate orientation, KPI snapshot, and optional Pulse Brief.
- When the AI brief is configured, Estate + KPI become the left
- "snapshot" column and Brief becomes the right-rail companion so
- the three stacked summary layers collapse into one horizontal
- band with balanced column heights. */}
- <Show
- when={pulseBrief()}
- fallback={
- <>
- <EstateSummaryPanel
- summary={estateSummary()}
- resourceIssueCount={overview().problemResources.length}
- activeAlertCount={overview().alerts.total}
- />
- <KPIStrip
- infrastructure={{
- total: estateSummary().totalSystems,
- online: estateSummary().healthySystems,
- attention: estateSummary().attentionSystems,
- }}
- workloads={{
- total: overview().workloads.total,
- running: overview().workloads.running,
- stopped: overview().workloads.stopped,
- }}
- storage={{
- capacityPercent: storageCapacityPercent(),
- totalUsed: overview().storage.totalUsed,
- totalCapacity: overview().storage.totalCapacity,
- }}
- alerts={{
- activeCritical: overview().alerts.activeCritical,
- activeWarning: overview().alerts.activeWarning,
- total: overview().alerts.total,
- }}
- />
- </>
- }
- >
- {(brief) => (
- <div class="grid grid-cols-1 lg:grid-cols-3 gap-5 items-stretch">
- <div class="lg:col-span-2 min-w-0 space-y-5">
- <EstateSummaryPanel
- summary={estateSummary()}
- resourceIssueCount={overview().problemResources.length}
- activeAlertCount={overview().alerts.total}
- />
- {/* When the Brief is present, Estate already covers
- infrastructure counts and the Alerts panel header below
- covers alert counts, so hide the infrastructure and
- alerts KPI cards to avoid showing the same datum three
- times on the first screen. Workloads + Storage stay
- because their details live further down the page. */}
- <KPIStrip
- exclude={['infrastructure', 'alerts']}
- infrastructure={{
- total: estateSummary().totalSystems,
- online: estateSummary().healthySystems,
- attention: estateSummary().attentionSystems,
- }}
- workloads={{
- total: overview().workloads.total,
- running: overview().workloads.running,
- stopped: overview().workloads.stopped,
- }}
- storage={{
- capacityPercent: storageCapacityPercent(),
- totalUsed: overview().storage.totalUsed,
- totalCapacity: overview().storage.totalCapacity,
- }}
- alerts={{
- activeCritical: overview().alerts.activeCritical,
- activeWarning: overview().alerts.activeWarning,
- total: overview().alerts.total,
- }}
- />
- </div>
- <div class="lg:col-span-1 min-w-0 flex">
- <PulseBriefPanel
- brief={brief()}
- onAskAssistant={openPulseBriefAssistant}
- compact
- class="flex-1"
- />
- </div>
- </div>
- )}
- </Show>
-
- {/* 5. Problem Resources Table: only when problems exist */}
- <Show when={overview().problemResources.length > 0}>
- <section
- id={DASHBOARD_PROBLEM_RESOURCES_SECTION_ID}
- data-testid="dashboard-problem-resources-section"
- tabIndex={-1}
- class="scroll-mt-4 rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/50"
- >
- <ProblemResourcesTable problems={overview().problemResources} />
- </section>
- </Show>
-
- {/* 6-7. Customizable widgets: Trend Charts, Recent Alerts.
- The Customize control itself lives in the PageHeader actions
- slot above so layout controls stay near the page title. */}
- <For each={widgetGroups()}>
- {(group) =>
- group.type === 'full' ? (
- renderWidget(group.widget.id)
- ) : (
- <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3 items-start">
- <For each={group.widgets}>{(widget) => renderWidget(widget.id)}</For>
- </div>
- )
- }
- </For>
- </section>
- </Match>
- </Switch>
- </main>
- );
-}
diff --git a/frontend-modern/src/pages/NotFound.tsx b/frontend-modern/src/pages/NotFound.tsx
index 0c1905b6f6..72e41abb5d 100644
--- a/frontend-modern/src/pages/NotFound.tsx
+++ b/frontend-modern/src/pages/NotFound.tsx
@@ -4,11 +4,7 @@ import { useLocation, useNavigate } from '@solidjs/router';
import { Card } from '@/components/shared/Card';
import { EmptyState } from '@/components/shared/EmptyState';
import { PageHeader } from '@/components/shared/PageHeader';
-import {
- DASHBOARD_PATH,
- buildRecoveryPath,
- buildInfrastructurePath,
-} from '@/routing/resourceLinks';
+import { buildRecoveryPath, buildInfrastructurePath } from '@/routing/resourceLinks';
const NotFound: Component = () => {
const location = useLocation();
@@ -39,13 +35,6 @@ const NotFound: Component = () => {
>
Go to Infrastructure
</button>
- <button
- type="button"
- class="inline-flex items-center gap-2 rounded-md border border-border bg-surface px-3 py-1.5 text-xs font-medium text-base-content shadow-sm hover:bg-surface-hover"
- onClick={() => navigate(DASHBOARD_PATH)}
- >
- Go to Dashboard
- </button>
</div>
}
/>
diff --git a/frontend-modern/src/pages/RuntimeHome.tsx b/frontend-modern/src/pages/RuntimeHome.tsx
index 4d5dd69cf3..79b98239c4 100644
--- a/frontend-modern/src/pages/RuntimeHome.tsx
+++ b/frontend-modern/src/pages/RuntimeHome.tsx
@@ -1,81 +1,13 @@
import { useNavigate } from '@solidjs/router';
-import { createEffect, createMemo, createSignal, onCleanup, onMount } from 'solid-js';
-import { ResourceAPI } from '@/api/resources';
-import { buildInfrastructureOnboardingPath } from '@/components/Settings/infrastructureWorkspaceModel';
-import { useWebSocket } from '@/contexts/appRuntime';
-import { DASHBOARD_PATH } from '@/routing/resourceLinks';
-import { isHostedModeEnabled } from '@/stores/license';
-
-function dashboardSummaryHasResources(totalResources: number | undefined): boolean {
- return Number(totalResources || 0) > 0;
-}
+import { createEffect } from 'solid-js';
+import { buildInfrastructurePath } from '@/routing/resourceLinks';
export default function RuntimeHome() {
const navigate = useNavigate();
- const ws = useWebSocket();
- const [summaryResolved, setSummaryResolved] = createSignal(!isHostedModeEnabled());
- const [summaryHasResources, setSummaryHasResources] = createSignal(false);
- const [summaryFailed, setSummaryFailed] = createSignal(false);
-
- const hasConnectedInfrastructure = createMemo(() => {
- const items = ws.state?.connectedInfrastructure;
- return Array.isArray(items) && items.length > 0;
- });
-
- const destination = createMemo<string | null>(() => {
- if (!isHostedModeEnabled()) {
- return DASHBOARD_PATH;
- }
- if (hasConnectedInfrastructure()) {
- return DASHBOARD_PATH;
- }
- if (!summaryResolved()) {
- return null;
- }
- if (summaryFailed()) {
- return DASHBOARD_PATH;
- }
- return summaryHasResources() ? DASHBOARD_PATH : buildInfrastructureOnboardingPath('pick');
- });
-
- onMount(() => {
- if (!isHostedModeEnabled() || hasConnectedInfrastructure()) {
- setSummaryResolved(true);
- return;
- }
-
- let cancelled = false;
- void ResourceAPI.getDashboardSummary()
- .then((summary) => {
- if (cancelled) {
- return;
- }
- setSummaryHasResources(dashboardSummaryHasResources(summary?.health?.totalResources));
- })
- .catch(() => {
- if (cancelled) {
- return;
- }
- setSummaryFailed(true);
- })
- .finally(() => {
- if (cancelled) {
- return;
- }
- setSummaryResolved(true);
- });
-
- onCleanup(() => {
- cancelled = true;
- });
- });
+ const destination = () => buildInfrastructurePath();
createEffect(() => {
- const nextPath = destination();
- if (!nextPath) {
- return;
- }
- navigate(nextPath, { replace: true });
+ navigate(destination(), { replace: true });
});
return <div class="px-4 py-6 text-sm text-muted">Opening workspace...</div>;
diff --git a/frontend-modern/src/pages/Workloads.tsx b/frontend-modern/src/pages/Workloads.tsx
index 4d5e2069ca..f6c213a82c 100644
--- a/frontend-modern/src/pages/Workloads.tsx
+++ b/frontend-modern/src/pages/Workloads.tsx
@@ -1,4 +1,4 @@
-import { Dashboard as WorkloadsSurface } from '@/components/Dashboard/Dashboard';
+import { WorkloadsSurface } from '@/components/Workloads/WorkloadsSurface';
export function Workloads() {
return <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />;
diff --git a/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts b/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts
index 1db4a69ea9..df5a4cd961 100644
--- a/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts
+++ b/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts
@@ -34,7 +34,6 @@ import alertOverviewTabSource from '@/features/alerts/OverviewTab.tsx?raw';
import alertScheduleTabSource from '@/features/alerts/tabs/ScheduleTab.tsx?raw';
import alertThresholdsTabSource from '@/features/alerts/tabs/ThresholdsTab.tsx?raw';
import thresholdsTabModelSource from '@/features/alerts/thresholds/thresholdsTabModel.ts?raw';
-import recentAlertsPanelSource from '@/components/Alerts/RecentAlertsPanel.tsx?raw';
import alertResourceTableDesktopSource from '@/components/Alerts/AlertResourceTableDesktop.tsx?raw';
import thresholdsTableSource from '@/components/Alerts/ThresholdsTable.tsx?raw';
import thresholdsTableAgentDisksSectionSource from '@/components/Alerts/ThresholdsTableAgentDisksSection.tsx?raw';
@@ -539,9 +538,6 @@ describe('tab path helpers', () => {
expect(alertAcknowledgementStateSource).toContain('AlertsAPI.bulkAcknowledge');
expect(alertAcknowledgementStateSource).toContain('AlertsAPI.acknowledge');
expect(alertAcknowledgementStateSource).toContain('AlertsAPI.unacknowledge');
- expect(recentAlertsPanelSource).toContain('useAlertAcknowledgementState');
- expect(recentAlertsPanelSource).not.toContain('AlertsAPI.bulkAcknowledge');
- expect(recentAlertsPanelSource).not.toContain('AlertsAPI.acknowledge');
expect(alertScheduleTabSource).toContain('useAlertScheduleState');
expect(alertScheduleTabSource).not.toContain('createDefaultQuietHours');
expect(alertScheduleTabSource).not.toContain('createDefaultCooldown');
diff --git a/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx b/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx
deleted file mode 100644
index 3f4c4e4741..0000000000
--- a/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx
+++ /dev/null
@@ -1,523 +0,0 @@
-import { fireEvent, render, screen } from '@solidjs/testing-library';
-import { beforeEach, describe, expect, it, vi } from 'vitest';
-import {
- DASHBOARD_ALERTS_SECTION_ID,
- DASHBOARD_PROBLEM_RESOURCES_SECTION_ID,
-} from '@/features/dashboardOverview/dashboardSectionIds';
-import type { DashboardOverview } from '@/hooks/useDashboardOverview';
-import type { DashboardRecoverySummary } from '@/hooks/useDashboardRecovery';
-import DashboardPage from '@/pages/Dashboard';
-import dashboardPageSource from '@/pages/Dashboard.tsx?raw';
-import type { ConnectedInfrastructureSurface } from '@/types/api';
-
-const aiRuntimeMock = vi.hoisted(() => ({
- featureEnabled: false,
- settings: null as unknown,
- loadSettings: vi.fn(async () => null),
- openChat: vi.fn(),
-}));
-
-let overviewLoading = false;
-let overviewError: unknown = undefined;
-let wsConnected = true;
-let wsReconnecting = false;
-const connectedInfrastructureMock: Array<{
- id: string;
- name: string;
- status: 'active' | 'ignored';
- healthStatus?: string;
- lastSeen?: number;
- surfaces: Array<{ id: string; kind: ConnectedInfrastructureSurface['kind']; label: string }>;
-}> = [];
-const reconnectSpy = vi.fn();
-const navigateSpy = vi.hoisted(() => vi.fn());
-const recoverySummaryMock: DashboardRecoverySummary = {
- totalProtected: 3,
- byOutcome: { success: 2, failed: 1 },
- latestEventTimestamp: Date.parse('2026-02-14T10:00:00.000Z'),
- hasData: true,
-};
-
-const overviewMock: DashboardOverview = {
- health: {
- totalResources: 0,
- byStatus: {},
- criticalAlerts: 0,
- warningAlerts: 0,
- },
- infrastructure: {
- total: 0,
- byStatus: {},
- byType: {},
- topCPU: [],
- topMemory: [],
- },
- workloads: {
- total: 0,
- running: 0,
- stopped: 0,
- byType: {},
- },
- storage: {
- total: 0,
- totalCapacity: 0,
- totalUsed: 0,
- warningCount: 0,
- criticalCount: 0,
- },
- alerts: {
- activeCritical: 0,
- activeWarning: 0,
- total: 0,
- },
- problemResources: [],
-};
-
-vi.mock('@/contexts/appRuntime', () => ({
- useWebSocket: () => ({
- state: {
- resources: [],
- get connectedInfrastructure() {
- return connectedInfrastructureMock;
- },
- },
- activeAlerts: {},
- connected: () => wsConnected,
- reconnecting: () => wsReconnecting,
- reconnect: reconnectSpy,
- initialDataReceived: () => true,
- }),
-}));
-
-vi.mock('@solidjs/router', async () => {
- const actual = await vi.importActual<typeof import('@solidjs/router')>('@solidjs/router');
- return {
- ...actual,
- useNavigate: () => navigateSpy,
- };
-});
-
-vi.mock('@/stores/license', () => ({
- hasFeature: (feature: string) => feature === 'ai_patrol' && aiRuntimeMock.featureEnabled,
-}));
-
-vi.mock('@/stores/aiRuntimeState', () => ({
- aiRuntimeSettings: () => aiRuntimeMock.settings,
- loadAIRuntimeSettings: () => aiRuntimeMock.loadSettings(),
-}));
-
-vi.mock('@/stores/aiChat', () => ({
- aiChatStore: {
- open: (context: unknown) => aiRuntimeMock.openChat(context),
- },
-}));
-
-vi.mock('@/hooks/useDashboardOverview', () => ({
- useDashboardOverview: () => ({
- overview: () => overviewMock,
- loading: () => overviewLoading,
- error: () => overviewError,
- refetch: vi.fn(),
- }),
-}));
-
-vi.mock('@/hooks/useDashboardTrends', () => ({
- useDashboardTrends: () => () => ({
- infrastructure: {
- cpu: new Map(),
- memory: new Map(),
- emptyMessage: null,
- },
- storage: {
- capacity: null,
- },
- loading: false,
- error: null,
- }),
-}));
-
-vi.mock('@/hooks/useDashboardActions', () => ({
- useDashboardActions: () => ({
- pendingApprovals: () => [],
- unackedCriticalAlerts: () => [],
- findingsNeedingAttention: () => [],
- hasAnyActions: () => false,
- totalActionCount: () => 0,
- }),
-}));
-
-vi.mock('@/hooks/useDashboardRecovery', () => ({
- useDashboardRecovery: () => () => recoverySummaryMock,
-}));
-
-describe('Dashboard page module contract', () => {
- beforeEach(() => {
- overviewLoading = false;
- overviewError = undefined;
- wsConnected = true;
- wsReconnecting = false;
- reconnectSpy.mockReset();
- navigateSpy.mockReset();
- aiRuntimeMock.featureEnabled = false;
- aiRuntimeMock.settings = null;
- aiRuntimeMock.loadSettings.mockClear();
- aiRuntimeMock.openChat.mockClear();
- overviewMock.health.totalResources = 0;
- overviewMock.infrastructure.total = 0;
- overviewMock.infrastructure.byStatus = {};
- overviewMock.workloads.total = 0;
- overviewMock.workloads.running = 0;
- overviewMock.workloads.stopped = 0;
- overviewMock.problemResources = [];
- overviewMock.storage.total = 0;
- overviewMock.storage.totalCapacity = 0;
- overviewMock.storage.totalUsed = 0;
- overviewMock.storage.warningCount = 0;
- overviewMock.storage.criticalCount = 0;
- overviewMock.alerts.activeCritical = 0;
- overviewMock.alerts.activeWarning = 0;
- overviewMock.alerts.total = 0;
- connectedInfrastructureMock.length = 0;
- window.history.replaceState(null, '', '/');
- });
-
- it('exports a default component function', () => {
- expect(typeof DashboardPage).toBe('function');
- });
-
- it('routes the alerts dashboard widget through the alert-owned surface', () => {
- expect(dashboardPageSource).toContain("from '@/components/Alerts/RecentAlertsPanel'");
- expect(dashboardPageSource).toContain('<RecentAlertsPanel alerts={alertsList()} />');
- expect(dashboardPageSource).toContain('id={DASHBOARD_ALERTS_SECTION_ID}');
- expect(dashboardPageSource).not.toContain('criticalCount={overview().alerts.activeCritical}');
- expect(dashboardPageSource).not.toContain('warningCount={overview().alerts.activeWarning}');
- });
-
- it('routes dashboard overview panels through the dashboard overview feature owner', () => {
- expect(dashboardPageSource).toContain("from '@/features/dashboardOverview'");
- expect(dashboardPageSource).not.toContain("from '@/components/Dashboard/RelayOnboardingCard'");
- expect(dashboardPageSource).not.toContain('<RelayOnboardingCard />');
- expect(dashboardPageSource).toContain(
- 'ActionRequiredPanel,\n DashboardCustomizer,\n EstateSummaryPanel,\n KPIStrip,\n ProblemResourcesTable,\n PulseBriefPanel,\n TrendCharts,\n useDashboardPulseBrief,',
- );
- });
-
- it('routes storage and recovery dashboard widgets through storage-recovery owners', () => {
- expect(dashboardPageSource).toContain(
- "from '@/components/Recovery/DashboardRecoveryStatusPanel'",
- );
- expect(dashboardPageSource).toContain("from '@/components/Storage/DashboardStoragePanel'");
- expect(dashboardPageSource).toContain(
- 'const overviewState = useDashboardOverview(alertsList);',
- );
- expect(dashboardPageSource).not.toContain("cacheKey: 'all-resources'");
- });
-
- it('routes dashboard trend hydration through the shared dashboard resources snapshot', () => {
- expect(dashboardPageSource).toContain(
- 'const trends = useDashboardTrends(overview, trendRange);',
- );
- expect(dashboardPageSource).not.toContain('const dashboardResources = useUnifiedResources');
- });
-
- it('renders loading skeleton blocks when resources are loading', () => {
- overviewLoading = true;
-
- render(() => <DashboardPage />);
-
- expect(screen.getByTestId('dashboard-loading')).toBeInTheDocument();
- expect(screen.getAllByTestId('dashboard-skeleton-block').length).toBeGreaterThan(0);
- });
-
- it('routes the empty dashboard state to infrastructure install', () => {
- render(() => <DashboardPage />);
-
- expect(
- screen.getByRole('heading', { name: 'Connect your first infrastructure source' }),
- ).toBeInTheDocument();
- expect(
- screen.getByText(
- 'The dashboard appears after Pulse receives its first monitored system. Add an infrastructure source with API inventory, Agent telemetry, or both, then this page becomes the live estate overview.',
- ),
- ).toBeInTheDocument();
-
- fireEvent.click(screen.getByRole('button', { name: 'Add infrastructure source' }));
-
- expect(navigateSpy).toHaveBeenCalledWith('/settings/infrastructure?add=pick');
- });
-
- it('renders the governed storage and recovery dashboard panels', () => {
- overviewMock.health.totalResources = 4;
- overviewMock.infrastructure.total = 4;
- overviewMock.infrastructure.byStatus = { online: 4 };
- overviewMock.storage.total = 4;
- overviewMock.storage.totalCapacity = 4000;
- overviewMock.storage.totalUsed = 2000;
- overviewMock.storage.warningCount = 1;
- overviewMock.storage.criticalCount = 1;
-
- render(() => <DashboardPage />);
-
- expect(screen.queryByTestId('relay-onboarding-card')).toBeNull();
- expect(screen.getByRole('heading', { name: 'Recovery Status' })).toBeInTheDocument();
- expect(screen.getByRole('heading', { name: /Storage/ })).toBeInTheDocument();
- expect(screen.getByText('Last recovery point over 24 hours ago')).toBeInTheDocument();
- expect(screen.getAllByText(/1\.95 KB \/ 3\.91 KB/i)).toHaveLength(2);
- });
-
- it('renders estate orientation before detailed dashboard problem rows', () => {
- overviewMock.health.totalResources = 5;
- overviewMock.infrastructure.total = 4;
- overviewMock.infrastructure.byStatus = { online: 4 };
- overviewMock.workloads.total = 9;
- overviewMock.workloads.running = 7;
- connectedInfrastructureMock.push(
- {
- id: 'homelab',
- name: 'homelab',
- status: 'active',
- healthStatus: 'online',
- lastSeen: Date.now(),
- surfaces: [
- { id: 'agent:homelab', kind: 'agent', label: 'Host telemetry' },
- { id: 'proxmox:homelab', kind: 'proxmox', label: 'Proxmox VE data' },
- ],
- },
- {
- id: 'nas',
- name: 'nas',
- status: 'active',
- healthStatus: 'degraded',
- lastSeen: Date.now(),
- surfaces: [{ id: 'truenas:nas', kind: 'truenas', label: 'TrueNAS API data' }],
- },
- );
- overviewMock.problemResources = [
- {
- resource: {
- id: 'storage-1',
- type: 'storage',
- name: 'Storage 1',
- displayName: 'Storage 1',
- platformId: 'storage-1',
- platformType: 'truenas',
- sourceType: 'api',
- status: 'offline',
- } as DashboardOverview['problemResources'][number]['resource'],
- problems: ['Offline'],
- worstValue: 200,
- },
- ];
-
- render(() => <DashboardPage />);
-
- const estateHeading = screen.getByRole('heading', { name: 'Connected infrastructure' });
- const problemHeading = screen.getByRole('heading', { name: 'Problem Resources' });
-
- expect(screen.getByText('1 system needs attention')).toBeInTheDocument();
- expect(screen.getByRole('link', { name: '1 resource issue' })).toHaveAttribute(
- 'href',
- `#${DASHBOARD_PROBLEM_RESOURCES_SECTION_ID}`,
- );
- expect(screen.getByTestId('dashboard-problem-resources-section')).toHaveAttribute(
- 'id',
- DASHBOARD_PROBLEM_RESOURCES_SECTION_ID,
- );
- expect(screen.getByText('1 system needs review; details below')).toBeInTheDocument();
- expect(screen.getByText('2 active')).toBeInTheDocument();
- const sourceCoverage = screen.getByText(/Proxmox/);
- expect(sourceCoverage).toBeInTheDocument();
- expect(sourceCoverage).toHaveClass('break-words');
- expect(sourceCoverage).not.toHaveClass('truncate');
- expect(screen.getByText(/TrueNAS/)).toBeInTheDocument();
- expect(
- estateHeading.compareDocumentPosition(problemHeading) & Node.DOCUMENT_POSITION_FOLLOWING,
- ).toBe(Node.DOCUMENT_POSITION_FOLLOWING);
- });
-
- it('keeps healthy system copy distinct from resource and alert issues', () => {
- overviewMock.health.totalResources = 5;
- overviewMock.infrastructure.total = 1;
- overviewMock.infrastructure.byStatus = { online: 1 };
- overviewMock.alerts.activeWarning = 2;
- overviewMock.alerts.total = 2;
- connectedInfrastructureMock.push({
- id: 'homelab',
- name: 'homelab',
- status: 'active',
- healthStatus: 'online',
- lastSeen: Date.now(),
- surfaces: [{ id: 'agent:homelab', kind: 'agent', label: 'Host telemetry' }],
- });
- overviewMock.problemResources = [
- {
- resource: {
- id: 'container-1',
- type: 'app-container',
- name: 'Container 1',
- displayName: 'Container 1',
- platformId: 'container-1',
- platformType: 'docker',
- sourceType: 'api',
- status: 'offline',
- lastSeen: Date.now(),
- } as DashboardOverview['problemResources'][number]['resource'],
- problems: ['Offline'],
- worstValue: 200,
- },
- ];
-
- render(() => <DashboardPage />);
-
- expect(screen.getByText('1 system reporting')).toBeInTheDocument();
- const resourceIssueLink = screen.getByRole('link', { name: '1 resource issue' });
- const alertIssueLink = screen.getByRole('link', { name: '2 alerts' });
- expect(resourceIssueLink).toHaveAttribute('href', `#${DASHBOARD_PROBLEM_RESOURCES_SECTION_ID}`);
- expect(alertIssueLink).toHaveAttribute('href', `#${DASHBOARD_ALERTS_SECTION_ID}`);
- expect(screen.getByTestId('dashboard-alerts-section')).toHaveAttribute(
- 'id',
- DASHBOARD_ALERTS_SECTION_ID,
- );
- expect(screen.getByText('Resource issues and alerts listed below')).toBeInTheDocument();
- expect(screen.queryByText('No dashboard issues found')).toBeNull();
-
- const previousScrollIntoView = HTMLElement.prototype.scrollIntoView;
- const scrollIntoView = vi.fn();
- HTMLElement.prototype.scrollIntoView = scrollIntoView;
- try {
- fireEvent.click(resourceIssueLink);
- expect(window.location.hash).toBe(`#${DASHBOARD_PROBLEM_RESOURCES_SECTION_ID}`);
- expect(scrollIntoView).toHaveBeenCalled();
- expect(document.activeElement).toBe(
- screen.getByTestId('dashboard-problem-resources-section'),
- );
- } finally {
- HTMLElement.prototype.scrollIntoView = previousScrollIntoView;
- }
- });
-
- it('shows the optional Pulse Brief when Assistant and Patrol are configured', async () => {
- aiRuntimeMock.featureEnabled = true;
- aiRuntimeMock.settings = {
- enabled: true,
- configured: true,
- model: 'test-model',
- custom_context: '',
- auth_method: 'api_key',
- oauth_connected: false,
- anthropic_configured: false,
- openai_configured: true,
- openrouter_configured: false,
- deepseek_configured: false,
- gemini_configured: false,
- ollama_configured: false,
- ollama_base_url: '',
- configured_providers: ['openai'],
- };
- overviewMock.health.totalResources = 5;
- overviewMock.infrastructure.total = 1;
- overviewMock.infrastructure.byStatus = { online: 1 };
- overviewMock.workloads.total = 4;
- overviewMock.workloads.running = 3;
- overviewMock.alerts.activeCritical = 1;
- overviewMock.alerts.total = 1;
- connectedInfrastructureMock.push({
- id: 'homelab',
- name: 'homelab',
- status: 'active',
- healthStatus: 'online',
- lastSeen: Date.now(),
- surfaces: [{ id: 'agent:homelab', kind: 'agent', label: 'Host telemetry' }],
- });
- overviewMock.problemResources = [
- {
- resource: {
- id: 'container-1',
- type: 'app-container',
- name: 'Container 1',
- displayName: 'Container 1',
- platformId: 'container-1',
- platformType: 'docker',
- sourceType: 'api',
- status: 'offline',
- } as DashboardOverview['problemResources'][number]['resource'],
- problems: ['Offline'],
- worstValue: 200,
- },
- ];
-
- render(() => <DashboardPage />);
-
- const brief = screen.getByTestId('dashboard-pulse-brief');
- const estateHeading = screen.getByRole('heading', { name: 'Connected infrastructure' });
-
- expect(brief).toBeInTheDocument();
- expect(screen.getByRole('heading', { name: 'Pulse Brief' })).toBeInTheDocument();
- expect(screen.getByText(/Review Container 1 \(Offline\) first/)).toBeInTheDocument();
- expect(estateHeading.compareDocumentPosition(brief) & Node.DOCUMENT_POSITION_FOLLOWING).toBe(
- Node.DOCUMENT_POSITION_FOLLOWING,
- );
- // When Brief is shown, Estate already carries the infrastructure count
- // and the Alerts panel header carries the alert count, so those two KPI
- // cards are suppressed to avoid triple-counting the same signal on the
- // first screen. Workloads + Storage stay because their details live
- // further down the page.
- expect(screen.queryByTestId('dashboard-kpi-infrastructure')).toBeNull();
- expect(screen.queryByTestId('dashboard-kpi-alerts')).toBeNull();
- const workloadsKpi = screen.getByTestId('dashboard-kpi-workloads');
- expect(workloadsKpi).toBeInTheDocument();
- expect(screen.getByTestId('dashboard-kpi-storage')).toBeInTheDocument();
- // Snapshot column (Estate + trimmed KPI) still precedes Brief in DOM
- // order so screen readers read concrete counts before the narrative.
- expect(workloadsKpi.compareDocumentPosition(brief) & Node.DOCUMENT_POSITION_FOLLOWING).toBe(
- Node.DOCUMENT_POSITION_FOLLOWING,
- );
-
- fireEvent.click(screen.getByRole('button', { name: 'Ask Assistant' }));
-
- expect(aiRuntimeMock.openChat).toHaveBeenCalledWith(
- expect.objectContaining({
- targetType: 'dashboard',
- targetId: 'pulse-brief',
- autonomousMode: false,
- initialPrompt: expect.stringContaining('Summarize the current Pulse dashboard'),
- context: expect.objectContaining({
- dashboardBrief: expect.stringContaining('Review Container 1 (Offline) first'),
- }),
- }),
- );
- });
-
- it('keeps the KPI strip above problem resources so the dashboard snapshot reads before detail', () => {
- overviewMock.health.totalResources = 5;
- overviewMock.infrastructure.total = 5;
- overviewMock.infrastructure.byStatus = { online: 5 };
- overviewMock.workloads.total = 12;
- overviewMock.workloads.running = 9;
- overviewMock.problemResources = [
- {
- resource: {
- id: 'storage-1',
- type: 'storage',
- name: 'Storage 1',
- displayName: 'Storage 1',
- platformId: 'storage-1',
- platformType: 'truenas',
- sourceType: 'api',
- status: 'offline',
- } as DashboardOverview['problemResources'][number]['resource'],
- problems: ['Offline'],
- worstValue: 200,
- },
- ];
-
- render(() => <DashboardPage />);
-
- const kpiLabel = screen.getByText('Infrastructure');
- const problemHeading = screen.getByRole('heading', { name: 'Problem Resources' });
-
- expect(
- kpiLabel.compareDocumentPosition(problemHeading) & Node.DOCUMENT_POSITION_FOLLOWING,
- ).toBe(Node.DOCUMENT_POSITION_FOLLOWING);
- });
-});
diff --git a/frontend-modern/src/pages/__tests__/RuntimeHome.test.tsx b/frontend-modern/src/pages/__tests__/RuntimeHome.test.tsx
index 03df48954d..92de821ad4 100644
--- a/frontend-modern/src/pages/__tests__/RuntimeHome.test.tsx
+++ b/frontend-modern/src/pages/__tests__/RuntimeHome.test.tsx
@@ -3,9 +3,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest';
import RuntimeHome from '@/pages/RuntimeHome';
const navigateSpy = vi.hoisted(() => vi.fn());
-const getDashboardSummaryMock = vi.hoisted(() => vi.fn());
-const isHostedModeEnabledMock = vi.hoisted(() => vi.fn());
-const connectedInfrastructureItems = vi.hoisted(() => [] as Array<Record<string, unknown>>);
vi.mock('@solidjs/router', async () => {
const actual = await vi.importActual<typeof import('@solidjs/router')>('@solidjs/router');
@@ -15,68 +12,16 @@ vi.mock('@solidjs/router', async () => {
};
});
-vi.mock('@/contexts/appRuntime', () => ({
- useWebSocket: () => ({
- state: {
- get connectedInfrastructure() {
- return connectedInfrastructureItems;
- },
- },
- }),
-}));
-
-vi.mock('@/api/resources', () => ({
- ResourceAPI: {
- getDashboardSummary: getDashboardSummaryMock,
- },
-}));
-
-vi.mock('@/stores/license', () => ({
- isHostedModeEnabled: () => isHostedModeEnabledMock(),
-}));
-
describe('RuntimeHome', () => {
beforeEach(() => {
navigateSpy.mockReset();
- getDashboardSummaryMock.mockReset();
- connectedInfrastructureItems.length = 0;
- isHostedModeEnabledMock.mockReturnValue(true);
- });
-
- it('routes self-hosted runtimes straight to the dashboard', async () => {
- isHostedModeEnabledMock.mockReturnValue(false);
-
- render(() => <RuntimeHome />);
-
- await waitFor(() => {
- expect(navigateSpy).toHaveBeenCalledWith('/dashboard', { replace: true });
- });
- expect(getDashboardSummaryMock).not.toHaveBeenCalled();
});
- it('routes hosted empty workspaces into the infrastructure source picker', async () => {
- getDashboardSummaryMock.mockResolvedValue({
- health: { totalResources: 0 },
- });
-
- render(() => <RuntimeHome />);
-
- await waitFor(() => {
- expect(getDashboardSummaryMock).toHaveBeenCalledTimes(1);
- expect(navigateSpy).toHaveBeenCalledWith('/settings/infrastructure?add=pick', {
- replace: true,
- });
- });
- });
-
- it('keeps hosted workspaces with connected infrastructure on the dashboard', async () => {
- connectedInfrastructureItems.push({ id: 'agent-1' });
-
+ it('routes authenticated runtimes straight to Infrastructure', async () => {
render(() => <RuntimeHome />);
await waitFor(() => {
- expect(navigateSpy).toHaveBeenCalledWith('/dashboard', { replace: true });
+ expect(navigateSpy).toHaveBeenCalledWith('/infrastructure', { replace: true });
});
- expect(getDashboardSummaryMock).not.toHaveBeenCalled();
});
});
diff --git a/frontend-modern/src/pages/__tests__/Workloads.helpers.test.ts b/frontend-modern/src/pages/__tests__/Workloads.helpers.test.ts
index 83870f28d0..c7c58799e4 100644
--- a/frontend-modern/src/pages/__tests__/Workloads.helpers.test.ts
+++ b/frontend-modern/src/pages/__tests__/Workloads.helpers.test.ts
@@ -1,17 +1,17 @@
import { describe, expect, it } from 'vitest';
import appSource from '@/App.tsx?raw';
import workloadsPageSource from '@/pages/Workloads.tsx?raw';
-import workloadsSurfaceSource from '@/components/Dashboard/Dashboard.tsx?raw';
+import workloadsSurfaceSource from '@/components/Workloads/WorkloadsSurface.tsx?raw';
describe('workloads page route shell', () => {
it('keeps App routing on a page shell instead of an inline workloads view', () => {
expect(appSource).toContain("const WorkloadsPage = lazy(() => import('./pages/Workloads'));");
expect(appSource).toContain('<Route path={ROOT_WORKLOADS_PATH} component={WorkloadsPage} />');
expect(appSource).not.toContain(
- 'const WorkloadsView = () => <Dashboard vms={[]} containers={[]} nodes={[]} useWorkloads />;',
+ 'const WorkloadsView = () => <Workloads vms={[]} containers={[]} nodes={[]} useWorkloads />;',
);
expect(workloadsPageSource).toContain(
- "import { Dashboard as WorkloadsSurface } from '@/components/Dashboard/Dashboard';",
+ "import { WorkloadsSurface } from '@/components/Workloads/WorkloadsSurface';",
);
expect(workloadsPageSource).toContain(
'<WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />',
diff --git a/frontend-modern/src/routing/__tests__/navigation.test.ts b/frontend-modern/src/routing/__tests__/navigation.test.ts
index 7959c18801..6d6dc4ced6 100644
--- a/frontend-modern/src/routing/__tests__/navigation.test.ts
+++ b/frontend-modern/src/routing/__tests__/navigation.test.ts
@@ -3,7 +3,7 @@ import { getActiveTabForPath } from '../navigation';
describe('navigation routing helpers', () => {
it('maps paths to the correct primary tab', () => {
- expect(getActiveTabForPath('/dashboard')).toBe('dashboard');
+ expect(getActiveTabForPath('/unknown')).toBe('infrastructure');
expect(getActiveTabForPath('/infrastructure')).toBe('infrastructure');
expect(getActiveTabForPath('/workloads?type=pod')).toBe('workloads');
expect(getActiveTabForPath('/storage')).toBe('storage');
diff --git a/frontend-modern/src/routing/navigation.ts b/frontend-modern/src/routing/navigation.ts
index a1c75cec36..4d1c4039cd 100644
--- a/frontend-modern/src/routing/navigation.ts
+++ b/frontend-modern/src/routing/navigation.ts
@@ -1,7 +1,6 @@
import { INFRASTRUCTURE_PATH, PATROL_PATH, WORKLOADS_PATH } from './resourceLinks';
export type AppTabId =
- | 'dashboard'
| 'infrastructure'
| 'workloads'
| 'storage'
@@ -11,7 +10,6 @@ export type AppTabId =
| 'settings';
export function getActiveTabForPath(path: string): AppTabId {
- if (path.startsWith('/dashboard')) return 'dashboard';
if (path.startsWith(INFRASTRUCTURE_PATH)) return 'infrastructure';
if (path.startsWith(WORKLOADS_PATH)) return 'workloads';
if (path.startsWith('/storage')) return 'storage';
diff --git a/frontend-modern/src/routing/resourceLinks.ts b/frontend-modern/src/routing/resourceLinks.ts
index fec7fa64e0..7f60e50772 100644
--- a/frontend-modern/src/routing/resourceLinks.ts
+++ b/frontend-modern/src/routing/resourceLinks.ts
@@ -39,7 +39,6 @@ export const WORKLOADS_QUERY_PARAMS = {
export const WORKLOADS_PATH = '/workloads';
export const PMG_THRESHOLDS_PATH = '/alerts/thresholds/mail-gateway';
-export const DASHBOARD_PATH = '/dashboard';
export const ALERTS_OVERVIEW_PATH = '/alerts/overview';
export const PATROL_PATH = '/patrol';
// Deprecated compatibility alias while older callers migrate off `/ai`.
diff --git a/frontend-modern/src/routing/routePreload.ts b/frontend-modern/src/routing/routePreload.ts
index 05fcd48408..4b96792952 100644
--- a/frontend-modern/src/routing/routePreload.ts
+++ b/frontend-modern/src/routing/routePreload.ts
@@ -3,7 +3,6 @@ import {
buildRecoveryPath,
buildStoragePath,
buildWorkloadsPath,
- DASHBOARD_PATH,
PATROL_PATH,
} from '@/routing/resourceLinks';
@@ -31,12 +30,6 @@ function normalizeRoute(route: string): string {
}
const ROUTE_PRELOADERS: readonly RoutePreloader[] = [
- {
- id: 'dashboard',
- matches: (route) => route === DASHBOARD_PATH,
- preload: () =>
- import('@/pages/Dashboard').then(() => undefined),
- },
{
id: 'infrastructure',
matches: (route) => route === ROOT_INFRASTRUCTURE_PATH,
diff --git a/frontend-modern/src/useAppRuntimeState.ts b/frontend-modern/src/useAppRuntimeState.ts
index bdc75ca21c..497cb3a54d 100644
--- a/frontend-modern/src/useAppRuntimeState.ts
+++ b/frontend-modern/src/useAppRuntimeState.ts
@@ -80,7 +80,6 @@ export type AppConnectionStatus = {
};
const ROOT_INFRASTRUCTURE_PATH = buildInfrastructurePath();
-const ROOT_DASHBOARD_PATH = '/dashboard';
const isPreAuthLoginBootstrapPath = (pathname: string): boolean =>
pathname === '/' || pathname === '/login';
@@ -138,7 +137,6 @@ export const useAppRuntimeState = () => {
const pathname = window.location.pathname;
if (!pathname) return true;
if (pathname === ROOT_INFRASTRUCTURE_PATH) return false;
- if (pathname === ROOT_DASHBOARD_PATH) return false;
return true;
};
diff --git a/frontend-modern/src/utils/__tests__/alertOverviewPresentation.test.ts b/frontend-modern/src/utils/__tests__/alertOverviewPresentation.test.ts
index 004246c581..d818d36c47 100644
--- a/frontend-modern/src/utils/__tests__/alertOverviewPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertOverviewPresentation.test.ts
@@ -29,8 +29,6 @@ import {
ALERT_TIMELINE_RETRY_LABEL,
ALERT_TIMELINE_UNAVAILABLE_STATE,
ALERTS_THRESHOLD_HINT,
- getDashboardAlertSummaryText,
- getDashboardAlertTone,
getAlertOverviewAcknowledgedBadgeClass,
getAlertOverviewCardPresentation,
getAlertOverviewPrimaryActionClass,
@@ -50,15 +48,6 @@ import {
} from '@/utils/alertOverviewPresentation';
describe('alertOverviewPresentation', () => {
- it('returns canonical dashboard alert tone and summary helpers', () => {
- expect(getDashboardAlertTone({ activeCritical: 2, activeWarning: 5 })).toBe('danger');
- expect(getDashboardAlertTone({ activeCritical: 0, activeWarning: 3 })).toBe('warning');
- expect(getDashboardAlertTone({ activeCritical: 0, activeWarning: 0 })).toBe('default');
- expect(getDashboardAlertSummaryText({ activeCritical: 2, activeWarning: 3 })).toBe(
- '2 critical Β· 3 warning',
- );
- });
-
it('returns canonical alert overview empty-state copy', () => {
expect(ALERTS_EMPTY_STATE).toBe('No active alerts');
expect(ALERTS_THRESHOLD_HINT).toBe('Alerts will appear here when thresholds are exceeded');
diff --git a/frontend-modern/src/utils/__tests__/dashboardKpiPresentation.test.ts b/frontend-modern/src/utils/__tests__/dashboardKpiPresentation.test.ts
deleted file mode 100644
index b48a538ab6..0000000000
--- a/frontend-modern/src/utils/__tests__/dashboardKpiPresentation.test.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import { getDashboardKpiPresentation } from '@/utils/dashboardKpiPresentation';
-
-describe('dashboardKpiPresentation', () => {
- it('returns canonical KPI presentation for infrastructure/workloads/storage/alerts', () => {
- expect(getDashboardKpiPresentation('infrastructure')).toMatchObject({
- label: 'Infrastructure',
- });
- expect(getDashboardKpiPresentation('workloads')).toMatchObject({
- label: 'Workloads',
- supportingText: 'VMs, containers, and pods',
- });
- expect(getDashboardKpiPresentation('storage')).toMatchObject({
- label: 'Storage',
- });
- expect(getDashboardKpiPresentation('alerts')).toMatchObject({
- label: 'Alerts',
- });
- });
-
- it('exposes canonical KPI card and icon classes', () => {
- expect(getDashboardKpiPresentation('infrastructure').cardClassName).toContain(
- 'border-l-blue-500',
- );
- expect(getDashboardKpiPresentation('workloads').iconClassName).toContain('rose');
- expect(getDashboardKpiPresentation('storage').iconClassName).toContain('cyan');
- expect(getDashboardKpiPresentation('alerts').cardClassName).toContain('border-l-amber-500');
- });
-});
diff --git a/frontend-modern/src/utils/__tests__/dashboardMetricPresentation.test.ts b/frontend-modern/src/utils/__tests__/dashboardMetricPresentation.test.ts
deleted file mode 100644
index c95cac8438..0000000000
--- a/frontend-modern/src/utils/__tests__/dashboardMetricPresentation.test.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import {
- DASHBOARD_MAX_ACTION_ITEMS,
- DASHBOARD_PRIORITY_ORDER,
- formatDashboardDelta,
- formatDashboardPercent,
- getDashboardDeltaColorClass,
- getDashboardPriorityBadgeClass,
- getDashboardStatusBadgeClass,
-} from '@/utils/dashboardMetricPresentation';
-
-describe('dashboardMetricPresentation', () => {
- it('returns canonical status badge classes', () => {
- expect(getDashboardStatusBadgeClass('online')).toContain('bg-emerald-100');
- expect(getDashboardStatusBadgeClass('offline')).toContain('bg-surface-alt');
- expect(getDashboardStatusBadgeClass('warning')).toContain('bg-amber-100');
- expect(getDashboardStatusBadgeClass('critical')).toContain('bg-red-100');
- expect(getDashboardStatusBadgeClass('unknown')).toContain('text-muted');
- });
-
- it('formats percent and deltas canonically', () => {
- expect(formatDashboardPercent(49.6)).toBe('50%');
- expect(formatDashboardDelta(null)).toBeNull();
- expect(formatDashboardDelta(5)).toBe('+5.0%');
- expect(formatDashboardDelta(-0.5)).toBe('-0.5%');
- });
-
- it('returns canonical delta and priority presentation', () => {
- expect(getDashboardDeltaColorClass(10)).toContain('red-500');
- expect(getDashboardDeltaColorClass(3)).toContain('amber-500');
- expect(getDashboardDeltaColorClass(-10)).toContain('emerald-500');
- expect(getDashboardDeltaColorClass(-3)).toContain('blue-500');
- expect(getDashboardDeltaColorClass(0)).toBe('text-muted');
- expect(getDashboardPriorityBadgeClass('critical')).toContain('bg-red-100');
- expect(getDashboardPriorityBadgeClass('high')).toContain('bg-orange-100');
- expect(getDashboardPriorityBadgeClass('medium')).toContain('bg-amber-100');
- expect(getDashboardPriorityBadgeClass('low')).toContain('bg-blue-100');
- expect(DASHBOARD_PRIORITY_ORDER.critical).toBe(0);
- expect(DASHBOARD_MAX_ACTION_ITEMS).toBe(5);
- });
-});
diff --git a/frontend-modern/src/utils/__tests__/dashboardRecoveryPresentation.test.ts b/frontend-modern/src/utils/__tests__/dashboardRecoveryPresentation.test.ts
deleted file mode 100644
index 321a1491be..0000000000
--- a/frontend-modern/src/utils/__tests__/dashboardRecoveryPresentation.test.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import {
- DASHBOARD_RECOVERY_EMPTY_STATE,
- DASHBOARD_RECOVERY_STALE_MESSAGE,
-} from '@/utils/dashboardRecoveryPresentation';
-
-describe('dashboardRecoveryPresentation', () => {
- it('returns canonical recovery dashboard copy', () => {
- expect(DASHBOARD_RECOVERY_EMPTY_STATE).toBe('No recovery data available');
- expect(DASHBOARD_RECOVERY_STALE_MESSAGE).toBe('Last recovery point over 24 hours ago');
- });
-});
diff --git a/frontend-modern/src/utils/__tests__/dashboardStoragePresentation.test.ts b/frontend-modern/src/utils/__tests__/dashboardStoragePresentation.test.ts
deleted file mode 100644
index 0c33289c25..0000000000
--- a/frontend-modern/src/utils/__tests__/dashboardStoragePresentation.test.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import {
- computeDashboardStorageCapacityPercent,
- DASHBOARD_STORAGE_EMPTY_STATE,
- getDashboardStorageCapacityBarClass,
- getDashboardStorageIssueBadges,
-} from '@/utils/dashboardStoragePresentation';
-
-describe('dashboardStoragePresentation', () => {
- it('computes canonical capacity percentage', () => {
- expect(computeDashboardStorageCapacityPercent(50, 200)).toBe(25);
- expect(computeDashboardStorageCapacityPercent(0, 0)).toBe(0);
- });
-
- it('returns canonical issue badges and empty-state copy', () => {
- expect(DASHBOARD_STORAGE_EMPTY_STATE).toBe('No storage resources');
- expect(getDashboardStorageIssueBadges({ warningCount: 2, criticalCount: 1 })).toEqual([
- { label: '2 warnings', className: expect.stringContaining('amber-600') },
- { label: '1 critical', className: expect.stringContaining('red-600') },
- ]);
- expect(getDashboardStorageCapacityBarClass(90)).toContain('bg');
- });
-});
diff --git a/frontend-modern/src/utils/__tests__/dashboardTrendPresentation.test.ts b/frontend-modern/src/utils/__tests__/dashboardTrendPresentation.test.ts
deleted file mode 100644
index 3420cdd577..0000000000
--- a/frontend-modern/src/utils/__tests__/dashboardTrendPresentation.test.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import {
- getDashboardTrendColor,
- getDashboardTrendErrorState,
-} from '@/utils/dashboardTrendPresentation';
-
-describe('dashboardTrendPresentation', () => {
- it('returns stable dashboard trend colors by index', () => {
- expect(getDashboardTrendColor(0)).toBe('#3b82f6');
- expect(getDashboardTrendColor(1)).toBe('#8b5cf6');
- expect(getDashboardTrendColor(7)).toBe('#ef4444');
- });
-
- it('wraps the palette when the index exceeds the set length', () => {
- expect(getDashboardTrendColor(8)).toBe('#3b82f6');
- expect(getDashboardTrendColor(9)).toBe('#8b5cf6');
- });
-
- it('returns the dashboard trend error copy', () => {
- expect(getDashboardTrendErrorState()).toEqual({
- text: 'Unable to load trends',
- });
- });
-});
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index 242b8e911d..f56745d257 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -157,7 +157,6 @@ import recoveryHistoryTableSource from '@/components/Recovery/RecoveryHistoryTab
import recoveryProtectedInventorySectionSource from '@/components/Recovery/RecoveryProtectedInventorySection.tsx?raw';
import recoveryHistorySectionStateSource from '@/components/Recovery/useRecoveryHistorySectionState.ts?raw';
import recoverySurfaceStateSource from '@/features/recovery/useRecoverySurfaceState.ts?raw';
-import dashboardRecoverySource from '@/hooks/useDashboardRecovery.ts?raw';
import recoveryOutcomePresentationSource from '@/utils/recoveryOutcomePresentation.ts?raw';
import recoveryArtifactModePresentationSource from '@/utils/recoveryArtifactModePresentation.ts?raw';
import recoveryFilterChipPresentationSource from '@/utils/recoveryFilterChipPresentation.ts?raw';
@@ -171,76 +170,64 @@ import recoverySummaryPresentationSource from '@/utils/recoverySummaryPresentati
import recoveryTablePresentationSource from '@/utils/recoveryTablePresentation.ts?raw';
import recoveryTimelineChartPresentationSource from '@/utils/recoveryTimelineChartPresentation.ts?raw';
import recoveryTimelinePresentationSource from '@/utils/recoveryTimelinePresentation.ts?raw';
-import dashboardSource from '@/components/Dashboard/Dashboard.tsx?raw';
-import dashboardStateCardsSource from '@/components/Dashboard/DashboardStateCards.tsx?raw';
-import dashboardStatsStripSource from '@/components/Dashboard/DashboardStatsStrip.tsx?raw';
-import dashboardFilterSource from '@/components/Dashboard/DashboardFilter.tsx?raw';
-import dashboardWorkloadTableSource from '@/components/Dashboard/DashboardWorkloadTable.tsx?raw';
-import workloadPanelSource from '@/components/Dashboard/WorkloadPanel.tsx?raw';
-import workloadTableHeaderSource from '@/components/Dashboard/WorkloadTableHeader.tsx?raw';
-import dashboardFilterModelSource from '@/components/Dashboard/dashboardFilterModel.ts?raw';
-import dashboardControlsStateSource from '@/components/Dashboard/useDashboardControlsState.ts?raw';
-import dashboardGuestMetadataStateSource from '@/components/Dashboard/useDashboardGuestMetadataState.ts?raw';
-import dashboardSelectionModelSource from '@/components/Dashboard/dashboardSelectionModel.ts?raw';
-import dashboardSelectionStateSource from '@/components/Dashboard/useDashboardSelectionState.ts?raw';
-import dashboardWorkloadDerivedStateSource from '@/components/Dashboard/useDashboardWorkloadDerivedState.ts?raw';
-import dashboardWorkloadViewportSyncSource from '@/components/Dashboard/useDashboardWorkloadViewportSync.ts?raw';
-import dashboardWorkloadFilterOptionsSource from '@/components/Dashboard/useDashboardWorkloadFilterOptions.ts?raw';
-import dashboardWorkloadFilterConfigModelSource from '@/components/Dashboard/dashboardWorkloadFilterConfigModel.ts?raw';
-import dashboardWorkloadRouteModelSource from '@/components/Dashboard/dashboardWorkloadRouteModel.ts?raw';
-import dashboardWorkloadRouteStateModelSource from '@/components/Dashboard/dashboardWorkloadRouteStateModel.ts?raw';
-import dashboardWorkloadUrlSyncModelSource from '@/components/Dashboard/dashboardWorkloadUrlSyncModel.ts?raw';
-import dashboardWorkloadRouteStateSource from '@/components/Dashboard/useDashboardWorkloadRouteState.ts?raw';
-import dashboardWorkloadUrlSyncSource from '@/components/Dashboard/useDashboardWorkloadUrlSync.ts?raw';
-import dashboardStateSource from '@/components/Dashboard/useDashboardState.ts?raw';
-import dashboardFilterStateSource from '@/components/Dashboard/useDashboardFilterState.ts?raw';
-import workloadTopologySource from '@/components/Dashboard/workloadTopology.ts?raw';
-import groupedTableWindowingSource from '@/components/Dashboard/useGroupedTableWindowing.ts?raw';
-import thresholdSliderModelSource from '@/components/Dashboard/thresholdSliderModel.ts?raw';
-import thresholdSliderStateSource from '@/components/Dashboard/useThresholdSliderState.ts?raw';
-import enhancedCpuBarSource from '@/components/Dashboard/EnhancedCPUBar.tsx?raw';
-import enhancedCpuBarModelSource from '@/components/Dashboard/enhancedCpuBarModel.ts?raw';
-import enhancedCpuBarStateSource from '@/components/Dashboard/useEnhancedCPUBarState.ts?raw';
-import stackedDiskBarSource from '@/components/Dashboard/StackedDiskBar.tsx?raw';
-import stackedDiskBarModelSource from '@/components/Dashboard/stackedDiskBarModel.ts?raw';
-import stackedDiskBarStateSource from '@/components/Dashboard/useStackedDiskBarState.ts?raw';
-import stackedMemoryBarSource from '@/components/Dashboard/StackedMemoryBar.tsx?raw';
-import stackedMemoryBarModelSource from '@/components/Dashboard/stackedMemoryBarModel.ts?raw';
-import stackedMemoryBarStateSource from '@/components/Dashboard/useStackedMemoryBarState.ts?raw';
+import workloadsSurfaceSource from '@/components/Workloads/WorkloadsSurface.tsx?raw';
+import workloadsStateCardsSource from '@/components/Workloads/WorkloadsStateCards.tsx?raw';
+import workloadsStatsStripSource from '@/components/Workloads/WorkloadsStatsStrip.tsx?raw';
+import workloadsFilterSource from '@/components/Workloads/WorkloadsFilter.tsx?raw';
+import workloadsWorkloadTableSource from '@/components/Workloads/WorkloadsTable.tsx?raw';
+import workloadPanelSource from '@/components/Workloads/WorkloadPanel.tsx?raw';
+import workloadTableHeaderSource from '@/components/Workloads/WorkloadTableHeader.tsx?raw';
+import workloadsFilterModelSource from '@/components/Workloads/workloadsFilterModel.ts?raw';
+import workloadsControlsStateSource from '@/components/Workloads/useWorkloadsControlsState.ts?raw';
+import workloadsGuestMetadataStateSource from '@/components/Workloads/useWorkloadGuestMetadataState.ts?raw';
+import workloadSelectionModelSource from '@/components/Workloads/workloadSelectionModel.ts?raw';
+import workloadsSelectionStateSource from '@/components/Workloads/useWorkloadSelectionState.ts?raw';
+import workloadsWorkloadDerivedStateSource from '@/components/Workloads/useWorkloadsDerivedState.ts?raw';
+import workloadsWorkloadViewportSyncSource from '@/components/Workloads/useWorkloadViewportSync.ts?raw';
+import workloadsWorkloadFilterOptionsSource from '@/components/Workloads/useWorkloadFilterOptions.ts?raw';
+import workloadFilterConfigModelSource from '@/components/Workloads/workloadFilterConfigModel.ts?raw';
+import workloadRouteModelSource from '@/components/Workloads/workloadRouteModel.ts?raw';
+import workloadRouteStateModelSource from '@/components/Workloads/workloadRouteStateModel.ts?raw';
+import workloadUrlSyncModelSource from '@/components/Workloads/workloadUrlSyncModel.ts?raw';
+import workloadsWorkloadRouteStateSource from '@/components/Workloads/useWorkloadRouteState.ts?raw';
+import workloadsWorkloadUrlSyncSource from '@/components/Workloads/useWorkloadUrlSync.ts?raw';
+import workloadsStateSource from '@/components/Workloads/useWorkloadsState.ts?raw';
+import workloadsFilterStateSource from '@/components/Workloads/useWorkloadsFilterState.ts?raw';
+import workloadTopologySource from '@/components/Workloads/workloadTopology.ts?raw';
+import groupedTableWindowingSource from '@/components/Workloads/useGroupedTableWindowing.ts?raw';
+import thresholdSliderModelSource from '@/components/Workloads/thresholdSliderModel.ts?raw';
+import thresholdSliderStateSource from '@/components/Workloads/useThresholdSliderState.ts?raw';
+import enhancedCpuBarSource from '@/components/Workloads/EnhancedCPUBar.tsx?raw';
+import enhancedCpuBarModelSource from '@/components/Workloads/enhancedCpuBarModel.ts?raw';
+import enhancedCpuBarStateSource from '@/components/Workloads/useEnhancedCPUBarState.ts?raw';
+import stackedDiskBarSource from '@/components/Workloads/StackedDiskBar.tsx?raw';
+import stackedDiskBarModelSource from '@/components/Workloads/stackedDiskBarModel.ts?raw';
+import stackedDiskBarStateSource from '@/components/Workloads/useStackedDiskBarState.ts?raw';
+import stackedMemoryBarSource from '@/components/Workloads/StackedMemoryBar.tsx?raw';
+import stackedMemoryBarModelSource from '@/components/Workloads/stackedMemoryBarModel.ts?raw';
+import stackedMemoryBarStateSource from '@/components/Workloads/useStackedMemoryBarState.ts?raw';
import workloadsSummarySource from '@/components/Workloads/WorkloadsSummary.tsx?raw';
-import dashboardRouteSource from '@/pages/Dashboard.tsx?raw';
-import dashboardMetricPresentationSource from '@/utils/dashboardMetricPresentation.ts?raw';
-import dashboardTrendPresentationSource from '@/utils/dashboardTrendPresentation.ts?raw';
-import trendChartsSource from '@/features/dashboardOverview/TrendCharts.tsx?raw';
-import thresholdSliderSource from '@/components/Dashboard/ThresholdSlider.tsx?raw';
-import problemResourcesTableSource from '@/features/dashboardOverview/ProblemResourcesTable.tsx?raw';
+import thresholdSliderSource from '@/components/Workloads/ThresholdSlider.tsx?raw';
import problemResourcePresentationSource from '@/utils/problemResourcePresentation.ts?raw';
-import kpiStripSource from '@/features/dashboardOverview/KPIStrip.tsx?raw';
-import recentAlertsPanelSource from '@/components/Alerts/RecentAlertsPanel.tsx?raw';
-import storagePanelSource from '@/components/Storage/DashboardStoragePanel.tsx?raw';
-import recoveryStatusPanelSource from '@/components/Recovery/DashboardRecoveryStatusPanel.tsx?raw';
-import guestRowSource from '@/components/Dashboard/GuestRow.tsx?raw';
-import guestRowCellsSource from '@/components/Dashboard/GuestRowCells.tsx?raw';
-import guestRowModelSource from '@/components/Dashboard/guestRowModel.tsx?raw';
-import guestRowStateSource from '@/components/Dashboard/useGuestRowState.ts?raw';
-import dashboardDiskListSource from '@/components/Dashboard/DiskList.tsx?raw';
-import dashboardDiskListModelSource from '@/components/Dashboard/diskListModel.ts?raw';
-import dashboardDiskListStateSource from '@/components/Dashboard/useDiskListState.ts?raw';
-import metricBarSource from '@/components/Dashboard/MetricBar.tsx?raw';
-import metricBarModelSource from '@/components/Dashboard/metricBarModel.ts?raw';
-import metricBarStateSource from '@/components/Dashboard/useMetricBarState.ts?raw';
-import guestDrawerSource from '@/components/Dashboard/GuestDrawer.tsx?raw';
-import guestDrawerOverviewSource from '@/components/Dashboard/GuestDrawerOverview.tsx?raw';
-import guestDrawerModelSource from '@/components/Dashboard/guestDrawerModel.ts?raw';
-import guestDrawerStateSource from '@/components/Dashboard/useGuestDrawerState.ts?raw';
-import dashboardGuestPresentationSource from '@/utils/dashboardGuestPresentation.ts?raw';
+import guestRowSource from '@/components/Workloads/GuestRow.tsx?raw';
+import guestRowCellsSource from '@/components/Workloads/GuestRowCells.tsx?raw';
+import guestRowModelSource from '@/components/Workloads/guestRowModel.tsx?raw';
+import guestRowStateSource from '@/components/Workloads/useGuestRowState.ts?raw';
+import workloadsDiskListSource from '@/components/Workloads/DiskList.tsx?raw';
+import workloadsDiskListModelSource from '@/components/Workloads/diskListModel.ts?raw';
+import workloadsDiskListStateSource from '@/components/Workloads/useDiskListState.ts?raw';
+import metricBarSource from '@/components/Workloads/MetricBar.tsx?raw';
+import metricBarModelSource from '@/components/Workloads/metricBarModel.ts?raw';
+import metricBarStateSource from '@/components/Workloads/useMetricBarState.ts?raw';
+import guestDrawerSource from '@/components/Workloads/GuestDrawer.tsx?raw';
+import guestDrawerOverviewSource from '@/components/Workloads/GuestDrawerOverview.tsx?raw';
+import guestDrawerModelSource from '@/components/Workloads/guestDrawerModel.ts?raw';
+import guestDrawerStateSource from '@/components/Workloads/useGuestDrawerState.ts?raw';
+import workloadGuestPresentationSource from '@/utils/workloadGuestPresentation.ts?raw';
import orgScopeSource from '@/utils/orgScope.ts?raw';
-import workloadsSource from '@/utils/workloads.ts?raw';
+import workloadsUtilitySource from '@/utils/workloads.ts?raw';
import infrastructureSummaryCacheSource from '@/utils/infrastructureSummaryCache.ts?raw';
-import dashboardStoragePresentationSource from '@/utils/dashboardStoragePresentation.ts?raw';
-import dashboardRecoveryPresentationSource from '@/utils/dashboardRecoveryPresentation.ts?raw';
-import dashboardKpiPresentationSource from '@/utils/dashboardKpiPresentation.ts?raw';
-import dashboardEmptyStatePresentationSource from '@/utils/dashboardEmptyStatePresentation.ts?raw';
+import workloadEmptyStatePresentationSource from '@/utils/workloadEmptyStatePresentation.ts?raw';
import throughputPresentationSource from '@/utils/throughputPresentation.ts?raw';
import resourceChangeSummarySource from '@/components/Infrastructure/ResourceChangeSummary.tsx?raw';
import resourceChangePresentationSource from '@/utils/resourceChangePresentation.ts?raw';
@@ -699,203 +686,203 @@ describe('frontend resource type boundaries', () => {
expect(storageSourcesSource).toContain('titleCaseDelimitedLabel');
expect(storageSourcesSource).toContain('getAllFilterOptionLabel');
expect(storageSourcesSource).not.toContain('const titleCaseLabel =');
- expect(workloadsSource).toContain('export const normalizeWorkloadViewModeParam');
+ expect(workloadsUtilitySource).toContain('export const normalizeWorkloadViewModeParam');
expect(orgScopeSource).toContain("export const DEFAULT_ORG_SCOPE = 'default'");
expect(orgScopeSource).toContain('export const normalizeOrgScope');
- expect(dashboardSource).toContain('useDashboardState');
- expect(dashboardSource).toContain('DashboardStateCards');
- expect(dashboardSource).toContain('DashboardStatsStrip');
- expect(dashboardSource).toContain('DashboardWorkloadTable');
- expect(dashboardSource).not.toContain('const [search, setSearch] = createSignal(');
- expect(dashboardStateSource).toContain('useDashboardControlsState');
- expect(dashboardStateSource).toContain('useDashboardGuestMetadataState');
- expect(dashboardStateSource).toContain('useDashboardSelectionState');
- expect(dashboardStateSource).toContain('useDashboardWorkloadDerivedState');
- expect(dashboardStateSource).toContain('useDashboardWorkloadRouteState');
- expect(dashboardStateSource).toContain('filterWorkloads(params)');
- expect(dashboardStateSource).not.toContain('useBreakpoint');
- expect(dashboardStateSource).not.toContain('useColumnVisibility');
- expect(dashboardStateSource).not.toContain('blurFocusedTypeToSearch');
- expect(dashboardWorkloadRouteStateSource).toContain('useDashboardWorkloadUrlSync');
- expect(dashboardWorkloadRouteStateSource).not.toContain('normalizeWorkloadViewModeParam');
- expect(dashboardSource).not.toContain('function normalizeViewModeParam');
- expect(dashboardSource).not.toContain('workloadSummaryGuestId');
- expect(dashboardSource).not.toContain('createMemo(() => getCanonicalWorkloadId(guest()))');
+ expect(workloadsSurfaceSource).toContain('useWorkloadsState');
+ expect(workloadsSurfaceSource).toContain('WorkloadsStateCards');
+ expect(workloadsSurfaceSource).toContain('WorkloadsStatsStrip');
+ expect(workloadsSurfaceSource).toContain('WorkloadsTable');
+ expect(workloadsSurfaceSource).not.toContain('const [search, setSearch] = createSignal(');
+ expect(workloadsStateSource).toContain('useWorkloadsControlsState');
+ expect(workloadsStateSource).toContain('useWorkloadGuestMetadataState');
+ expect(workloadsStateSource).toContain('useWorkloadSelectionState');
+ expect(workloadsStateSource).toContain('useWorkloadsDerivedState');
+ expect(workloadsStateSource).toContain('useWorkloadRouteState');
+ expect(workloadsStateSource).toContain('filterWorkloads(params)');
+ expect(workloadsStateSource).not.toContain('useBreakpoint');
+ expect(workloadsStateSource).not.toContain('useColumnVisibility');
+ expect(workloadsStateSource).not.toContain('blurFocusedTypeToSearch');
+ expect(workloadsWorkloadRouteStateSource).toContain('useWorkloadUrlSync');
+ expect(workloadsWorkloadRouteStateSource).not.toContain('normalizeWorkloadViewModeParam');
+ expect(workloadsSurfaceSource).not.toContain('function normalizeViewModeParam');
+ expect(workloadsSurfaceSource).not.toContain('workloadSummaryGuestId');
+ expect(workloadsSurfaceSource).not.toContain('createMemo(() => getCanonicalWorkloadId(guest()))');
expect(workloadPanelSource).toContain('createMemo(() => getCanonicalWorkloadId(guest()))');
- expect(dashboardWorkloadTableSource).not.toContain(
+ expect(workloadsWorkloadTableSource).not.toContain(
'createMemo(() => getCanonicalWorkloadId(guest()))',
);
- expect(dashboardGuestMetadataStateSource).toContain('normalizeOrgScope(getOrgID())');
- expect(dashboardStateSource).not.toContain("const DEFAULT_ORG_SCOPE = 'default'");
- expect(dashboardStateSource).not.toContain('const normalizeOrgScope =');
- expect(dashboardStateSource).not.toContain('GuestMetadataAPI.getAllMetadata()');
- expect(dashboardGuestMetadataStateSource).toContain('GuestMetadataAPI.getAllMetadata()');
- expect(dashboardGuestMetadataStateSource).toContain("eventBus.on('org_switched'");
- expect(dashboardStateSource).not.toContain('buildWorkloadsPath({');
- expect(dashboardStateSource).not.toContain('parseWorkloadsLinkSearch');
- expect(dashboardStateSource).not.toContain('const [selectedGuestId, setSelectedGuestIdRaw]');
- expect(dashboardStateSource).not.toContain('const [hoveredWorkloadId, setHoveredWorkloadId]');
- expect(dashboardStateSource).not.toContain('groupWorkloads(');
- expect(dashboardStateSource).not.toContain('computeWorkloadStats(');
- expect(dashboardStateSource).not.toContain('computeWorkloadIOEmphasis(');
- expect(dashboardStateSource).not.toContain('buildNodeByInstance(');
- expect(dashboardStateSource).not.toContain('buildGuestParentNodeMap(');
- expect(dashboardWorkloadRouteStateSource).not.toContain('buildWorkloadsPath({');
- expect(dashboardWorkloadRouteStateSource).not.toContain(
+ expect(workloadsGuestMetadataStateSource).toContain('normalizeOrgScope(getOrgID())');
+ expect(workloadsStateSource).not.toContain("const DEFAULT_ORG_SCOPE = 'default'");
+ expect(workloadsStateSource).not.toContain('const normalizeOrgScope =');
+ expect(workloadsStateSource).not.toContain('GuestMetadataAPI.getAllMetadata()');
+ expect(workloadsGuestMetadataStateSource).toContain('GuestMetadataAPI.getAllMetadata()');
+ expect(workloadsGuestMetadataStateSource).toContain("eventBus.on('org_switched'");
+ expect(workloadsStateSource).not.toContain('buildWorkloadsPath({');
+ expect(workloadsStateSource).not.toContain('parseWorkloadsLinkSearch');
+ expect(workloadsStateSource).not.toContain('const [selectedGuestId, setSelectedGuestIdRaw]');
+ expect(workloadsStateSource).not.toContain('const [hoveredWorkloadId, setHoveredWorkloadId]');
+ expect(workloadsStateSource).not.toContain('groupWorkloads(');
+ expect(workloadsStateSource).not.toContain('computeWorkloadStats(');
+ expect(workloadsStateSource).not.toContain('computeWorkloadIOEmphasis(');
+ expect(workloadsStateSource).not.toContain('buildNodeByInstance(');
+ expect(workloadsStateSource).not.toContain('buildGuestParentNodeMap(');
+ expect(workloadsWorkloadRouteStateSource).not.toContain('buildWorkloadsPath({');
+ expect(workloadsWorkloadRouteStateSource).not.toContain(
'const workloadNodeOptions = createMemo',
);
- expect(dashboardWorkloadRouteStateSource).not.toContain(
+ expect(workloadsWorkloadRouteStateSource).not.toContain(
'const containerRuntimeFilterConfig = createMemo',
);
- expect(dashboardWorkloadRouteStateSource).not.toContain(
+ expect(workloadsWorkloadRouteStateSource).not.toContain(
'const [handledTypeParam, setHandledTypeParam]',
);
- expect(dashboardWorkloadRouteStateSource).not.toContain(
+ expect(workloadsWorkloadRouteStateSource).not.toContain(
'const [workloadsRouteActive, setWorkloadsRouteActive] = createSignal(false)',
);
- expect(dashboardWorkloadRouteStateSource).toContain(
- "from './dashboardWorkloadRouteStateModel'",
- );
- expect(dashboardWorkloadRouteStateSource).toContain('resolveDashboardWorkloadNodeSelection({');
- expect(dashboardWorkloadRouteStateSource).toContain('DASHBOARD_WORKLOAD_ROUTE_RESET_STATE');
- expect(dashboardWorkloadUrlSyncSource).not.toContain('buildWorkloadsPath({');
- expect(dashboardWorkloadUrlSyncSource).not.toContain('normalizeWorkloadViewModeParam');
- expect(dashboardWorkloadUrlSyncSource).not.toContain('parseWorkloadsLinkSearch');
- expect(dashboardWorkloadUrlSyncSource).toContain("from './dashboardWorkloadRouteModel'");
- expect(dashboardWorkloadUrlSyncSource).toContain("from './dashboardWorkloadUrlSyncModel'");
- expect(dashboardWorkloadUrlSyncSource).toContain(
+ expect(workloadsWorkloadRouteStateSource).toContain(
+ "from './workloadRouteStateModel'",
+ );
+ expect(workloadsWorkloadRouteStateSource).toContain('resolveWorkloadsWorkloadNodeSelection({');
+ expect(workloadsWorkloadRouteStateSource).toContain('WORKLOADS_WORKLOAD_ROUTE_RESET_STATE');
+ expect(workloadsWorkloadUrlSyncSource).not.toContain('buildWorkloadsPath({');
+ expect(workloadsWorkloadUrlSyncSource).not.toContain('normalizeWorkloadViewModeParam');
+ expect(workloadsWorkloadUrlSyncSource).not.toContain('parseWorkloadsLinkSearch');
+ expect(workloadsWorkloadUrlSyncSource).toContain("from './workloadRouteModel'");
+ expect(workloadsWorkloadUrlSyncSource).toContain("from './workloadUrlSyncModel'");
+ expect(workloadsWorkloadUrlSyncSource).toContain(
'const [handledTypeParam, setHandledTypeParam]',
);
- expect(dashboardWorkloadUrlSyncSource).toContain('parseDashboardWorkloadUrlParams');
- expect(dashboardWorkloadUrlSyncSource).toContain(
- 'resolveDashboardManagedWorkloadsNavigateTarget({',
+ expect(workloadsWorkloadUrlSyncSource).toContain('parseWorkloadsWorkloadUrlParams');
+ expect(workloadsWorkloadUrlSyncSource).toContain(
+ 'resolveWorkloadsManagedWorkloadsNavigateTarget({',
);
- expect(dashboardWorkloadUrlSyncModelSource).toContain('parseWorkloadsLinkSearch(search)');
- expect(dashboardWorkloadUrlSyncModelSource).toContain('buildWorkloadsPath({');
- expect(dashboardWorkloadUrlSyncModelSource).toContain(
- 'resolveDashboardManagedWorkloadsNavigateTarget',
+ expect(workloadUrlSyncModelSource).toContain('parseWorkloadsLinkSearch(search)');
+ expect(workloadUrlSyncModelSource).toContain('buildWorkloadsPath({');
+ expect(workloadUrlSyncModelSource).toContain(
+ 'resolveWorkloadsManagedWorkloadsNavigateTarget',
);
- expect(dashboardWorkloadUrlSyncModelSource).toContain('resolveDashboardWorkloadRuntimeParam');
- expect(dashboardWorkloadUrlSyncModelSource).toContain(
+ expect(workloadUrlSyncModelSource).toContain('resolveWorkloadsWorkloadRuntimeParam');
+ expect(workloadUrlSyncModelSource).toContain(
'normalizeWorkloadViewModeParam(params.type)',
);
- expect(dashboardControlsStateSource).toContain('useBreakpoint');
- expect(dashboardControlsStateSource).toContain('useColumnVisibility');
- expect(dashboardControlsStateSource).toContain('usePersistentSignal');
- expect(dashboardControlsStateSource).toContain('blurFocusedTypeToSearch');
- expect(dashboardControlsStateSource).toContain('DEFAULT_DASHBOARD_SORT_KEY');
- expect(dashboardWorkloadRouteStateSource).toContain('useDashboardWorkloadFilterOptions');
- expect(dashboardWorkloadFilterOptionsSource).toContain(
- "from './dashboardWorkloadFilterConfigModel'",
+ expect(workloadsControlsStateSource).toContain('useBreakpoint');
+ expect(workloadsControlsStateSource).toContain('useColumnVisibility');
+ expect(workloadsControlsStateSource).toContain('usePersistentSignal');
+ expect(workloadsControlsStateSource).toContain('blurFocusedTypeToSearch');
+ expect(workloadsControlsStateSource).toContain('DEFAULT_WORKLOADS_SORT_KEY');
+ expect(workloadsWorkloadRouteStateSource).toContain('useWorkloadFilterOptions');
+ expect(workloadsWorkloadFilterOptionsSource).toContain(
+ "from './workloadFilterConfigModel'",
);
- expect(dashboardWorkloadFilterOptionsSource).toContain(
- 'buildDashboardWorkloadNodeOptions(options.allGuests())',
+ expect(workloadsWorkloadFilterOptionsSource).toContain(
+ 'buildWorkloadNodeOptions(options.allGuests())',
);
- expect(dashboardWorkloadFilterOptionsSource).not.toContain(
+ expect(workloadsWorkloadFilterOptionsSource).not.toContain(
'const onContextChange = (value: string) =>',
);
- expect(dashboardWorkloadFilterOptionsSource).toContain(
- 'buildDashboardContainerRuntimeFilterConfig({',
+ expect(workloadsWorkloadFilterOptionsSource).toContain(
+ 'buildWorkloadsContainerRuntimeFilterConfig({',
);
- expect(dashboardWorkloadFilterOptionsSource).toContain('buildDashboardHostFilterConfig({');
- expect(dashboardWorkloadFilterOptionsSource).toContain('buildDashboardNamespaceFilterConfig({');
- expect(dashboardWorkloadFilterConfigModelSource).toContain(
- 'export const buildDashboardContainerRuntimeFilterConfig',
+ expect(workloadsWorkloadFilterOptionsSource).toContain('buildWorkloadsHostFilterConfig({');
+ expect(workloadsWorkloadFilterOptionsSource).toContain('buildWorkloadsNamespaceFilterConfig({');
+ expect(workloadFilterConfigModelSource).toContain(
+ 'export const buildWorkloadsContainerRuntimeFilterConfig',
);
- expect(dashboardWorkloadFilterConfigModelSource).toContain(
- 'export const buildDashboardHostFilterConfig',
+ expect(workloadFilterConfigModelSource).toContain(
+ 'export const buildWorkloadsHostFilterConfig',
);
- expect(dashboardWorkloadFilterConfigModelSource).toContain('getAllFilterOptionLabel');
- expect(dashboardWorkloadFilterConfigModelSource).toContain('DASHBOARD_WORKLOAD_TYPE_OPTIONS');
- expect(dashboardWorkloadFilterConfigModelSource).toContain(
- 'export const buildDashboardNamespaceFilterConfig',
+ expect(workloadFilterConfigModelSource).toContain('getAllFilterOptionLabel');
+ expect(workloadFilterConfigModelSource).toContain('WORKLOAD_TYPE_OPTIONS');
+ expect(workloadFilterConfigModelSource).toContain(
+ 'export const buildWorkloadsNamespaceFilterConfig',
);
- expect(dashboardWorkloadRouteModelSource).toContain(
- 'export const deserializeDashboardWorkloadViewMode',
+ expect(workloadRouteModelSource).toContain(
+ 'export const deserializeWorkloadViewMode',
);
- expect(dashboardWorkloadRouteModelSource).toContain(
+ expect(workloadRouteModelSource).toContain(
"normalizeWorkloadViewModeParam(raw) ?? 'all'",
);
- expect(dashboardWorkloadRouteModelSource).not.toContain(
- 'export const buildDashboardContainerRuntimeFilterConfig',
+ expect(workloadRouteModelSource).not.toContain(
+ 'export const buildWorkloadsContainerRuntimeFilterConfig',
);
- expect(dashboardWorkloadRouteModelSource).not.toContain(
- 'export const buildDashboardHostFilterConfig',
+ expect(workloadRouteModelSource).not.toContain(
+ 'export const buildWorkloadsHostFilterConfig',
);
- expect(dashboardWorkloadRouteModelSource).not.toContain(
- 'export const buildDashboardNamespaceFilterConfig',
+ expect(workloadRouteModelSource).not.toContain(
+ 'export const buildWorkloadsNamespaceFilterConfig',
);
- expect(dashboardWorkloadRouteStateModelSource).toContain(
- 'export const DASHBOARD_WORKLOAD_ROUTE_RESET_STATE',
+ expect(workloadRouteStateModelSource).toContain(
+ 'export const WORKLOADS_WORKLOAD_ROUTE_RESET_STATE',
);
- expect(dashboardWorkloadRouteStateModelSource).toContain(
- 'export const resolveDashboardWorkloadNodeSelection',
+ expect(workloadRouteStateModelSource).toContain(
+ 'export const resolveWorkloadsWorkloadNodeSelection',
);
- expect(dashboardWorkloadRouteStateModelSource).toContain(
- 'export const deserializeDashboardContainerRuntime',
+ expect(workloadRouteStateModelSource).toContain(
+ 'export const deserializeWorkloadsContainerRuntime',
);
- expect(dashboardWorkloadDerivedStateSource).toContain('groupWorkloads(');
- expect(dashboardWorkloadDerivedStateSource).toContain('computeWorkloadStats(');
- expect(dashboardWorkloadDerivedStateSource).toContain('computeWorkloadIOEmphasis(');
- expect(dashboardWorkloadDerivedStateSource).toContain("from './workloadTopology'");
- expect(dashboardWorkloadDerivedStateSource).toContain('buildNodeByInstance(');
- expect(dashboardWorkloadDerivedStateSource).toContain('buildGuestParentNodeMap(');
- expect(dashboardWorkloadRouteStateSource).not.toContain("from './workloadTopology'");
- expect(dashboardWorkloadRouteModelSource).toContain("from './workloadTopology'");
- expect(dashboardWorkloadRouteModelSource).toContain('workloadHostScopeId');
- expect(dashboardWorkloadRouteModelSource).toContain('getKubernetesContextKey');
- expect(dashboardWorkloadRouteStateSource).toContain('isWorkloadsRoute,');
- expect(dashboardSelectionStateSource).toContain(
+ expect(workloadsWorkloadDerivedStateSource).toContain('groupWorkloads(');
+ expect(workloadsWorkloadDerivedStateSource).toContain('computeWorkloadStats(');
+ expect(workloadsWorkloadDerivedStateSource).toContain('computeWorkloadIOEmphasis(');
+ expect(workloadsWorkloadDerivedStateSource).toContain("from './workloadTopology'");
+ expect(workloadsWorkloadDerivedStateSource).toContain('buildNodeByInstance(');
+ expect(workloadsWorkloadDerivedStateSource).toContain('buildGuestParentNodeMap(');
+ expect(workloadsWorkloadRouteStateSource).not.toContain("from './workloadTopology'");
+ expect(workloadRouteModelSource).toContain("from './workloadTopology'");
+ expect(workloadRouteModelSource).toContain('workloadHostScopeId');
+ expect(workloadRouteModelSource).toContain('getKubernetesContextKey');
+ expect(workloadsWorkloadRouteStateSource).toContain('isWorkloadsRoute,');
+ expect(workloadsSelectionStateSource).toContain(
'const [selectedGuestId, setSelectedGuestIdRaw]',
);
- expect(dashboardSelectionStateSource).toContain(
+ expect(workloadsSelectionStateSource).toContain(
'const [hoveredWorkloadId, setHoveredWorkloadId]',
);
- expect(dashboardSelectionStateSource).toContain('setHandledResourceId(null)');
- expect(dashboardSelectionStateSource).toContain("from './dashboardSelectionModel'");
- expect(dashboardSelectionStateSource).not.toContain('parseWorkloadsLinkSearch');
- expect(dashboardSelectionStateSource).not.toContain('getCanonicalWorkloadId');
- expect(dashboardSelectionModelSource).toContain('parseWorkloadsLinkSearch(search)');
- expect(dashboardSelectionModelSource).toContain('getCanonicalWorkloadId');
- expect(dashboardSelectionModelSource).toContain('resolveDashboardResourceSelection');
- expect(dashboardSelectionModelSource).toContain('dashboardHasHoveredWorkload');
- expect(dashboardStateSource).not.toContain('const guestId = () => {');
- expect(dashboardFilterSource).toContain('useDashboardFilterState');
- expect(dashboardFilterSource).not.toContain('const [filtersOpen, setFiltersOpen] =');
- expect(dashboardFilterSource).not.toContain('useBreakpoint');
- expect(dashboardFilterSource).not.toContain("props.setSortKey('name')");
- expect(dashboardFilterStateSource).toContain('countActiveDashboardFilters');
- expect(dashboardFilterStateSource).not.toContain('props.containerRuntimeFilter?.onChange');
- expect(dashboardFilterStateSource).toContain('useBreakpoint');
- expect(dashboardFilterStateSource).toContain('DEFAULT_DASHBOARD_SORT_KEY');
- expect(dashboardFilterModelSource).toContain('export const countActiveDashboardFilters');
- expect(dashboardFilterModelSource).toContain('export const hasActiveDashboardFilters');
- expect(dashboardFilterModelSource).toContain(
- "DEFAULT_DASHBOARD_SORT_KEY: DashboardSortKey = 'type'",
- );
- expect(dashboardStateSource).not.toContain('const containerRuntimeFilterConfig = createMemo');
- expect(dashboardStateSource).not.toContain('useGroupedTableWindowing');
- expect(dashboardWorkloadRouteStateSource).toContain('useDashboardWorkloadUrlSync');
- expect(dashboardWorkloadRouteStateSource).toContain('containerRuntimeFilterConfig');
- expect(dashboardWorkloadRouteStateSource).toContain('hostFilterConfig');
- expect(dashboardWorkloadRouteStateSource).toContain('namespaceFilterConfig');
- expect(dashboardWorkloadDerivedStateSource).toContain('useGroupedTableWindowing');
- expect(dashboardWorkloadDerivedStateSource).toContain('useDashboardWorkloadViewportSync');
- expect(dashboardWorkloadDerivedStateSource).not.toContain('window.addEventListener');
- expect(dashboardWorkloadDerivedStateSource).not.toContain('getBoundingClientRect');
- expect(dashboardStateSource).not.toContain('const DEFAULT_WINDOW_SIZE =');
- expect(dashboardStateSource).not.toContain('const DEFAULT_ENABLE_THRESHOLD =');
- expect(dashboardStateSource).not.toContain('const DEFAULT_OVERSCAN_ROWS =');
+ expect(workloadsSelectionStateSource).toContain('setHandledResourceId(null)');
+ expect(workloadsSelectionStateSource).toContain("from './workloadSelectionModel'");
+ expect(workloadsSelectionStateSource).not.toContain('parseWorkloadsLinkSearch');
+ expect(workloadsSelectionStateSource).not.toContain('getCanonicalWorkloadId');
+ expect(workloadSelectionModelSource).toContain('parseWorkloadsLinkSearch(search)');
+ expect(workloadSelectionModelSource).toContain('getCanonicalWorkloadId');
+ expect(workloadSelectionModelSource).toContain('resolveWorkloadResourceSelection');
+ expect(workloadSelectionModelSource).toContain('workloadsHasHoveredWorkload');
+ expect(workloadsStateSource).not.toContain('const guestId = () => {');
+ expect(workloadsFilterSource).toContain('useWorkloadsFilterState');
+ expect(workloadsFilterSource).not.toContain('const [filtersOpen, setFiltersOpen] =');
+ expect(workloadsFilterSource).not.toContain('useBreakpoint');
+ expect(workloadsFilterSource).not.toContain("props.setSortKey('name')");
+ expect(workloadsFilterStateSource).toContain('countActiveWorkloadsFilters');
+ expect(workloadsFilterStateSource).not.toContain('props.containerRuntimeFilter?.onChange');
+ expect(workloadsFilterStateSource).toContain('useBreakpoint');
+ expect(workloadsFilterStateSource).toContain('DEFAULT_WORKLOADS_SORT_KEY');
+ expect(workloadsFilterModelSource).toContain('export const countActiveWorkloadsFilters');
+ expect(workloadsFilterModelSource).toContain('export const hasActiveWorkloadsFilters');
+ expect(workloadsFilterModelSource).toContain(
+ "DEFAULT_WORKLOADS_SORT_KEY: WorkloadsSortKey = 'type'",
+ );
+ expect(workloadsStateSource).not.toContain('const containerRuntimeFilterConfig = createMemo');
+ expect(workloadsStateSource).not.toContain('useGroupedTableWindowing');
+ expect(workloadsWorkloadRouteStateSource).toContain('useWorkloadUrlSync');
+ expect(workloadsWorkloadRouteStateSource).toContain('containerRuntimeFilterConfig');
+ expect(workloadsWorkloadRouteStateSource).toContain('hostFilterConfig');
+ expect(workloadsWorkloadRouteStateSource).toContain('namespaceFilterConfig');
+ expect(workloadsWorkloadDerivedStateSource).toContain('useGroupedTableWindowing');
+ expect(workloadsWorkloadDerivedStateSource).toContain('useWorkloadViewportSync');
+ expect(workloadsWorkloadDerivedStateSource).not.toContain('window.addEventListener');
+ expect(workloadsWorkloadDerivedStateSource).not.toContain('getBoundingClientRect');
+ expect(workloadsStateSource).not.toContain('const DEFAULT_WINDOW_SIZE =');
+ expect(workloadsStateSource).not.toContain('const DEFAULT_ENABLE_THRESHOLD =');
+ expect(workloadsStateSource).not.toContain('const DEFAULT_OVERSCAN_ROWS =');
expect(groupedTableWindowingSource).toContain('const DEFAULT_WINDOW_SIZE');
expect(groupedTableWindowingSource).toContain('const DEFAULT_ENABLE_THRESHOLD');
expect(groupedTableWindowingSource).toContain('const DEFAULT_OVERSCAN_ROWS');
expect(groupedTableWindowingSource).toContain('getVisibleSlice');
expect(groupedTableWindowingSource).toContain('onScroll');
expect(groupedTableWindowingSource).toContain('revealIndex');
- expect(dashboardWorkloadViewportSyncSource).toContain('window.addEventListener');
- expect(dashboardWorkloadViewportSyncSource).toContain('window.removeEventListener');
- expect(dashboardWorkloadViewportSyncSource).toContain('getBoundingClientRect');
- expect(dashboardWorkloadViewportSyncSource).toContain('groupedWindowing.onScroll');
+ expect(workloadsWorkloadViewportSyncSource).toContain('window.addEventListener');
+ expect(workloadsWorkloadViewportSyncSource).toContain('window.removeEventListener');
+ expect(workloadsWorkloadViewportSyncSource).toContain('getBoundingClientRect');
+ expect(workloadsWorkloadViewportSyncSource).toContain('groupedWindowing.onScroll');
expect(workloadTopologySource).toContain('export const workloadNodeScopeId');
expect(workloadTopologySource).toContain('export const getKubernetesContextKey');
expect(workloadTopologySource).toContain('export const getWorkloadDockerHostId');
@@ -994,7 +981,7 @@ describe('frontend resource type boundaries', () => {
expect(resourceDetailDrawerOverviewSource).toContain("from '@/components/shared/TagBadges'");
expect(resourceDetailDrawerOverviewSource).toContain('getAllFilterOptionLabel');
expect(resourceDetailDrawerOverviewSource).not.toContain(
- "from '@/components/Dashboard/TagBadges'",
+ "from '@/components/Workloads/TagBadges'",
);
expect(resourceDetailDrawerShellSource).toContain("from './ResourceDetailDrawerOverviewTab'");
expect(resourceDetailDrawerShellSource).toContain("from './ResourceDetailDrawerDebugTab'");
@@ -1058,12 +1045,12 @@ describe('frontend resource type boundaries', () => {
expect(guestDrawerSource).not.toContain('WebInterfaceUrlField');
expect(guestDrawerOverviewSource).toContain('WebInterfaceUrlField');
expect(guestDrawerOverviewSource).toContain('DiskList');
- expect(dashboardStateCardsSource).toContain('dashboardDisconnectedState().actionLabel');
- expect(dashboardWorkloadTableSource).toContain('WorkloadTableHeader');
- expect(dashboardWorkloadTableSource).toContain('WorkloadPanel');
- expect(dashboardWorkloadTableSource).not.toContain('<TableHead');
- expect(dashboardWorkloadTableSource).not.toContain('NodeGroupHeader');
- expect(dashboardWorkloadTableSource).not.toContain('GuestDrawer');
+ expect(workloadsStateCardsSource).toContain('workloadsDisconnectedState().actionLabel');
+ expect(workloadsWorkloadTableSource).toContain('WorkloadTableHeader');
+ expect(workloadsWorkloadTableSource).toContain('WorkloadPanel');
+ expect(workloadsWorkloadTableSource).not.toContain('<TableHead');
+ expect(workloadsWorkloadTableSource).not.toContain('NodeGroupHeader');
+ expect(workloadsWorkloadTableSource).not.toContain('GuestDrawer');
expect(workloadTableHeaderSource).toContain('TableHead');
expect(workloadTableHeaderSource).toContain('col.sortKey as WorkloadSortKey');
expect(workloadTableHeaderSource).not.toContain('NodeGroupHeader');
@@ -1071,7 +1058,7 @@ describe('frontend resource type boundaries', () => {
expect(workloadPanelSource).toContain('GuestDrawer');
expect(workloadPanelSource).toContain('createMemo(() => getCanonicalWorkloadId(guest()))');
expect(workloadPanelSource).not.toContain('TableHead');
- expect(dashboardStatsStripSource).toContain('totalStats().running');
+ expect(workloadsStatsStripSource).toContain('totalStats().running');
expect(emptyStateSource).toContain('getEmptyStatePresentation');
expect(emptyStateSource).not.toContain('const iconBgClass: Record<EmptyStateTone, string> =');
expect(emptyStateSource).not.toContain(
@@ -1101,8 +1088,6 @@ describe('frontend resource type boundaries', () => {
"const ISSUE_RAIL_CLASS: Record<Exclude<IssueTone, 'none'>, string>",
);
expect(recoverySummarySource).not.toContain('const normalizeOutcome =');
- expect(dashboardRecoverySource).toContain('normalizeRecoveryOutcome');
- expect(dashboardRecoverySource).not.toContain('const normalizeOutcome =');
expect(recoveryArtifactModePresentationSource).toContain(
'export function getRecoveryArtifactModePresentation',
);
@@ -1402,20 +1387,6 @@ describe('frontend resource type boundaries', () => {
);
expect(recoverySummarySource).not.toContain('function getAttentionChipClass(');
expect(recoverySummarySource).not.toContain('function getAttentionDotClass(');
- expect(dashboardMetricPresentationSource).toContain(
- 'export function getDashboardStatusBadgeClass',
- );
- expect(dashboardMetricPresentationSource).toContain(
- 'export function getDashboardPriorityBadgeClass',
- );
- expect(trendChartsSource).toContain('getDashboardTrendColor');
- expect(trendChartsSource).toContain('getDashboardTrendErrorState');
- expect(trendChartsSource).not.toContain('RESOURCE_COLORS');
- expect(trendChartsSource).not.toContain('Unable to load trends');
- expect(dashboardTrendPresentationSource).toContain('export function getDashboardTrendColor');
- expect(dashboardTrendPresentationSource).toContain(
- 'export function getDashboardTrendErrorState',
- );
expect(systemSettingsPresentationSource).toContain('export const PVE_POLLING_PRESETS');
expect(systemSettingsPresentationSource).toContain('export const BACKUP_INTERVAL_OPTIONS');
expect(systemSettingsPresentationSource).toContain(
@@ -1687,48 +1658,9 @@ describe('frontend resource type boundaries', () => {
);
expect(agentProfileSuggestionPresentationSource).toContain('titleCaseDelimitedLabel');
expect(agentProfileSuggestionPresentationSource).not.toContain('const titleize =');
- expect(trendChartsSource).toContain("segmentedButtonClass(active(), false, 'accent')");
- expect(trendChartsSource).not.toContain(
- "'px-2 py-0.5 rounded bg-blue-600 text-white text-[11px] font-medium'",
- );
- expect(problemResourcesTableSource).toContain('getProblemResourceStatusVariant');
- expect(problemResourcesTableSource).not.toContain(
- 'function statusVariant(pr: ProblemResource)',
- );
expect(problemResourcePresentationSource).toContain(
'export function getProblemResourceStatusVariant',
);
- expect(kpiStripSource).toContain('getDashboardAlertTone');
- expect(kpiStripSource).toContain('getDashboardKpiPresentation');
- expect(kpiStripSource).not.toContain('const alertsTone =');
- expect(kpiStripSource).not.toContain('border-l-[3px] border-l-blue-500');
- expect(dashboardKpiPresentationSource).toContain('export function getDashboardKpiPresentation');
- expect(recentAlertsPanelSource).toContain('getAlertSeverityCompactLabel');
- expect(recentAlertsPanelSource).toContain('@/utils/alertOverviewPresentation');
- 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');
- expect(recoveryStatusPanelSource).not.toContain('Last recovery point over 24 hours ago');
- expect(dashboardStoragePresentationSource).toContain(
- 'export function computeDashboardStorageCapacityPercent',
- );
- expect(dashboardStoragePresentationSource).toContain(
- 'export function getDashboardStorageIssueBadges',
- );
- expect(dashboardRecoveryPresentationSource).toContain(
- 'export const DASHBOARD_RECOVERY_EMPTY_STATE',
- );
expect(diskListSource).toContain('getTemperatureTextClass');
expect(diskListSource).not.toContain('const getTemperatureTone =');
expect(diskListSource).toContain('getPhysicalDiskHealthStatus');
@@ -3296,8 +3228,8 @@ describe('frontend resource type boundaries', () => {
expect(guestDrawerSource).not.toContain('const discoveryResourceType = () =>');
expect(guestDrawerSource).not.toContain('const urlTargetLabel = () =>');
expect(guestDrawerModelSource).toContain('export const getGuestDrawerBackupPresentation');
- expect(workloadsSource).toContain('export const getDiscoveryResourceTypeForWorkload');
- expect(workloadsSource).toContain('export const getWebInterfaceTargetLabelForWorkload');
+ expect(workloadsUtilitySource).toContain('export const getDiscoveryResourceTypeForWorkload');
+ expect(workloadsUtilitySource).toContain('export const getWebInterfaceTargetLabelForWorkload');
expect(infrastructureDetailsDrawerSource).toContain('getDiscoveryLoadingState');
expect(resourceDetailDrawerSource).toContain('getDiscoveryLoadingState');
expect(discoveryTabSource).not.toContain('const getURLSuggestionSourceLabel =');
@@ -4589,86 +4521,69 @@ describe('frontend resource type boundaries', () => {
expect(remediationPresentationSource).toContain('export function getRemediationPresentation');
});
- it('keeps dashboard empty-state copy in a shared presentation utility', () => {
- expect(dashboardStateSource).toContain('getDashboardInfrastructureEmptyState');
- expect(dashboardStateSource).toContain('getDashboardGuestsEmptyState');
- expect(dashboardStateSource).toContain('getDashboardLoadingState');
- expect(dashboardStateSource).toContain('getDashboardDisconnectedState');
- expect(dashboardSource).not.toContain('Loading dashboard data...');
- expect(dashboardSource).not.toContain('Connection lost');
- expect(dashboardSource).not.toContain('Attempting to reconnect…');
- expect(dashboardSource).not.toContain('Unable to connect to the backend server');
- expect(dashboardSource).not.toContain('Reconnect now');
- expect(dashboardRouteSource).toContain('getDashboardDisconnectedBannerState');
- expect(dashboardRouteSource).toContain('getDashboardUnavailableState');
- expect(dashboardRouteSource).toContain('getDashboardNoResourcesState');
- expect(dashboardRouteSource).not.toContain(
- 'Real-time data is currently unavailable. Showing last-known state.',
- );
- expect(dashboardRouteSource).not.toContain(
- 'Real-time data is reconnecting. Showing last-known state.',
- );
- expect(dashboardRouteSource).not.toContain('Dashboard unavailable');
- expect(dashboardRouteSource).not.toContain(
- 'Real-time dashboard data is currently unavailable. Reconnect to try again.',
- );
- expect(dashboardRouteSource).not.toContain('No resources yet');
- expect(dashboardRouteSource).not.toContain(
- 'Once connected platforms report resources, your dashboard overview will appear here.',
- );
- expect(dashboardEmptyStatePresentationSource).toContain(
- 'export function getDashboardInfrastructureEmptyState',
- );
- expect(dashboardEmptyStatePresentationSource).toContain(
- 'export function getDashboardGuestsEmptyState',
- );
- expect(dashboardEmptyStatePresentationSource).toContain(
- 'export function getDashboardLoadingState',
- );
- expect(dashboardEmptyStatePresentationSource).toContain(
- 'export function getDashboardDisconnectedState',
- );
- expect(dashboardEmptyStatePresentationSource).toContain(
- 'export function getDashboardDisconnectedBannerState',
- );
- expect(dashboardEmptyStatePresentationSource).toContain(
- 'export function getDashboardUnavailableState',
- );
- expect(dashboardEmptyStatePresentationSource).toContain(
- 'export function getDashboardNoResourcesState',
+ it('keeps workloads empty-state copy in a shared presentation utility', () => {
+ expect(workloadsStateSource).toContain('getWorkloadsInfrastructureEmptyState');
+ expect(workloadsStateSource).toContain('getWorkloadsGuestsEmptyState');
+ expect(workloadsStateSource).toContain('getWorkloadsLoadingState');
+ expect(workloadsStateSource).toContain('getWorkloadsDisconnectedState');
+ expect(workloadsSurfaceSource).not.toContain('Loading workloads data...');
+ expect(workloadsSurfaceSource).not.toContain('Connection lost');
+ expect(workloadsSurfaceSource).not.toContain('Attempting to reconnect…');
+ expect(workloadsSurfaceSource).not.toContain('Unable to connect to the backend server');
+ expect(workloadsSurfaceSource).not.toContain('Reconnect now');
+ expect(workloadEmptyStatePresentationSource).toContain(
+ 'export function getWorkloadsInfrastructureEmptyState',
+ );
+ expect(workloadEmptyStatePresentationSource).toContain(
+ 'export function getWorkloadsGuestsEmptyState',
+ );
+ expect(workloadEmptyStatePresentationSource).toContain(
+ 'export function getWorkloadsLoadingState',
+ );
+ expect(workloadEmptyStatePresentationSource).toContain(
+ 'export function getWorkloadsDisconnectedState',
+ );
+ expect(workloadEmptyStatePresentationSource).toContain(
+ 'export function getWorkloadsDisconnectedBannerState',
+ );
+ expect(workloadEmptyStatePresentationSource).toContain(
+ 'export function getWorkloadsUnavailableState',
+ );
+ expect(workloadEmptyStatePresentationSource).toContain(
+ 'export function getWorkloadsNoResourcesState',
);
});
- it('keeps dashboard guest fallback copy in a shared presentation utility', () => {
- expect(guestRowCellsSource).toContain('getDashboardGuestBackupStatusPresentation');
- expect(guestRowCellsSource).toContain('getDashboardGuestBackupTooltip');
- expect(guestRowCellsSource).toContain('getDashboardGuestNetworkEmptyState');
- expect(guestRowSource).toContain('getDashboardGuestDiskStatusMessage');
+ it('keeps workloads guest fallback copy in a shared presentation utility', () => {
+ expect(guestRowCellsSource).toContain('getWorkloadsGuestBackupStatusPresentation');
+ expect(guestRowCellsSource).toContain('getWorkloadsGuestBackupTooltip');
+ expect(guestRowCellsSource).toContain('getWorkloadsGuestNetworkEmptyState');
+ expect(guestRowSource).toContain('getWorkloadGuestDiskStatusMessage');
expect(guestRowSource).not.toContain('No backup found');
expect(guestRowSource).not.toContain('No IP assigned');
expect(guestRowSource).not.toContain(
'No filesystems found. VM may be booting or using a Live ISO.',
);
- expect(dashboardDiskListSource).toContain('useDiskListState');
- expect(dashboardDiskListSource).not.toContain('getDashboardGuestDiskStatusMessage');
- expect(dashboardDiskListSource).not.toContain('const getUsagePercent =');
- expect(dashboardDiskListStateSource).toContain('getDashboardGuestDiskStatusMessage');
- expect(dashboardDiskListModelSource).toContain('export const buildDashboardDiskPresentation');
- expect(dashboardDiskListModelSource).toContain('export const getDashboardDiskUsagePercent');
- expect(dashboardDiskListSource).not.toContain(
+ expect(workloadsDiskListSource).toContain('useDiskListState');
+ expect(workloadsDiskListSource).not.toContain('getWorkloadGuestDiskStatusMessage');
+ expect(workloadsDiskListSource).not.toContain('const getUsagePercent =');
+ expect(workloadsDiskListStateSource).toContain('getWorkloadGuestDiskStatusMessage');
+ expect(workloadsDiskListModelSource).toContain('export const buildWorkloadsDiskPresentation');
+ expect(workloadsDiskListModelSource).toContain('export const getWorkloadsDiskUsagePercent');
+ expect(workloadsDiskListSource).not.toContain(
'No filesystems found. VM may be booting or using a Live ISO.',
);
- expect(dashboardGuestPresentationSource).toContain(
- 'export function getDashboardGuestBackupStatusPresentation',
+ expect(workloadGuestPresentationSource).toContain(
+ 'export function getWorkloadsGuestBackupStatusPresentation',
);
- expect(dashboardGuestPresentationSource).toContain(
- 'export function getDashboardGuestBackupTooltip',
+ expect(workloadGuestPresentationSource).toContain(
+ 'export function getWorkloadsGuestBackupTooltip',
);
- expect(dashboardGuestPresentationSource).toContain(
- 'export function getDashboardGuestNetworkEmptyState',
+ expect(workloadGuestPresentationSource).toContain(
+ 'export function getWorkloadsGuestNetworkEmptyState',
);
- expect(dashboardGuestPresentationSource).toContain(
- 'export function getDashboardGuestDiskStatusMessage',
+ expect(workloadGuestPresentationSource).toContain(
+ 'export function getWorkloadGuestDiskStatusMessage',
);
});
@@ -4798,9 +4713,6 @@ describe('frontend resource type boundaries', () => {
expect(alertAcknowledgementStateSource).toContain('AlertsAPI.bulkAcknowledge');
expect(alertAcknowledgementStateSource).toContain('AlertsAPI.acknowledge');
expect(alertAcknowledgementStateSource).toContain('AlertsAPI.unacknowledge');
- expect(recentAlertsPanelSource).toContain('useAlertAcknowledgementState');
- expect(recentAlertsPanelSource).not.toContain('AlertsAPI.bulkAcknowledge');
- expect(recentAlertsPanelSource).not.toContain('AlertsAPI.acknowledge');
expect(alertScheduleTabSource).toContain('useAlertScheduleState');
expect(alertScheduleTabSource).not.toContain('createDefaultQuietHours');
expect(alertScheduleTabSource).not.toContain('createDefaultCooldown');
diff --git a/frontend-modern/src/utils/__tests__/sourcePlatformOptions.test.ts b/frontend-modern/src/utils/__tests__/sourcePlatformOptions.test.ts
index f320be45aa..1a09028043 100644
--- a/frontend-modern/src/utils/__tests__/sourcePlatformOptions.test.ts
+++ b/frontend-modern/src/utils/__tests__/sourcePlatformOptions.test.ts
@@ -34,4 +34,11 @@ describe('sourcePlatformOptions', () => {
'kubernetes',
]);
});
+
+ it('keeps the Docker runtime discoverable in customer-facing source options', () => {
+ expect(DEFAULT_INFRASTRUCTURE_SOURCE_OPTIONS.find((option) => option.key === 'docker')).toEqual({
+ key: 'docker',
+ label: 'Docker / Podman',
+ });
+ });
});
diff --git a/frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts b/frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts
index d38402eed3..4b5b927b8a 100644
--- a/frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts
@@ -1,6 +1,5 @@
import { describe, expect, it } from 'vitest';
import alertHistoryTableSectionSource from '@/features/alerts/AlertHistoryTableSection.tsx?raw';
-import problemResourcesTableSource from '@/features/dashboardOverview/ProblemResourcesTable.tsx?raw';
import { TYPE_COLUMN_LABEL } from '@/utils/typeColumnContract';
import { getTypeColumnLabel } from '@/utils/typeColumnPresentation';
@@ -16,7 +15,6 @@ describe('typeColumnPresentation', () => {
});
it('keeps fixed runtime Type headers on the shared label utility', () => {
- expect(problemResourcesTableSource).toContain('getTypeColumnLabel()');
expect(alertHistoryTableSectionSource).toContain('getTypeColumnLabel()');
});
@@ -34,7 +32,6 @@ describe('typeColumnPresentation', () => {
expect(directTypeLabelHelperUsers).toEqual([
'../../features/alerts/AlertHistoryTableSection.tsx',
- '../../features/dashboardOverview/ProblemResourcesTable.tsx',
]);
});
});
diff --git a/frontend-modern/src/utils/__tests__/dashboardEmptyStatePresentation.test.ts b/frontend-modern/src/utils/__tests__/workloadEmptyStatePresentation.test.ts
similarity index 52%
rename from frontend-modern/src/utils/__tests__/dashboardEmptyStatePresentation.test.ts
rename to frontend-modern/src/utils/__tests__/workloadEmptyStatePresentation.test.ts
index b876dbdbd4..2a1096e98d 100644
--- a/frontend-modern/src/utils/__tests__/dashboardEmptyStatePresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/workloadEmptyStatePresentation.test.ts
@@ -1,17 +1,17 @@
import { describe, expect, it } from 'vitest';
import {
- getDashboardDisconnectedBannerState,
- getDashboardDisconnectedState,
- getDashboardGuestsEmptyState,
- getDashboardInfrastructureEmptyState,
- getDashboardLoadingState,
- getDashboardNoResourcesState,
- getDashboardUnavailableState,
-} from '@/utils/dashboardEmptyStatePresentation';
+ getWorkloadsDisconnectedBannerState,
+ getWorkloadsDisconnectedState,
+ getWorkloadsGuestsEmptyState,
+ getWorkloadsInfrastructureEmptyState,
+ getWorkloadsLoadingState,
+ getWorkloadsNoResourcesState,
+ getWorkloadsUnavailableState,
+} from '@/utils/workloadEmptyStatePresentation';
-describe('dashboardEmptyStatePresentation', () => {
+describe('workloadEmptyStatePresentation', () => {
it('returns the infrastructure onboarding empty state', () => {
- const state = getDashboardInfrastructureEmptyState();
+ const state = getWorkloadsInfrastructureEmptyState();
expect(state).toEqual({
title: 'No infrastructure sources connected',
@@ -23,66 +23,66 @@ describe('dashboardEmptyStatePresentation', () => {
});
it('returns the guest filter empty state for empty search', () => {
- expect(getDashboardGuestsEmptyState('')).toEqual({
+ expect(getWorkloadsGuestsEmptyState('')).toEqual({
title: 'No guests found',
description: 'No guests match your current filters',
});
});
it('returns the guest filter empty state for a search term', () => {
- expect(getDashboardGuestsEmptyState(' proxmox ')).toEqual({
+ expect(getWorkloadsGuestsEmptyState(' proxmox ')).toEqual({
title: 'No guests found',
description: 'No guests match your search "proxmox"',
});
});
- it('returns the dashboard loading-state copy', () => {
- expect(getDashboardLoadingState(false)).toEqual({
- title: 'Loading dashboard data...',
+ it('returns the workloads loading-state copy', () => {
+ expect(getWorkloadsLoadingState(false)).toEqual({
+ title: 'Loading workloads...',
description: 'Connecting to monitoring service',
});
- expect(getDashboardLoadingState(true)).toEqual({
- title: 'Loading dashboard data...',
+ expect(getWorkloadsLoadingState(true)).toEqual({
+ title: 'Loading workloads...',
description: 'Reconnecting to monitoring service…',
});
});
- it('returns the dashboard disconnected-state copy', () => {
- expect(getDashboardDisconnectedState(true)).toEqual({
+ it('returns the workloads disconnected-state copy', () => {
+ expect(getWorkloadsDisconnectedState(true)).toEqual({
title: 'Connection lost',
description: 'Attempting to reconnect…',
actionLabel: undefined,
});
- expect(getDashboardDisconnectedState(false)).toEqual({
+ expect(getWorkloadsDisconnectedState(false)).toEqual({
title: 'Connection lost',
description: 'Unable to connect to the backend server',
actionLabel: 'Reconnect now',
});
});
- it('returns the dashboard disconnected banner copy', () => {
- expect(getDashboardDisconnectedBannerState(true)).toEqual({
+ it('returns the workloads disconnected banner copy', () => {
+ expect(getWorkloadsDisconnectedBannerState(true)).toEqual({
title: 'Connection lost',
description: 'Real-time data is reconnecting. Showing last-known state.',
actionLabel: 'Reconnect',
});
- expect(getDashboardDisconnectedBannerState(false)).toEqual({
+ expect(getWorkloadsDisconnectedBannerState(false)).toEqual({
title: 'Connection lost',
description: 'Real-time data is currently unavailable. Showing last-known state.',
actionLabel: 'Reconnect',
});
});
- it('returns the dashboard unavailable and empty states', () => {
- expect(getDashboardUnavailableState()).toEqual({
- title: 'Dashboard unavailable',
- description: 'Real-time dashboard data is currently unavailable. Reconnect to try again.',
+ it('returns the workloads unavailable and empty states', () => {
+ expect(getWorkloadsUnavailableState()).toEqual({
+ title: 'Workloads unavailable',
+ description: 'Real-time workload data is currently unavailable. Reconnect to try again.',
actionLabel: 'Reconnect',
});
- expect(getDashboardNoResourcesState()).toEqual({
+ expect(getWorkloadsNoResourcesState()).toEqual({
title: 'Connect your first infrastructure source',
description:
- 'The dashboard appears after Pulse receives its first monitored system. Add an infrastructure source with API inventory, Agent telemetry, or both, then this page becomes the live estate overview.',
+ 'Workloads appear after Pulse receives its first monitored system. Add an infrastructure source with API inventory, Agent telemetry, or both, then return here to inspect running VMs, containers, and pods.',
actionLabel: 'Add infrastructure source',
});
});
diff --git a/frontend-modern/src/utils/__tests__/dashboardGuestPresentation.test.ts b/frontend-modern/src/utils/__tests__/workloadGuestPresentation.test.ts
similarity index 50%
rename from frontend-modern/src/utils/__tests__/dashboardGuestPresentation.test.ts
rename to frontend-modern/src/utils/__tests__/workloadGuestPresentation.test.ts
index cdddbade29..c1560e0d10 100644
--- a/frontend-modern/src/utils/__tests__/dashboardGuestPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/workloadGuestPresentation.test.ts
@@ -1,19 +1,19 @@
import { describe, expect, it } from 'vitest';
import {
- getDashboardGuestBackupStatusPresentation,
- getDashboardGuestBackupTooltip,
- getDashboardGuestDiskStatusMessage,
- getDashboardGuestNetworkEmptyState,
-} from '@/utils/dashboardGuestPresentation';
+ getWorkloadsGuestBackupStatusPresentation,
+ getWorkloadsGuestBackupTooltip,
+ getWorkloadGuestDiskStatusMessage,
+ getWorkloadsGuestNetworkEmptyState,
+} from '@/utils/workloadGuestPresentation';
-describe('dashboardGuestPresentation', () => {
+describe('workloadGuestPresentation', () => {
it('returns canonical guest backup status presentation', () => {
- expect(getDashboardGuestBackupStatusPresentation('fresh')).toEqual({
+ expect(getWorkloadsGuestBackupStatusPresentation('fresh')).toEqual({
color: 'text-green-600 dark:text-green-400',
bgColor: 'bg-green-100 dark:bg-green-900',
icon: 'check',
});
- expect(getDashboardGuestBackupStatusPresentation('never')).toEqual({
+ expect(getWorkloadsGuestBackupStatusPresentation('never')).toEqual({
color: 'text-muted',
bgColor: 'bg-surface-alt',
icon: 'x',
@@ -21,16 +21,16 @@ describe('dashboardGuestPresentation', () => {
});
it('returns canonical guest backup tooltip copy', () => {
- expect(getDashboardGuestBackupTooltip('never')).toBe('No backup found');
- expect(getDashboardGuestBackupTooltip('stale', '3d')).toBe('Last backup: 3d');
+ expect(getWorkloadsGuestBackupTooltip('never')).toBe('No backup found');
+ expect(getWorkloadsGuestBackupTooltip('stale', '3d')).toBe('Last backup: 3d');
});
it('returns canonical guest network and disk fallback copy', () => {
- expect(getDashboardGuestNetworkEmptyState()).toBe('No IP assigned');
- expect(getDashboardGuestDiskStatusMessage('no-filesystems')).toBe(
+ expect(getWorkloadsGuestNetworkEmptyState()).toBe('No IP assigned');
+ expect(getWorkloadGuestDiskStatusMessage('no-filesystems')).toBe(
'No filesystems found. VM may be booting or using a Live ISO.',
);
- expect(getDashboardGuestDiskStatusMessage()).toBe(
+ expect(getWorkloadGuestDiskStatusMessage()).toBe(
'Disk stats unavailable. Guest agent may not be installed.',
);
});
diff --git a/frontend-modern/src/utils/alertOverviewPresentation.ts b/frontend-modern/src/utils/alertOverviewPresentation.ts
index e851f7b6df..86ba011ecc 100644
--- a/frontend-modern/src/utils/alertOverviewPresentation.ts
+++ b/frontend-modern/src/utils/alertOverviewPresentation.ts
@@ -36,13 +36,6 @@ export const ALERTS_PAGE_SCHEDULE_DESCRIPTION =
export const ALERTS_PAGE_HISTORY_DESCRIPTION =
'Search prior alerts, review incident timelines, and inspect alert frequency over time.';
-export type DashboardAlertTone = 'default' | 'warning' | 'danger';
-
-export interface DashboardAlertOverview {
- activeCritical: number;
- activeWarning: number;
-}
-
export interface AlertOverviewCardPresentation {
cardClassName: string;
iconClassName: string;
@@ -82,16 +75,6 @@ export function getAlertListEmptyState(showAcknowledged: boolean): string {
return showAcknowledged ? ALERTS_EMPTY_STATE : 'No unacknowledged alerts';
}
-export function getDashboardAlertTone(overview: DashboardAlertOverview): DashboardAlertTone {
- if (overview.activeCritical > 0) return 'danger';
- if (overview.activeWarning > 0) return 'warning';
- return 'default';
-}
-
-export function getDashboardAlertSummaryText(overview: DashboardAlertOverview): string {
- return `${overview.activeCritical} critical Β· ${overview.activeWarning} warning`;
-}
-
export function getAlertTimelineLoadingState() {
return {
text: ALERT_TIMELINE_LOADING_STATE,
diff --git a/frontend-modern/src/utils/apiClient.ts b/frontend-modern/src/utils/apiClient.ts
index 086ba0b413..9f000e6fdb 100644
--- a/frontend-modern/src/utils/apiClient.ts
+++ b/frontend-modern/src/utils/apiClient.ts
@@ -294,7 +294,7 @@ class ApiClient {
}
private loadStoredAuth() {
- // First, check for token in URL query parameter (for kiosk/dashboard mode)
+ // First, check for token in URL query parameter (for kiosk mode)
// This allows visiting ?token=xxx to auto-authenticate without cookies
try {
if (typeof window !== 'undefined' && window.location?.search) {
diff --git a/frontend-modern/src/utils/dashboardKpiPresentation.ts b/frontend-modern/src/utils/dashboardKpiPresentation.ts
deleted file mode 100644
index 793067c8ba..0000000000
--- a/frontend-modern/src/utils/dashboardKpiPresentation.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import type { Component } from 'solid-js';
-import ServerIcon from 'lucide-solid/icons/server';
-import ContainerIcon from 'lucide-solid/icons/box';
-import HardDriveIcon from 'lucide-solid/icons/hard-drive';
-import BellIcon from 'lucide-solid/icons/bell';
-
-export type DashboardKpiKey = 'infrastructure' | 'workloads' | 'storage' | 'alerts';
-
-export interface DashboardKpiPresentation {
- label: string;
- supportingText?: string;
- cardClassName: string;
- iconClassName: string;
- icon: Component<{ class?: string }>;
-}
-
-const DASHBOARD_KPI_PRESENTATION: Record<DashboardKpiKey, DashboardKpiPresentation> = {
- infrastructure: {
- label: 'Infrastructure',
- cardClassName:
- 'h-full border-l-[3px] border-l-blue-500 dark:border-l-blue-400 bg-surface group-hover:bg-surface-hover transition-colors',
- iconClassName: 'w-3.5 h-3.5 text-blue-500/50 dark:text-blue-400/50',
- icon: ServerIcon,
- },
- workloads: {
- label: 'Workloads',
- supportingText: 'VMs, containers, and pods',
- cardClassName:
- 'h-full border-l-[3px] border-l-rose-500 dark:border-l-rose-400 bg-surface group-hover:bg-surface-hover transition-colors',
- iconClassName: 'w-3.5 h-3.5 text-rose-500/50 dark:text-rose-400/50',
- icon: ContainerIcon,
- },
- storage: {
- label: 'Storage',
- cardClassName:
- 'h-full border-l-[3px] border-l-cyan-500 dark:border-l-cyan-400 bg-surface group-hover:bg-surface-hover transition-colors',
- iconClassName: 'w-3.5 h-3.5 text-cyan-500/50 dark:text-cyan-400/50',
- icon: HardDriveIcon,
- },
- alerts: {
- label: 'Alerts',
- cardClassName:
- 'h-full border-l-[3px] border-l-amber-500 dark:border-l-amber-400 group-hover:brightness-95 dark:group-hover:brightness-110 transition-all',
- iconClassName: 'w-3.5 h-3.5 text-amber-500/50 dark:text-amber-400/50',
- icon: BellIcon,
- },
-};
-
-export function getDashboardKpiPresentation(key: DashboardKpiKey): DashboardKpiPresentation {
- return DASHBOARD_KPI_PRESENTATION[key];
-}
diff --git a/frontend-modern/src/utils/dashboardMetricPresentation.ts b/frontend-modern/src/utils/dashboardMetricPresentation.ts
deleted file mode 100644
index d4cb2c029a..0000000000
--- a/frontend-modern/src/utils/dashboardMetricPresentation.ts
+++ /dev/null
@@ -1,68 +0,0 @@
-export type DashboardStatusTone = 'online' | 'offline' | 'warning' | 'critical' | 'unknown';
-
-export function getDashboardStatusBadgeClass(tone: DashboardStatusTone): string {
- const base =
- 'inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium';
- switch (tone) {
- case 'online':
- return `${base} border-emerald-200 bg-emerald-100 text-emerald-700 dark:border-emerald-800 dark:bg-emerald-900 dark:text-emerald-300`;
- case 'warning':
- return `${base} border-amber-200 bg-amber-100 text-amber-700 dark:border-amber-800 dark:bg-amber-900 dark:text-amber-300`;
- case 'critical':
- return `${base} border-red-200 bg-red-100 text-red-700 dark:border-red-800 dark:bg-red-900 dark:text-red-300`;
- case 'offline':
- return `${base} border-border bg-surface-alt text-base-content`;
- default:
- return `${base} border-border bg-surface-alt text-muted`;
- }
-}
-
-export function formatDashboardPercent(value: number): string {
- return `${Math.round(value)}%`;
-}
-
-export function formatDashboardDelta(delta: number | null): string | null {
- if (delta === null) return null;
- const sign = delta >= 0 ? '+' : '';
- return `${sign}${delta.toFixed(1)}%`;
-}
-
-export function getDashboardDeltaColorClass(delta: number | null): string {
- if (delta === null) return 'text-muted';
- if (delta > 5) return 'text-red-500 dark:text-red-400';
- if (delta > 0) return 'text-amber-500 dark:text-amber-400';
- if (delta < -5) return 'text-emerald-500 dark:text-emerald-400';
- if (delta < 0) return 'text-blue-500 dark:text-blue-400';
- return 'text-muted';
-}
-
-export type DashboardActionPriority = 'critical' | 'high' | 'medium' | 'low';
-
-export interface DashboardActionItem {
- id: string;
- priority: DashboardActionPriority;
- label: string;
- link: string;
-}
-
-export const DASHBOARD_PRIORITY_ORDER: Record<DashboardActionPriority, number> = {
- critical: 0,
- high: 1,
- medium: 2,
- low: 3,
-};
-
-export const DASHBOARD_MAX_ACTION_ITEMS = 5;
-
-export function getDashboardPriorityBadgeClass(priority: DashboardActionPriority): string {
- switch (priority) {
- case 'critical':
- return 'bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-300';
- case 'high':
- return 'bg-orange-100 text-orange-700 dark:bg-orange-900 dark:text-orange-300';
- case 'medium':
- return 'bg-amber-100 text-amber-700 dark:bg-amber-900 dark:text-amber-300';
- case 'low':
- return 'bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300';
- }
-}
diff --git a/frontend-modern/src/utils/dashboardRecoveryPresentation.ts b/frontend-modern/src/utils/dashboardRecoveryPresentation.ts
deleted file mode 100644
index 98d17a8a6d..0000000000
--- a/frontend-modern/src/utils/dashboardRecoveryPresentation.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export const DASHBOARD_RECOVERY_EMPTY_STATE = 'No recovery data available';
-export const DASHBOARD_RECOVERY_STALE_MESSAGE = 'Last recovery point over 24 hours ago';
diff --git a/frontend-modern/src/utils/dashboardStoragePresentation.ts b/frontend-modern/src/utils/dashboardStoragePresentation.ts
deleted file mode 100644
index 7c237f52c9..0000000000
--- a/frontend-modern/src/utils/dashboardStoragePresentation.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { getMetricColorClass } from '@/utils/metricThresholds';
-
-export const DASHBOARD_STORAGE_EMPTY_STATE = 'No storage resources';
-
-export interface DashboardStorageIssueBadge {
- label: string;
- className: string;
-}
-
-export function computeDashboardStorageCapacityPercent(used: number, total: number): number {
- if (!Number.isFinite(used) || !Number.isFinite(total) || total <= 0) return 0;
- return Math.min(100, Math.max(0, (used / total) * 100));
-}
-
-export function getDashboardStorageCapacityBarClass(percent: number): string {
- return getMetricColorClass(percent, 'disk');
-}
-
-export function getDashboardStorageIssueBadges(counts: {
- warningCount: number;
- criticalCount: number;
-}): DashboardStorageIssueBadge[] {
- const badges: DashboardStorageIssueBadge[] = [];
- if (counts.warningCount > 0) {
- badges.push({
- label: `${counts.warningCount} warnings`,
- className: 'font-medium text-amber-600 dark:text-amber-400',
- });
- }
- if (counts.criticalCount > 0) {
- badges.push({
- label: `${counts.criticalCount} critical`,
- className: 'font-medium text-red-600 dark:text-red-400',
- });
- }
- return badges;
-}
diff --git a/frontend-modern/src/utils/dashboardTrendPresentation.ts b/frontend-modern/src/utils/dashboardTrendPresentation.ts
deleted file mode 100644
index dc3836c862..0000000000
--- a/frontend-modern/src/utils/dashboardTrendPresentation.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-const DASHBOARD_TREND_COLORS = [
- '#3b82f6',
- '#8b5cf6',
- '#10b981',
- '#f97316',
- '#ec4899',
- '#06b6d4',
- '#f59e0b',
- '#ef4444',
-];
-
-export function getDashboardTrendColor(index: number): string {
- return DASHBOARD_TREND_COLORS[index % DASHBOARD_TREND_COLORS.length];
-}
-
-export function getDashboardTrendErrorState() {
- return {
- text: 'Unable to load trends',
- } as const;
-}
diff --git a/frontend-modern/src/utils/localStorage.ts b/frontend-modern/src/utils/localStorage.ts
index 486a91f538..cb12fe4370 100644
--- a/frontend-modern/src/utils/localStorage.ts
+++ b/frontend-modern/src/utils/localStorage.ts
@@ -177,11 +177,11 @@ export const STORAGE_KEYS = {
RECOVERY_USE_RELATIVE_TIME: 'backupsUseRelativeTime',
RECOVERY_SEARCH_HISTORY: 'backupsSearchHistory',
- // Dashboard settings
- DASHBOARD_SHOW_FILTERS: 'dashboardShowFilters',
- DASHBOARD_CARD_VIEW: 'dashboardCardView',
- DASHBOARD_AUTO_REFRESH: 'dashboardAutoRefresh',
- DASHBOARD_SEARCH_HISTORY: 'dashboardSearchHistory',
+ // Workloads settings
+ WORKLOADS_SHOW_FILTERS: 'workloadsShowFilters',
+ WORKLOADS_CARD_VIEW: 'workloadsCardView',
+ WORKLOADS_AUTO_REFRESH: 'workloadsAutoRefresh',
+ WORKLOADS_SEARCH_HISTORY: 'workloadsSearchHistory',
WORKLOADS_SUMMARY_RANGE: 'workloadsSummaryRange',
WORKLOADS_SUMMARY_COLLAPSED: 'workloadsSummaryCollapsed',
INFRASTRUCTURE_SUMMARY_RANGE: 'infrastructureSummaryRange',
@@ -197,7 +197,7 @@ export const STORAGE_KEYS = {
TEMPERATURE_UNIT: 'temperatureUnit', // 'celsius' | 'fahrenheit'
// Column visibility
- DASHBOARD_HIDDEN_COLUMNS: 'dashboardHiddenColumns',
+ WORKLOADS_HIDDEN_COLUMNS: 'workloadsHiddenColumns',
RECOVERY_HIDDEN_COLUMNS: 'backupsHiddenColumns',
STORAGE_HIDDEN_COLUMNS: 'storageHiddenColumns',
diff --git a/frontend-modern/src/utils/dashboardEmptyStatePresentation.ts b/frontend-modern/src/utils/workloadEmptyStatePresentation.ts
similarity index 64%
rename from frontend-modern/src/utils/dashboardEmptyStatePresentation.ts
rename to frontend-modern/src/utils/workloadEmptyStatePresentation.ts
index b6bcd0c1bb..601e304098 100644
--- a/frontend-modern/src/utils/dashboardEmptyStatePresentation.ts
+++ b/frontend-modern/src/utils/workloadEmptyStatePresentation.ts
@@ -1,6 +1,6 @@
import { getInfrastructureSourceStrategyDescription } from '@/utils/infrastructureSettingsPresentation';
-export function getDashboardInfrastructureEmptyState() {
+export function getWorkloadsInfrastructureEmptyState() {
return {
title: 'No infrastructure sources connected',
description: getInfrastructureSourceStrategyDescription(),
@@ -8,7 +8,7 @@ export function getDashboardInfrastructureEmptyState() {
} as const;
}
-export function getDashboardGuestsEmptyState(search: string) {
+export function getWorkloadsGuestsEmptyState(search: string) {
const normalized = search.trim();
return {
title: 'No guests found',
@@ -19,16 +19,16 @@ export function getDashboardGuestsEmptyState(search: string) {
} as const;
}
-export function getDashboardLoadingState(reconnecting: boolean) {
+export function getWorkloadsLoadingState(reconnecting: boolean) {
return {
- title: 'Loading dashboard data...',
+ title: 'Loading workloads...',
description: reconnecting
? 'Reconnecting to monitoring service…'
: 'Connecting to monitoring service',
} as const;
}
-export function getDashboardDisconnectedState(reconnecting: boolean) {
+export function getWorkloadsDisconnectedState(reconnecting: boolean) {
return {
title: 'Connection lost',
description: reconnecting
@@ -38,7 +38,7 @@ export function getDashboardDisconnectedState(reconnecting: boolean) {
} as const;
}
-export function getDashboardDisconnectedBannerState(reconnecting: boolean) {
+export function getWorkloadsDisconnectedBannerState(reconnecting: boolean) {
return {
title: 'Connection lost',
description: reconnecting
@@ -48,19 +48,19 @@ export function getDashboardDisconnectedBannerState(reconnecting: boolean) {
} as const;
}
-export function getDashboardUnavailableState() {
+export function getWorkloadsUnavailableState() {
return {
- title: 'Dashboard unavailable',
- description: 'Real-time dashboard data is currently unavailable. Reconnect to try again.',
+ title: 'Workloads unavailable',
+ description: 'Real-time workload data is currently unavailable. Reconnect to try again.',
actionLabel: 'Reconnect',
} as const;
}
-export function getDashboardNoResourcesState() {
+export function getWorkloadsNoResourcesState() {
return {
title: 'Connect your first infrastructure source',
description:
- 'The dashboard appears after Pulse receives its first monitored system. Add an infrastructure source with API inventory, Agent telemetry, or both, then this page becomes the live estate overview.',
+ 'Workloads appear after Pulse receives its first monitored system. Add an infrastructure source with API inventory, Agent telemetry, or both, then return here to inspect running VMs, containers, and pods.',
actionLabel: 'Add infrastructure source',
} as const;
}
diff --git a/frontend-modern/src/utils/dashboardGuestPresentation.ts b/frontend-modern/src/utils/workloadGuestPresentation.ts
similarity index 82%
rename from frontend-modern/src/utils/dashboardGuestPresentation.ts
rename to frontend-modern/src/utils/workloadGuestPresentation.ts
index 86c1be8f0e..81f227e602 100644
--- a/frontend-modern/src/utils/dashboardGuestPresentation.ts
+++ b/frontend-modern/src/utils/workloadGuestPresentation.ts
@@ -1,12 +1,12 @@
import type { BackupStatus } from '@/utils/format';
-export interface DashboardGuestBackupStatusPresentation {
+export interface WorkloadsGuestBackupStatusPresentation {
color: string;
bgColor: string;
icon: 'check' | 'warning' | 'x';
}
-const BACKUP_STATUS_PRESENTATION: Record<BackupStatus, DashboardGuestBackupStatusPresentation> = {
+const BACKUP_STATUS_PRESENTATION: Record<BackupStatus, WorkloadsGuestBackupStatusPresentation> = {
fresh: {
color: 'text-green-600 dark:text-green-400',
bgColor: 'bg-green-100 dark:bg-green-900',
@@ -29,13 +29,13 @@ const BACKUP_STATUS_PRESENTATION: Record<BackupStatus, DashboardGuestBackupStatu
},
};
-export function getDashboardGuestBackupStatusPresentation(
+export function getWorkloadsGuestBackupStatusPresentation(
status: BackupStatus,
-): DashboardGuestBackupStatusPresentation {
+): WorkloadsGuestBackupStatusPresentation {
return BACKUP_STATUS_PRESENTATION[status];
}
-export function getDashboardGuestBackupTooltip(
+export function getWorkloadsGuestBackupTooltip(
status: BackupStatus,
ageFormatted?: string | null,
): string {
@@ -45,11 +45,11 @@ export function getDashboardGuestBackupTooltip(
return `Last backup: ${ageFormatted || 'Unknown'}`;
}
-export function getDashboardGuestNetworkEmptyState(): string {
+export function getWorkloadsGuestNetworkEmptyState(): string {
return 'No IP assigned';
}
-export function getDashboardGuestDiskStatusMessage(reason?: string): string {
+export function getWorkloadGuestDiskStatusMessage(reason?: string): string {
switch (reason) {
case 'agent-not-running':
return 'Guest agent not running. Install and start qemu-guest-agent in the VM.';
diff --git a/internal/api/dashboard_summary_offline_proxmox_node_test.go b/internal/api/dashboard_summary_offline_proxmox_node_test.go
deleted file mode 100644
index 49bc8bd29d..0000000000
--- a/internal/api/dashboard_summary_offline_proxmox_node_test.go
+++ /dev/null
@@ -1,80 +0,0 @@
-package api
-
-import (
- "encoding/json"
- "net/http"
- "net/http/httptest"
- "testing"
- "time"
-
- "github.com/rcourtman/pulse-go-rewrite/internal/config"
- "github.com/rcourtman/pulse-go-rewrite/internal/models"
- unified "github.com/rcourtman/pulse-go-rewrite/internal/unifiedresources"
-)
-
-func TestDashboardSummaryKeepsOfflineProxmoxNodeVisible(t *testing.T) {
- now := time.Now().UTC()
-
- h := NewResourceHandlers(&config.Config{DataPath: t.TempDir()})
- h.SetStateProvider(resourceUnifiedSeedProvider{
- snapshot: models.StateSnapshot{LastUpdate: now},
- resources: []unified.Resource{
- {
- ID: "offline-pve",
- Type: unified.ResourceTypeAgent,
- Name: "PVE Offline",
- Status: unified.StatusOffline,
- LastSeen: now,
- UpdatedAt: now,
- Sources: []unified.DataSource{unified.SourceProxmox},
- Canonical: &unified.CanonicalIdentity{
- DisplayName: "PVE Offline",
- Hostname: "pve-offline.lab.local",
- PlatformID: "offline-pve",
- },
- Proxmox: &unified.ProxmoxData{
- SourceID: "offline-pve",
- NodeName: "pve-offline",
- Instance: "homelab",
- ConnectionHealth: "error",
- PVEVersion: "8.3-1",
- },
- },
- },
- })
-
- rec := httptest.NewRecorder()
- req := httptest.NewRequest(http.MethodGet, "/api/resources/dashboard-summary", nil)
- h.HandleDashboardSummary(rec, req)
-
- if rec.Code != http.StatusOK {
- t.Fatalf("status = %d, body=%s", rec.Code, rec.Body.String())
- }
-
- var resp DashboardOverviewSummaryResponse
- if err := json.NewDecoder(rec.Body).Decode(&resp); err != nil {
- t.Fatalf("decode response: %v", err)
- }
-
- if resp.Health.TotalResources != 1 {
- t.Fatalf("health.totalResources = %d, want 1", resp.Health.TotalResources)
- }
- if resp.Infrastructure.Total != 1 {
- t.Fatalf("infrastructure.total = %d, want 1", resp.Infrastructure.Total)
- }
- if resp.Infrastructure.ByStatus["offline"] != 1 {
- t.Fatalf("infrastructure.byStatus.offline = %d, want 1", resp.Infrastructure.ByStatus["offline"])
- }
- if resp.Infrastructure.ByType["agent"] != 1 {
- t.Fatalf("infrastructure.byType.agent = %d, want 1", resp.Infrastructure.ByType["agent"])
- }
- if len(resp.ProblemResources) != 1 {
- t.Fatalf("problemResources len = %d, want 1", len(resp.ProblemResources))
- }
- if resp.ProblemResources[0].ID != "offline-pve" {
- t.Fatalf("problemResources[0].id = %q, want offline-pve", resp.ProblemResources[0].ID)
- }
- if got := resp.ProblemResources[0].Problems; len(got) != 1 || got[0] != "Offline" {
- t.Fatalf("problemResources[0].problems = %+v, want [Offline]", got)
- }
-}
diff --git a/internal/api/magic_link_handlers.go b/internal/api/magic_link_handlers.go
index 3177b106a9..c6dedb8931 100644
--- a/internal/api/magic_link_handlers.go
+++ b/internal/api/magic_link_handlers.go
@@ -214,7 +214,7 @@ func (h *MagicLinkHandlers) HandlePublicMagicLinkVerify(w http.ResponseWriter, r
return
}
- http.Redirect(w, r, "/dashboard", http.StatusTemporaryRedirect)
+ http.Redirect(w, r, "/infrastructure", http.StatusTemporaryRedirect)
}
func (h *MagicLinkHandlers) findOrgForEmail(email string) (string, bool, error) {
diff --git a/internal/api/oidc_handlers_test.go b/internal/api/oidc_handlers_test.go
index 4bfe62c112..9f94eaf635 100644
--- a/internal/api/oidc_handlers_test.go
+++ b/internal/api/oidc_handlers_test.go
@@ -19,8 +19,8 @@ func TestSanitizeOIDCReturnTo(t *testing.T) {
// Valid paths
{
name: "simple path",
- raw: "/dashboard",
- want: "/dashboard",
+ raw: "/infrastructure",
+ want: "/infrastructure",
},
{
name: "root path",
@@ -92,18 +92,18 @@ func TestSanitizeOIDCReturnTo(t *testing.T) {
// Whitespace handling
{
name: "leading whitespace",
- raw: " /dashboard",
- want: "/dashboard",
+ raw: " /infrastructure",
+ want: "/infrastructure",
},
{
name: "trailing whitespace",
- raw: "/dashboard ",
- want: "/dashboard",
+ raw: "/infrastructure ",
+ want: "/infrastructure",
},
{
name: "both whitespace",
- raw: " /dashboard ",
- want: "/dashboard",
+ raw: " /infrastructure ",
+ want: "/infrastructure",
},
}
@@ -190,10 +190,10 @@ func TestAddQueryParam(t *testing.T) {
// Basic cases
{
name: "add to simple path",
- path: "/dashboard",
+ path: "/infrastructure",
key: "foo",
value: "bar",
- want: "/dashboard?foo=bar",
+ want: "/infrastructure?foo=bar",
},
{
name: "add to root",
diff --git a/internal/api/resources.go b/internal/api/resources.go
index ec1ac9024e..3192307966 100644
--- a/internal/api/resources.go
+++ b/internal/api/resources.go
@@ -186,30 +186,6 @@ func (h *ResourceHandlers) HandleStorageSummary(w http.ResponseWriter, r *http.R
json.NewEncoder(w).Encode(response)
}
-// HandleDashboardSummary handles GET /api/resources/dashboard-summary.
-func (h *ResourceHandlers) HandleDashboardSummary(w http.ResponseWriter, r *http.Request) {
- if r.Method != http.MethodGet {
- http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
- return
- }
-
- orgID := GetOrgID(r.Context())
- registry, err := h.buildRegistry(orgID)
- if err != nil {
- http.Error(w, sanitizeErrorForClient(err, "Internal server error"), http.StatusInternalServerError)
- return
- }
-
- resources := unified.RefreshCanonicalMetadataSlice(registry.List())
- attachMetricsTargets(resources, registry)
- applyResourceContractTypes(resources)
-
- response := buildDashboardOverviewSummaryResponse(resources)
-
- w.Header().Set("Content-Type", "application/json")
- json.NewEncoder(w).Encode(response)
-}
-
// HandleStorageIncidents handles GET /api/resources/storage-incidents.
func (h *ResourceHandlers) HandleStorageIncidents(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet {
@@ -1151,92 +1127,6 @@ type StorageSummaryResponse struct {
TopIncidents []StorageSummaryIncident `json:"topIncidents"`
}
-type DashboardOverviewSummaryResponse struct {
- Health DashboardOverviewHealthSummary `json:"health"`
- Infrastructure DashboardOverviewInfrastructureSummary `json:"infrastructure"`
- Workloads DashboardOverviewWorkloadsSummary `json:"workloads"`
- Storage DashboardOverviewStorageSummary `json:"storage"`
- ProblemResources []DashboardOverviewProblemResourceRow `json:"problemResources"`
-}
-
-type DashboardOverviewHealthSummary struct {
- TotalResources int `json:"totalResources"`
- ByStatus map[string]int `json:"byStatus"`
-}
-
-type DashboardOverviewInfrastructureSummary struct {
- Total int `json:"total"`
- ByStatus map[string]int `json:"byStatus"`
- ByType map[string]int `json:"byType"`
- TopCPU []DashboardOverviewTopResource `json:"topCPU"`
- TopMemory []DashboardOverviewTopResource `json:"topMemory"`
-}
-
-type DashboardOverviewTopResource struct {
- ID string `json:"id"`
- Name string `json:"name"`
- Percent float64 `json:"percent"`
- MetricsTarget *unified.MetricsTarget `json:"metricsTarget,omitempty"`
-}
-
-type DashboardOverviewWorkloadsSummary struct {
- Total int `json:"total"`
- Running int `json:"running"`
- Stopped int `json:"stopped"`
- ByType map[string]int `json:"byType"`
-}
-
-type DashboardOverviewStorageSummary struct {
- Total int `json:"total"`
- TotalCapacity int64 `json:"totalCapacity"`
- TotalUsed int64 `json:"totalUsed"`
- WarningCount int `json:"warningCount"`
- CriticalCount int `json:"criticalCount"`
-}
-
-type DashboardOverviewProblemResourceRow struct {
- ID string `json:"id"`
- Type string `json:"type"`
- Name string `json:"name"`
- Status string `json:"status"`
- LastSeen string `json:"lastSeen,omitempty"`
- Sources []unified.DataSource `json:"sources,omitempty"`
- AISafeSummary string `json:"aiSafeSummary,omitempty"`
- Policy *unified.ResourcePolicy `json:"policy,omitempty"`
- CanonicalIdentity *unified.CanonicalIdentity `json:"canonicalIdentity,omitempty"`
- Problems []string `json:"problems"`
- WorstValue float64 `json:"worstValue"`
-}
-
-func EmptyDashboardOverviewSummaryResponse() DashboardOverviewSummaryResponse {
- return DashboardOverviewSummaryResponse{}.NormalizeCollections()
-}
-
-func (r DashboardOverviewSummaryResponse) NormalizeCollections() DashboardOverviewSummaryResponse {
- if r.Health.ByStatus == nil {
- r.Health.ByStatus = map[string]int{}
- }
- if r.Infrastructure.ByStatus == nil {
- r.Infrastructure.ByStatus = map[string]int{}
- }
- if r.Infrastructure.ByType == nil {
- r.Infrastructure.ByType = map[string]int{}
- }
- if r.Infrastructure.TopCPU == nil {
- r.Infrastructure.TopCPU = []DashboardOverviewTopResource{}
- }
- if r.Infrastructure.TopMemory == nil {
- r.Infrastructure.TopMemory = []DashboardOverviewTopResource{}
- }
- if r.Workloads.ByType == nil {
- r.Workloads.ByType = map[string]int{}
- }
- if r.ProblemResources == nil {
- r.ProblemResources = []DashboardOverviewProblemResourceRow{}
- }
- return r
-}
-
func EmptyStorageSummaryResponse() StorageSummaryResponse {
return StorageSummaryResponse{}.NormalizeCollections()
}
@@ -1328,286 +1218,6 @@ type registryCacheEntry struct {
lastUpdate time.Time
}
-func buildDashboardOverviewSummaryResponse(resources []unified.Resource) DashboardOverviewSummaryResponse {
- response := EmptyDashboardOverviewSummaryResponse()
- if len(resources) == 0 {
- return response
- }
-
- infrastructureResources := make([]unified.Resource, 0, len(resources))
- problemResources := make([]DashboardOverviewProblemResourceRow, 0, len(resources))
-
- for _, resource := range resources {
- resourceType := strings.TrimSpace(string(resource.Type))
- status := strings.TrimSpace(string(resource.Status))
- if status == "" {
- status = "unknown"
- }
-
- response.Health.TotalResources++
- response.Health.ByStatus[status]++
-
- if isDashboardInfrastructureResourceType(resource.Type) {
- infrastructureResources = append(infrastructureResources, resource)
- response.Infrastructure.Total++
- response.Infrastructure.ByStatus[status]++
- response.Infrastructure.ByType[resourceType]++
- }
-
- if isDashboardWorkloadResourceType(resource.Type) {
- response.Workloads.Total++
- response.Workloads.ByType[resourceType]++
- switch status {
- case "online", "running":
- response.Workloads.Running++
- case "offline", "stopped":
- response.Workloads.Stopped++
- }
- }
-
- if isDashboardStorageResourceType(resource.Type) {
- response.Storage.Total++
- if total := dashboardMetricTotal(resource.Metrics, func(m *unified.ResourceMetrics) *unified.MetricValue { return m.Disk }); total > 0 {
- response.Storage.TotalCapacity += total
- }
- if used := dashboardMetricUsed(resource.Metrics, func(m *unified.ResourceMetrics) *unified.MetricValue { return m.Disk }); used > 0 {
- response.Storage.TotalUsed += used
- }
- diskPercent := dashboardMetricPercent(nilSafeMetric(resource.Metrics, func(m *unified.ResourceMetrics) *unified.MetricValue { return m.Disk }))
- switch {
- case diskPercent > 90:
- response.Storage.CriticalCount++
- case diskPercent > 80:
- response.Storage.WarningCount++
- }
- }
-
- if row, ok := buildDashboardProblemResourceRow(resource); ok {
- problemResources = append(problemResources, row)
- }
- }
-
- response.Infrastructure.TopCPU = buildDashboardTopInfrastructureResources(
- infrastructureResources,
- func(resource unified.Resource) float64 {
- return dashboardMetricPercent(nilSafeMetric(resource.Metrics, func(m *unified.ResourceMetrics) *unified.MetricValue { return m.CPU }))
- },
- )
- response.Infrastructure.TopMemory = buildDashboardTopInfrastructureResources(
- infrastructureResources,
- func(resource unified.Resource) float64 {
- return dashboardMetricPercent(nilSafeMetric(resource.Metrics, func(m *unified.ResourceMetrics) *unified.MetricValue { return m.Memory }))
- },
- )
-
- sort.Slice(problemResources, func(i, j int) bool {
- if problemResources[i].WorstValue == problemResources[j].WorstValue {
- return strings.ToLower(problemResources[i].Name) < strings.ToLower(problemResources[j].Name)
- }
- return problemResources[i].WorstValue > problemResources[j].WorstValue
- })
- if len(problemResources) > 8 {
- problemResources = problemResources[:8]
- }
- response.ProblemResources = problemResources
-
- return response.NormalizeCollections()
-}
-
-func buildDashboardTopInfrastructureResources(
- resources []unified.Resource,
- metric func(unified.Resource) float64,
-) []DashboardOverviewTopResource {
- rows := make([]DashboardOverviewTopResource, 0, len(resources))
- for _, resource := range resources {
- percent := metric(resource)
- if percent <= 0 {
- continue
- }
- rows = append(rows, DashboardOverviewTopResource{
- ID: resource.ID,
- Name: dashboardResourceLabel(resource),
- Percent: percent,
- MetricsTarget: cloneDashboardMetricsTarget(resource.MetricsTarget),
- })
- }
-
- sort.Slice(rows, func(i, j int) bool {
- if rows[i].Percent == rows[j].Percent {
- return strings.ToLower(rows[i].Name) < strings.ToLower(rows[j].Name)
- }
- return rows[i].Percent > rows[j].Percent
- })
- if len(rows) > 5 {
- rows = rows[:5]
- }
- return rows
-}
-
-func cloneDashboardMetricsTarget(target *unified.MetricsTarget) *unified.MetricsTarget {
- if target == nil {
- return nil
- }
- cloned := *target
- return &cloned
-}
-
-func buildDashboardProblemResourceRow(resource unified.Resource) (DashboardOverviewProblemResourceRow, bool) {
- problems := make([]string, 0, 4)
- worstValue := 0.0
- status := strings.TrimSpace(strings.ToLower(string(resource.Status)))
-
- switch status {
- case "offline", "error", "failed", "down", "unreachable", "disconnected", "timeout", "stopped", "inactive":
- problems = append(problems, "Offline")
- worstValue = 200
- case "degraded", "warning", "maintenance", "syncing", "initializing", "starting", "pending", "partial", "unknown", "recovering", "pausing", "restarting":
- problems = append(problems, "Degraded")
- worstValue = maxDashboardProblemValue(worstValue, 150)
- }
-
- cpuPercent := dashboardMetricPercent(nilSafeMetric(resource.Metrics, func(m *unified.ResourceMetrics) *unified.MetricValue { return m.CPU }))
- if cpuPercent >= 90 {
- problems = append(problems, "CPU "+strconv.Itoa(int(cpuPercent+0.5))+"%")
- worstValue = maxDashboardProblemValue(worstValue, cpuPercent)
- }
-
- memoryPercent := dashboardMetricPercent(nilSafeMetric(resource.Metrics, func(m *unified.ResourceMetrics) *unified.MetricValue { return m.Memory }))
- if memoryPercent >= 85 {
- problems = append(problems, "Memory "+strconv.Itoa(int(memoryPercent+0.5))+"%")
- worstValue = maxDashboardProblemValue(worstValue, memoryPercent)
- }
-
- diskPercent := dashboardMetricPercent(nilSafeMetric(resource.Metrics, func(m *unified.ResourceMetrics) *unified.MetricValue { return m.Disk }))
- if diskPercent >= 90 {
- problems = append(problems, "Disk "+strconv.Itoa(int(diskPercent+0.5))+"%")
- worstValue = maxDashboardProblemValue(worstValue, diskPercent)
- }
-
- if len(problems) == 0 {
- return DashboardOverviewProblemResourceRow{}, false
- }
-
- row := DashboardOverviewProblemResourceRow{
- ID: resource.ID,
- Type: string(resource.Type),
- Name: dashboardResourceLabel(resource),
- Status: status,
- Sources: append([]unified.DataSource(nil), resource.Sources...),
- AISafeSummary: strings.TrimSpace(resource.AISafeSummary),
- CanonicalIdentity: cloneDashboardCanonicalIdentity(resource.Canonical),
- Policy: unified.CloneResourcePolicy(resource.Policy),
- Problems: problems,
- WorstValue: worstValue,
- }
- if !resource.LastSeen.IsZero() {
- row.LastSeen = resource.LastSeen.UTC().Format(time.RFC3339Nano)
- }
-
- return row, true
-}
-
-func dashboardResourceLabel(resource unified.Resource) string {
- return unified.ResourcePolicyLabel(
- unified.ResourceDisplayName(resource),
- resource.AISafeSummary,
- resource.Policy,
- )
-}
-
-func cloneDashboardCanonicalIdentity(identity *unified.CanonicalIdentity) *unified.CanonicalIdentity {
- if identity == nil {
- return nil
- }
- cloned := *identity
- if len(identity.Aliases) > 0 {
- cloned.Aliases = append([]string(nil), identity.Aliases...)
- }
- return &cloned
-}
-
-func isDashboardInfrastructureResourceType(resourceType unified.ResourceType) bool {
- switch strings.TrimSpace(string(resourceType)) {
- case "agent", "docker-host", "k8s-cluster", "k8s-node":
- return true
- default:
- return false
- }
-}
-
-func isDashboardWorkloadResourceType(resourceType unified.ResourceType) bool {
- switch strings.TrimSpace(string(resourceType)) {
- case "vm", "system-container", "app-container", "oci-container", "pod", "jail":
- return true
- default:
- return false
- }
-}
-
-func isDashboardStorageResourceType(resourceType unified.ResourceType) bool {
- switch strings.TrimSpace(string(resourceType)) {
- case "storage", "datastore", "pool", "dataset", "physical_disk", "ceph":
- return true
- default:
- return false
- }
-}
-
-func nilSafeMetric(
- metrics *unified.ResourceMetrics,
- pick func(*unified.ResourceMetrics) *unified.MetricValue,
-) *unified.MetricValue {
- if metrics == nil {
- return nil
- }
- return pick(metrics)
-}
-
-func dashboardMetricPercent(metric *unified.MetricValue) float64 {
- if metric == nil {
- return 0
- }
- if metric.Percent > 0 {
- return metric.Percent
- }
- if metric.Value > 0 {
- return metric.Value
- }
- if metric.Total != nil && metric.Used != nil && *metric.Total > 0 {
- return (float64(*metric.Used) / float64(*metric.Total)) * 100
- }
- return 0
-}
-
-func dashboardMetricTotal(
- metrics *unified.ResourceMetrics,
- pick func(*unified.ResourceMetrics) *unified.MetricValue,
-) int64 {
- metric := nilSafeMetric(metrics, pick)
- if metric == nil || metric.Total == nil {
- return 0
- }
- return *metric.Total
-}
-
-func dashboardMetricUsed(
- metrics *unified.ResourceMetrics,
- pick func(*unified.ResourceMetrics) *unified.MetricValue,
-) int64 {
- metric := nilSafeMetric(metrics, pick)
- if metric == nil || metric.Used == nil {
- return 0
- }
- return *metric.Used
-}
-
-func maxDashboardProblemValue(left, right float64) float64 {
- if right > left {
- return right
- }
- return left
-}
-
func buildStorageSummaryResponse(resources []unified.Resource) StorageSummaryResponse {
response := EmptyStorageSummaryResponse()
response.GeneratedAt = time.Now().UTC()
diff --git a/internal/api/resources_test.go b/internal/api/resources_test.go
index f9c32732b6..acaa05a8e4 100644
--- a/internal/api/resources_test.go
+++ b/internal/api/resources_test.go
@@ -3015,205 +3015,6 @@ func TestResourceStorageSummaryRollsUpIncidents(t *testing.T) {
}
}
-func TestResourceDashboardSummaryUsesCompactGovernedPayload(t *testing.T) {
- now := time.Now().UTC()
- criticalDiskTotal := int64(1_000)
- criticalDiskUsed := int64(850)
- restrictedResource := unified.Resource{
- ID: "agent:restricted-1",
- Type: unified.ResourceTypeAgent,
- Name: "restricted-host",
- Status: unified.StatusOnline,
- LastSeen: now,
- UpdatedAt: now,
- Tags: []string{"restricted"},
- Sources: []unified.DataSource{unified.SourceAgent},
- MetricsTarget: &unified.MetricsTarget{
- ResourceType: "agent",
- ResourceID: "metrics-restricted-1",
- },
- Metrics: &unified.ResourceMetrics{
- CPU: &unified.MetricValue{Percent: 95},
- Memory: &unified.MetricValue{Percent: 88},
- },
- }
- expectedRestricted := unified.RefreshCanonicalMetadataSlice([]unified.Resource{restrictedResource})[0]
- expectedRestrictedLabel := unified.ResourcePolicyLabel(
- unified.ResourceDisplayName(expectedRestricted),
- expectedRestricted.AISafeSummary,
- expectedRestricted.Policy,
- )
-
- cfg := &config.Config{DataPath: t.TempDir()}
- h := NewResourceHandlers(cfg)
- h.SetStateProvider(resourceUnifiedSeedProvider{
- snapshot: models.StateSnapshot{LastUpdate: now},
- resources: []unified.Resource{
- restrictedResource,
- {
- ID: "docker-host:preview-1",
- Type: unified.ResourceTypeAgent,
- Name: "preview-docker-host",
- Status: unified.StatusOffline,
- LastSeen: now,
- UpdatedAt: now,
- Sources: []unified.DataSource{unified.SourceDocker},
- Docker: &unified.DockerData{Hostname: "preview-docker-host"},
- Metrics: &unified.ResourceMetrics{
- CPU: &unified.MetricValue{Percent: 70},
- Memory: &unified.MetricValue{Percent: 40},
- },
- },
- {
- ID: "vm:101",
- Type: unified.ResourceTypeVM,
- Name: "vm-101",
- Status: unified.ResourceStatus("running"),
- LastSeen: now,
- UpdatedAt: now,
- Sources: []unified.DataSource{unified.SourceProxmox},
- },
- {
- ID: "dataset:critical-1",
- Type: "dataset",
- Name: "tank/apps",
- Status: unified.ResourceStatus("degraded"),
- LastSeen: now,
- UpdatedAt: now,
- Sources: []unified.DataSource{unified.SourceTrueNAS},
- Metrics: &unified.ResourceMetrics{
- Disk: &unified.MetricValue{Used: &criticalDiskUsed, Total: &criticalDiskTotal, Percent: 85},
- },
- },
- },
- })
- registry, err := h.buildRegistry("")
- if err != nil {
- t.Fatalf("buildRegistry: %v", err)
- }
- expectedTopCPUMetricsTarget := registry.MetricsTarget("agent:restricted-1")
-
- rec := httptest.NewRecorder()
- req := httptest.NewRequest(http.MethodGet, "/api/resources/dashboard-summary", nil)
- h.HandleDashboardSummary(rec, req)
-
- if rec.Code != http.StatusOK {
- t.Fatalf("status = %d, body=%s", rec.Code, rec.Body.String())
- }
-
- var resp DashboardOverviewSummaryResponse
- if err := json.NewDecoder(rec.Body).Decode(&resp); err != nil {
- t.Fatalf("decode response: %v", err)
- }
-
- if resp.Health.TotalResources != 4 {
- t.Fatalf("totalResources = %d, want 4", resp.Health.TotalResources)
- }
- if resp.Infrastructure.Total != 2 {
- t.Fatalf("infrastructure.total = %d, want 2", resp.Infrastructure.Total)
- }
- if resp.Infrastructure.ByType["agent"] != 1 || resp.Infrastructure.ByType["docker-host"] != 1 {
- t.Fatalf("unexpected infrastructure.byType = %+v", resp.Infrastructure.ByType)
- }
- if len(resp.Infrastructure.TopCPU) == 0 || resp.Infrastructure.TopCPU[0].Name != expectedRestrictedLabel {
- t.Fatalf("topCPU = %+v, want governed summary label first", resp.Infrastructure.TopCPU)
- }
- if expectedTopCPUMetricsTarget == nil {
- t.Fatal("expected restricted top CPU resource to expose a metrics target")
- }
- if resp.Infrastructure.TopCPU[0].MetricsTarget == nil || *resp.Infrastructure.TopCPU[0].MetricsTarget != *expectedTopCPUMetricsTarget {
- t.Fatalf("topCPU[0].metricsTarget = %+v, want %+v", resp.Infrastructure.TopCPU[0].MetricsTarget, expectedTopCPUMetricsTarget)
- }
- if resp.Infrastructure.TopCPU[0].Name == "restricted-host" {
- t.Fatalf("expected governed label, got raw restricted hostname")
- }
- if resp.Workloads.Total != 1 || resp.Workloads.Running != 1 || resp.Workloads.Stopped != 0 {
- t.Fatalf("unexpected workloads summary = %+v", resp.Workloads)
- }
- if resp.Storage.Total != 1 || resp.Storage.TotalCapacity != 1_000 || resp.Storage.TotalUsed != 850 {
- t.Fatalf("unexpected storage summary = %+v", resp.Storage)
- }
- if resp.Storage.WarningCount != 1 || resp.Storage.CriticalCount != 0 {
- t.Fatalf("unexpected storage warning counts = %+v", resp.Storage)
- }
- if len(resp.ProblemResources) != 3 {
- t.Fatalf("problemResources len = %d, want 3", len(resp.ProblemResources))
- }
- if resp.ProblemResources[0].ID != "docker-host:preview-1" || len(resp.ProblemResources[0].Problems) == 0 || resp.ProblemResources[0].Problems[0] != "Offline" {
- t.Fatalf("expected offline docker host first, got %+v", resp.ProblemResources[0])
- }
- if resp.ProblemResources[1].ID != "dataset:critical-1" || len(resp.ProblemResources[1].Problems) == 0 || resp.ProblemResources[1].Problems[0] != "Degraded" {
- t.Fatalf("expected degraded storage row second, got %+v", resp.ProblemResources[1])
- }
- if resp.ProblemResources[2].ID != "agent:restricted-1" || resp.ProblemResources[2].Name != expectedRestrictedLabel {
- t.Fatalf("expected governed restricted host third, got %+v", resp.ProblemResources[2])
- }
- if resp.ProblemResources[2].CanonicalIdentity == nil || resp.ProblemResources[2].Policy == nil {
- t.Fatalf("expected governed problem resource to include canonical identity and policy, got %+v", resp.ProblemResources[2])
- }
-}
-
-func TestResourceDashboardSummaryHydratesMetricsTargetsFromUnifiedSeedResources(t *testing.T) {
- now := time.Now().UTC()
-
- cfg := &config.Config{DataPath: t.TempDir()}
- h := NewResourceHandlers(cfg)
- h.SetStateProvider(resourceUnifiedSeedProvider{
- snapshot: models.StateSnapshot{LastUpdate: now},
- resources: []unified.Resource{
- {
- ID: "agent-dashboard-1",
- Type: unified.ResourceTypeAgent,
- Name: "delly",
- Status: unified.StatusOnline,
- LastSeen: now,
- UpdatedAt: now,
- Sources: []unified.DataSource{unified.SourceProxmox, unified.SourceAgent},
- Metrics: &unified.ResourceMetrics{
- CPU: &unified.MetricValue{Percent: 91},
- Memory: &unified.MetricValue{Percent: 63},
- },
- Identity: unified.ResourceIdentity{
- MachineID: "machine-delly",
- Hostnames: []string{"delly"},
- },
- Proxmox: &unified.ProxmoxData{
- SourceID: "homelab-delly",
- NodeName: "delly",
- Instance: "homelab-entry",
- },
- Agent: &unified.AgentData{
- AgentID: "agent-source-delly",
- Hostname: "delly",
- },
- },
- },
- })
-
- rec := httptest.NewRecorder()
- req := httptest.NewRequest(http.MethodGet, "/api/resources/dashboard-summary", nil)
- h.HandleDashboardSummary(rec, req)
-
- if rec.Code != http.StatusOK {
- t.Fatalf("status = %d, body=%s", rec.Code, rec.Body.String())
- }
-
- var resp DashboardOverviewSummaryResponse
- if err := json.NewDecoder(rec.Body).Decode(&resp); err != nil {
- t.Fatalf("decode response: %v", err)
- }
-
- if len(resp.Infrastructure.TopCPU) != 1 {
- t.Fatalf("topCPU len = %d, want 1", len(resp.Infrastructure.TopCPU))
- }
- if resp.Infrastructure.TopCPU[0].MetricsTarget == nil {
- t.Fatalf("expected dashboard summary metrics target, got %+v", resp.Infrastructure.TopCPU[0])
- }
- if got := *resp.Infrastructure.TopCPU[0].MetricsTarget; got != (unified.MetricsTarget{ResourceType: "agent", ResourceID: "homelab-delly"}) {
- t.Fatalf("topCPU[0].metricsTarget = %+v, want agent/homelab-delly", got)
- }
-}
-
func TestResourceListIncludesTrueNASPhysicalDiskTemperature(t *testing.T) {
previous := truenas.IsFeatureEnabled()
truenas.SetFeatureEnabled(true)
diff --git a/internal/api/route_inventory_test.go b/internal/api/route_inventory_test.go
index 62791c15ec..951acd136f 100644
--- a/internal/api/route_inventory_test.go
+++ b/internal/api/route_inventory_test.go
@@ -401,7 +401,6 @@ var allRouteAllowlist = []string{
"/api/resources",
"/api/resources/storage-incidents",
"/api/resources/storage-summary",
- "/api/resources/dashboard-summary",
"/api/resources/k8s/namespaces",
"/api/resources/stats",
"/api/resources/",
diff --git a/internal/api/router_routes_monitoring.go b/internal/api/router_routes_monitoring.go
index c65c8a4243..6b697f0675 100644
--- a/internal/api/router_routes_monitoring.go
+++ b/internal/api/router_routes_monitoring.go
@@ -32,7 +32,6 @@ func (r *Router) registerMonitoringResourceRoutes(
r.mux.HandleFunc("/api/resources", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.resourceHandlers.HandleListResources)))
r.mux.HandleFunc("/api/resources/storage-incidents", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.resourceHandlers.HandleStorageIncidents)))
r.mux.HandleFunc("/api/resources/storage-summary", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.resourceHandlers.HandleStorageSummary)))
- r.mux.HandleFunc("/api/resources/dashboard-summary", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.resourceHandlers.HandleDashboardSummary)))
r.mux.HandleFunc("/api/resources/stats", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.resourceHandlers.HandleStats)))
r.mux.HandleFunc("/api/resources/k8s/namespaces", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.resourceHandlers.HandleK8sNamespaces)))
r.mux.HandleFunc("/api/resources/{id}/facets", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.resourceHandlers.HandleGetResourceFacets)))
diff --git a/internal/api/saml_handlers_additional_test.go b/internal/api/saml_handlers_additional_test.go
index 0e9eb6dc27..b8a0c3543e 100644
--- a/internal/api/saml_handlers_additional_test.go
+++ b/internal/api/saml_handlers_additional_test.go
@@ -114,7 +114,7 @@ func TestRedirectSAMLError(t *testing.T) {
req := httptest.NewRequest(http.MethodGet, "/", nil)
rec := httptest.NewRecorder()
- router.redirectSAMLError(rec, req, "/dashboard", "session_failed")
+ router.redirectSAMLError(rec, req, "/infrastructure", "session_failed")
if rec.Code != http.StatusFound {
t.Fatalf("expected status %d, got %d", http.StatusFound, rec.Code)
diff --git a/internal/api/saml_handlers_success_test.go b/internal/api/saml_handlers_success_test.go
index 7a70051de9..81f6f95553 100644
--- a/internal/api/saml_handlers_success_test.go
+++ b/internal/api/saml_handlers_success_test.go
@@ -182,7 +182,7 @@ func TestHandleSAMLLogin_SuccessGetAndPost(t *testing.T) {
t.Fatalf("expected redirect to idp, got %q", loc)
}
- body := bytes.NewBufferString(`{"returnTo":"/dashboard"}`)
+ body := bytes.NewBufferString(`{"returnTo":"/infrastructure"}`)
req = httptest.NewRequest(http.MethodPost, "/api/saml/okta/login", body)
rr = httptest.NewRecorder()
router.handleSAMLLogin(rr, req)
diff --git a/internal/api/saml_service_additional_test.go b/internal/api/saml_service_additional_test.go
index 9c8a72f914..4ce28c052d 100644
--- a/internal/api/saml_service_additional_test.go
+++ b/internal/api/saml_service_additional_test.go
@@ -42,7 +42,7 @@ func TestProcessResponse_InvalidResponse(t *testing.T) {
sp: &saml.ServiceProvider{},
}
- body := strings.NewReader("RelayState=/dashboard&SAMLResponse=")
+ body := strings.NewReader("RelayState=/infrastructure&SAMLResponse=")
req := httptest.NewRequest(http.MethodPost, "/acs", body)
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
@@ -50,7 +50,7 @@ func TestProcessResponse_InvalidResponse(t *testing.T) {
if err == nil {
t.Fatal("expected error for invalid response")
}
- if relay != "/dashboard" {
+ if relay != "/infrastructure" {
t.Fatalf("unexpected relay state: %q", relay)
}
}
diff --git a/internal/api/security_regression_test.go b/internal/api/security_regression_test.go
index 9fb2193ee7..3f2b3a06c0 100644
--- a/internal/api/security_regression_test.go
+++ b/internal/api/security_regression_test.go
@@ -2750,7 +2750,6 @@ func TestMonitoringReadEndpointsRequireMonitoringReadScope(t *testing.T) {
"/api/charts",
"/api/charts/workloads",
"/api/charts/storage-summary",
- "/api/resources/dashboard-summary",
"/api/metrics-store/stats",
"/api/metrics-store/history",
"/api/guests/metadata",
diff --git a/scripts/release_control/canonical_completion_guard_test.py b/scripts/release_control/canonical_completion_guard_test.py
index ec9d8a7924..f3099d3db4 100644
--- a/scripts/release_control/canonical_completion_guard_test.py
+++ b/scripts/release_control/canonical_completion_guard_test.py
@@ -150,7 +150,6 @@ RECOVERY_PRODUCT_SURFACE_EXACT_FILES = [
"frontend-modern/src/components/Recovery/RecoverySummary.test.tsx",
"frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx",
"frontend-modern/src/pages/__tests__/Recovery.test.tsx",
- "frontend-modern/src/utils/__tests__/dashboardRecoveryPresentation.test.ts",
"frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts",
"tests/integration/tests/17-recovery-layout.spec.ts",
]
@@ -769,7 +768,6 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
"frontend-modern/src/components/Infrastructure/__tests__/unifiedResourceTableStateModel.test.ts",
"frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.ts",
"frontend-modern/src/features/infrastructure/__tests__/infrastructurePageModel.test.ts",
- "frontend-modern/src/hooks/__tests__/useDashboardTrends.test.ts",
"frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts",
"frontend-modern/src/pages/__tests__/Infrastructure.empty-state.test.tsx",
"frontend-modern/src/pages/__tests__/Infrastructure.pbs-pmg.test.tsx",
@@ -1149,65 +1147,13 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
def test_dashboard_page_change_requires_storage_recovery_contract(self):
required = infer_impacted_subsystems(["frontend-modern/src/pages/Dashboard.tsx"])
- self.assertEqual(set(required), {"storage-recovery"})
-
- recovery = required["storage-recovery"]
- self.assertEqual(
- recovery["contract"],
- "docs/release-control/v6/internal/subsystems/storage-recovery.md",
- )
- self.assertEqual(
- recovery["touched_runtime_files"],
- ["frontend-modern/src/pages/Dashboard.tsx"],
- )
- self.assertEqual(
- recovery["verification_requirements"],
- [
- {
- "id": "dashboard-storage-recovery-surface",
- "label": "dashboard storage and recovery surface proof",
- "touched_runtime_files": ["frontend-modern/src/pages/Dashboard.tsx"],
- "allow_same_subsystem_tests": False,
- "test_prefixes": [],
- "exact_files": [
- "frontend-modern/src/pages/__tests__/DashboardPage.test.tsx",
- ],
- }
- ],
- )
+ self.assertEqual(required, {})
def test_dashboard_widgets_change_requires_storage_recovery_contract(self):
required = infer_impacted_subsystems(
["frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts"]
)
- self.assertEqual(set(required), {"storage-recovery"})
-
- recovery = required["storage-recovery"]
- self.assertEqual(
- recovery["contract"],
- "docs/release-control/v6/internal/subsystems/storage-recovery.md",
- )
- self.assertEqual(
- recovery["touched_runtime_files"],
- ["frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts"],
- )
- self.assertEqual(
- recovery["verification_requirements"],
- [
- {
- "id": "dashboard-storage-recovery-surface",
- "label": "dashboard storage and recovery surface proof",
- "touched_runtime_files": [
- "frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts"
- ],
- "allow_same_subsystem_tests": False,
- "test_prefixes": [],
- "exact_files": [
- "frontend-modern/src/pages/__tests__/DashboardPage.test.tsx",
- ],
- }
- ],
- )
+ self.assertEqual(required, {})
def test_recovery_points_hook_change_requires_storage_recovery_contract(self):
required = infer_impacted_subsystems(["frontend-modern/src/hooks/useRecoveryPoints.ts"])
@@ -1267,16 +1213,7 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
def test_dashboard_recovery_hook_change_requires_storage_recovery_contract(self):
required = infer_impacted_subsystems(["frontend-modern/src/hooks/useDashboardRecovery.ts"])
- self.assertEqual(set(required), {"storage-recovery"})
- recovery = required["storage-recovery"]
- self.assertEqual(
- recovery["verification_requirements"][0]["id"],
- "recovery-product-surface",
- )
- self.assertEqual(
- recovery["touched_runtime_files"],
- ["frontend-modern/src/hooks/useDashboardRecovery.ts"],
- )
+ self.assertEqual(required, {})
def test_recovery_status_panel_change_requires_storage_recovery_contract(self):
required = infer_impacted_subsystems(
@@ -1285,32 +1222,30 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
self.assertEqual(set(required), {"storage-recovery"})
recovery = required["storage-recovery"]
self.assertEqual(
- recovery["verification_requirements"][0]["id"],
- "recovery-product-surface",
- )
- self.assertEqual(
- recovery["touched_runtime_files"],
- ["frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx"],
+ recovery["verification_requirements"],
+ [
+ {
+ "id": "recovery-product-surface",
+ "label": "recovery product surface proof",
+ "touched_runtime_files": [
+ "frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx"
+ ],
+ "allow_same_subsystem_tests": False,
+ "test_prefixes": [],
+ "exact_files": RECOVERY_PRODUCT_SURFACE_EXACT_FILES,
+ }
+ ],
)
def test_dashboard_recovery_presentation_change_requires_storage_recovery_contract(self):
required = infer_impacted_subsystems(
["frontend-modern/src/utils/dashboardRecoveryPresentation.ts"]
)
- self.assertEqual(set(required), {"storage-recovery"})
- recovery = required["storage-recovery"]
- self.assertEqual(
- recovery["verification_requirements"][0]["id"],
- "recovery-product-surface",
- )
- self.assertEqual(
- recovery["touched_runtime_files"],
- ["frontend-modern/src/utils/dashboardRecoveryPresentation.ts"],
- )
+ self.assertEqual(required, {})
def test_storage_panel_change_requires_storage_recovery_contract(self):
required = infer_impacted_subsystems(
- ["frontend-modern/src/components/Storage/DashboardStoragePanel.tsx"]
+ ["frontend-modern/src/components/Storage/Storage.tsx"]
)
self.assertEqual(set(required), {"storage-recovery"})
@@ -1321,7 +1256,7 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
)
self.assertEqual(
recovery["touched_runtime_files"],
- ["frontend-modern/src/components/Storage/DashboardStoragePanel.tsx"],
+ ["frontend-modern/src/components/Storage/Storage.tsx"],
)
self.assertEqual(
recovery["verification_requirements"],
@@ -1330,12 +1265,11 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
"id": "storage-product-surface",
"label": "storage product surface proof",
"touched_runtime_files": [
- "frontend-modern/src/components/Storage/DashboardStoragePanel.tsx"
+ "frontend-modern/src/components/Storage/Storage.tsx"
],
"allow_same_subsystem_tests": False,
"test_prefixes": [],
"exact_files": [
- "frontend-modern/src/components/Storage/__tests__/DashboardStoragePanel.test.tsx",
"frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx",
"frontend-modern/src/components/Storage/__tests__/Storage.test.tsx",
"frontend-modern/src/components/Storage/__tests__/StorageControls.test.tsx",
@@ -1351,7 +1285,6 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
"frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.ts",
"frontend-modern/src/features/storageBackups/__tests__/storagePoolsTablePresentation.test.ts",
"frontend-modern/src/pages/__tests__/Storage.helpers.test.ts",
- "frontend-modern/src/utils/__tests__/dashboardStoragePresentation.test.ts",
"frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts",
],
}
@@ -1362,51 +1295,7 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
required = infer_impacted_subsystems(
["frontend-modern/src/utils/dashboardStoragePresentation.ts"]
)
- self.assertEqual(set(required), {"storage-recovery"})
-
- recovery = required["storage-recovery"]
- self.assertEqual(
- recovery["contract"],
- "docs/release-control/v6/internal/subsystems/storage-recovery.md",
- )
- self.assertEqual(
- recovery["touched_runtime_files"],
- ["frontend-modern/src/utils/dashboardStoragePresentation.ts"],
- )
- self.assertEqual(
- recovery["verification_requirements"],
- [
- {
- "id": "storage-product-surface",
- "label": "storage product surface proof",
- "touched_runtime_files": [
- "frontend-modern/src/utils/dashboardStoragePresentation.ts"
- ],
- "allow_same_subsystem_tests": False,
- "test_prefixes": [],
- "exact_files": [
- "frontend-modern/src/components/Storage/__tests__/DashboardStoragePanel.test.tsx",
- "frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx",
- "frontend-modern/src/components/Storage/__tests__/Storage.test.tsx",
- "frontend-modern/src/components/Storage/__tests__/StorageControls.test.tsx",
- "frontend-modern/src/components/Storage/__tests__/StorageGroupRow.test.tsx",
- "frontend-modern/src/components/Storage/__tests__/StoragePoolDetail.test.tsx",
- "frontend-modern/src/components/Storage/__tests__/useStoragePageSummary.test.ts",
- "frontend-modern/src/components/Storage/code_standards.test.ts",
- "frontend-modern/src/features/storageBackups/__tests__/resourceStorageMapping.test.ts",
- "frontend-modern/src/features/storageBackups/__tests__/storageAdapters.test.ts",
- "frontend-modern/src/features/storageBackups/__tests__/storageAlertState.test.ts",
- "frontend-modern/src/features/storageBackups/__tests__/storageDomain.test.ts",
- "frontend-modern/src/features/storageBackups/__tests__/storageModelCore.test.ts",
- "frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.ts",
- "frontend-modern/src/features/storageBackups/__tests__/storagePoolsTablePresentation.test.ts",
- "frontend-modern/src/pages/__tests__/Storage.helpers.test.ts",
- "frontend-modern/src/utils/__tests__/dashboardStoragePresentation.test.ts",
- "frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts",
- ],
- }
- ],
- )
+ self.assertEqual(required, {})
def test_storage_page_route_change_requires_storage_recovery_contract(self):
required = infer_impacted_subsystems(["frontend-modern/src/pages/Storage.tsx"])
@@ -2934,7 +2823,6 @@ index 1111111..2222222 100644
"frontend-modern/src/components/Alerts/WebhookConfig.test.tsx",
"frontend-modern/src/components/Alerts/__tests__/BulkEditDialog.test.tsx",
"frontend-modern/src/components/Alerts/__tests__/InvestigateAlertButton.test.tsx",
- "frontend-modern/src/components/Alerts/__tests__/RecentAlertsPanel.test.tsx",
"frontend-modern/src/components/Alerts/__tests__/ThresholdsTable.test.tsx",
"frontend-modern/src/features/alerts/__tests__/OverviewTab.emptystate.test.tsx",
"frontend-modern/src/features/alerts/__tests__/OverviewTab.timelineerror.test.tsx",
@@ -3127,44 +3015,44 @@ index 1111111..2222222 100644
performance["verification_requirements"],
[
{
- "id": "dashboard-workload-hot-path",
- "label": "dashboard workload selector proof",
+ "id": "workloads-hot-path",
+ "label": "Workloads hot-path proof",
"touched_runtime_files": [
"frontend-modern/src/utils/thresholdSliderPresentation.ts"
],
"allow_same_subsystem_tests": False,
"test_prefixes": [],
"exact_files": [
- "frontend-modern/src/components/Dashboard/GuestDrawer.test.tsx",
- "frontend-modern/src/components/Dashboard/MetricBar.test.tsx",
- "frontend-modern/src/components/Dashboard/StackedMemoryBar.test.tsx",
- "frontend-modern/src/components/Dashboard/ThresholdSlider.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/Dashboard.performance.contract.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/DashboardFilter.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/DiskList.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/EnhancedCPUBar.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/GuestRow.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/StackedDiskBar.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/dashboardSelectionModel.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadFilterConfigModel.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteModel.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteStateModel.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadUrlSyncModel.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/useDashboardFilterState.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/useDashboardWorkloadViewportSync.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useEnhancedCPUBarState.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useGroupedTableWindowing.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/useMetricBarState.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useStackedDiskBarState.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useStackedMemoryBarState.test.tsx",
- "frontend-modern/src/components/Dashboard/__tests__/useThresholdSliderState.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/workloadSelectors.test.ts",
- "frontend-modern/src/components/Dashboard/__tests__/workloadTopology.test.ts",
"frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx",
"frontend-modern/src/components/Infrastructure/__tests__/infrastructureSummaryModel.test.ts",
"frontend-modern/src/components/Infrastructure/__tests__/unifiedResourceTableStateModel.test.ts",
+ "frontend-modern/src/components/Workloads/GuestDrawer.test.tsx",
+ "frontend-modern/src/components/Workloads/MetricBar.test.tsx",
+ "frontend-modern/src/components/Workloads/StackedMemoryBar.test.tsx",
+ "frontend-modern/src/components/Workloads/ThresholdSlider.test.tsx",
"frontend-modern/src/components/Workloads/WorkloadsSummary.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/DiskList.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/EnhancedCPUBar.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/useEnhancedCPUBarState.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/useGroupedTableWindowing.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/useMetricBarState.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/useStackedDiskBarState.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/useStackedMemoryBarState.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/useThresholdSliderState.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/useWorkloadSelectionState.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/useWorkloadViewportSync.test.tsx",
+ "frontend-modern/src/components/Workloads/__tests__/useWorkloadsFilterState.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/workloadFilterConfigModel.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/workloadRouteModel.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/workloadRouteStateModel.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/workloadSelectionModel.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/workloadSelectors.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/workloadTopology.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/workloadUrlSyncModel.test.ts",
"frontend-modern/src/pages/__tests__/Workloads.helpers.test.ts",
"frontend-modern/src/utils/__tests__/thresholdSliderPresentation.test.ts",
],
diff --git a/scripts/release_control/subsystem_lookup_test.py b/scripts/release_control/subsystem_lookup_test.py
index eaaad19a33..2fb60f89cf 100644
--- a/scripts/release_control/subsystem_lookup_test.py
+++ b/scripts/release_control/subsystem_lookup_test.py
@@ -9,7 +9,6 @@ RECOVERY_PRODUCT_SURFACE_EXACT_FILES = [
"frontend-modern/src/components/Recovery/RecoverySummary.test.tsx",
"frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx",
"frontend-modern/src/pages/__tests__/Recovery.test.tsx",
- "frontend-modern/src/utils/__tests__/dashboardRecoveryPresentation.test.ts",
"frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts",
"tests/integration/tests/17-recovery-layout.spec.ts",
]
@@ -357,7 +356,7 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(performance_match["lane_context"]["lane_id"], "L10")
self.assertEqual(
performance_match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
unified_resources_match = matches_by_subsystem["unified-resources"]
@@ -409,7 +408,7 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(performance_match["lane_context"]["lane_id"], "L10")
self.assertEqual(
performance_match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
self.assertIn(
"frontend-modern/src/components/Infrastructure/__tests__/infrastructureSummaryModel.test.ts",
@@ -461,8 +460,8 @@ class SubsystemLookupTest(unittest.TestCase):
match["verification_requirement"]["exact_files"],
)
- def test_lookup_paths_assigns_recent_alerts_panel_to_alerts(self) -> None:
- result = lookup_paths(["frontend-modern/src/components/Alerts/RecentAlertsPanel.tsx"])
+ def test_lookup_paths_assigns_bulk_edit_dialog_to_alerts(self) -> None:
+ result = lookup_paths(["frontend-modern/src/components/Alerts/BulkEditDialog.tsx"])
self.assertEqual(result["unowned_runtime_files"], [])
self.assertEqual(
{item["subsystem"] for item in result["impacted_subsystems"]},
@@ -476,7 +475,7 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(match["lane_context"]["lane_id"], "L6")
self.assertEqual(match["verification_requirement"]["id"], "alerts-frontend-surface")
self.assertIn(
- "frontend-modern/src/components/Alerts/__tests__/RecentAlertsPanel.test.tsx",
+ "frontend-modern/src/components/Alerts/__tests__/BulkEditDialog.test.tsx",
match["verification_requirement"]["exact_files"],
)
@@ -734,85 +733,32 @@ class SubsystemLookupTest(unittest.TestCase):
RECOVERY_PRODUCT_SURFACE_EXACT_FILES,
)
- def test_lookup_paths_assigns_dashboard_page_to_storage_recovery(self) -> None:
- result = lookup_paths(["frontend-modern/src/pages/Dashboard.tsx"])
- self.assertEqual(result["unowned_runtime_files"], [])
- self.assertEqual(
- {item["subsystem"] for item in result["impacted_subsystems"]},
- {"storage-recovery"},
- )
+ def test_lookup_paths_reports_retired_dashboard_page_as_unowned(self) -> None:
+ path = "frontend-modern/src/pages/Dashboard.tsx"
+ result = lookup_paths([path])
+ self.assertEqual(result["unowned_runtime_files"], [path])
+ self.assertEqual(result["impacted_subsystems"], [])
file_entry = result["files"][0]
self.assertEqual(file_entry["classification"], "runtime")
- self.assertEqual(
- {match["subsystem"] for match in file_entry["matches"]},
- {"storage-recovery"},
- )
- 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")
- self.assertEqual(
- match["verification_requirement"]["id"],
- "dashboard-storage-recovery-surface",
- )
- self.assertEqual(
- match["verification_requirement"]["exact_files"],
- [
- "frontend-modern/src/pages/__tests__/DashboardPage.test.tsx",
- ],
- )
+ self.assertEqual(file_entry["matches"], [])
- def test_lookup_paths_assigns_dashboard_widgets_to_storage_recovery(self) -> None:
- 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"]},
- {"storage-recovery"},
- )
+ def test_lookup_paths_reports_retired_dashboard_widgets_as_unowned(self) -> None:
+ path = "frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts"
+ result = lookup_paths([path])
+ self.assertEqual(result["unowned_runtime_files"], [path])
+ self.assertEqual(result["impacted_subsystems"], [])
file_entry = result["files"][0]
self.assertEqual(file_entry["classification"], "runtime")
- self.assertEqual(
- {match["subsystem"] for match in file_entry["matches"]},
- {"storage-recovery"},
- )
- match = file_entry["matches"][0]
- self.assertEqual(match["contract"], "docs/release-control/v6/internal/subsystems/storage-recovery.md")
+ self.assertEqual(file_entry["matches"], [])
- 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"},
- )
+ def test_lookup_paths_reports_retired_dashboard_overview_as_unowned(self) -> None:
+ path = "frontend-modern/src/features/dashboardOverview/ProblemResourcesTable.tsx"
+ result = lookup_paths([path])
+ self.assertEqual(result["unowned_runtime_files"], [path])
+ self.assertEqual(result["impacted_subsystems"], [])
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-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/features/dashboardOverview/__tests__/dashboardPulseBriefModel.test.ts",
- "frontend-modern/src/pages/__tests__/DashboardPage.test.tsx",
- "frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts",
- "frontend-modern/src/utils/__tests__/problemResourcePresentation.test.ts",
- "frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts",
- ],
- )
+ self.assertEqual(file_entry["matches"], [])
def test_lookup_paths_assigns_recovery_points_hook_to_storage_recovery(self) -> None:
result = lookup_paths(["frontend-modern/src/hooks/useRecoveryPoints.ts"])
@@ -886,26 +832,17 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(match["lane_context"]["lane_id"], "L15")
self.assertEqual(match["verification_requirement"]["id"], "recovery-product-surface")
- def test_lookup_paths_assigns_dashboard_recovery_hook_to_storage_recovery(self) -> None:
- result = lookup_paths(["frontend-modern/src/hooks/useDashboardRecovery.ts"])
- self.assertEqual(result["unowned_runtime_files"], [])
- self.assertEqual(
- {item["subsystem"] for item in result["impacted_subsystems"]},
- {"storage-recovery"},
- )
+ def test_lookup_paths_reports_retired_dashboard_recovery_hook_as_unowned(self) -> None:
+ path = "frontend-modern/src/hooks/useDashboardRecovery.ts"
+ result = lookup_paths([path])
+ self.assertEqual(result["unowned_runtime_files"], [path])
+ self.assertEqual(result["impacted_subsystems"], [])
file_entry = result["files"][0]
self.assertEqual(file_entry["classification"], "runtime")
- self.assertEqual(
- {match["subsystem"] for match in file_entry["matches"]},
- {"storage-recovery"},
- )
- 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")
- self.assertEqual(match["verification_requirement"]["id"], "recovery-product-surface")
+ self.assertEqual(file_entry["matches"], [])
- def test_lookup_paths_assigns_recovery_status_panel_to_storage_recovery(self) -> None:
- result = lookup_paths(["frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx"])
+ def test_lookup_paths_assigns_recovery_summary_component_to_storage_recovery(self) -> None:
+ result = lookup_paths(["frontend-modern/src/components/Recovery/RecoverySummary.tsx"])
self.assertEqual(result["unowned_runtime_files"], [])
self.assertEqual(
{item["subsystem"] for item in result["impacted_subsystems"]},
@@ -922,26 +859,17 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(match["lane_context"]["lane_id"], "L15")
self.assertEqual(match["verification_requirement"]["id"], "recovery-product-surface")
- def test_lookup_paths_assigns_dashboard_recovery_presentation_to_storage_recovery(self) -> None:
- result = lookup_paths(["frontend-modern/src/utils/dashboardRecoveryPresentation.ts"])
- self.assertEqual(result["unowned_runtime_files"], [])
- self.assertEqual(
- {item["subsystem"] for item in result["impacted_subsystems"]},
- {"storage-recovery"},
- )
+ def test_lookup_paths_reports_retired_dashboard_recovery_presentation_as_unowned(self) -> None:
+ path = "frontend-modern/src/utils/dashboardRecoveryPresentation.ts"
+ result = lookup_paths([path])
+ self.assertEqual(result["unowned_runtime_files"], [path])
+ self.assertEqual(result["impacted_subsystems"], [])
file_entry = result["files"][0]
self.assertEqual(file_entry["classification"], "runtime")
- self.assertEqual(
- {match["subsystem"] for match in file_entry["matches"]},
- {"storage-recovery"},
- )
- 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")
- self.assertEqual(match["verification_requirement"]["id"], "recovery-product-surface")
+ self.assertEqual(file_entry["matches"], [])
def test_lookup_paths_assigns_storage_panel_to_storage_recovery(self) -> None:
- result = lookup_paths(["frontend-modern/src/components/Storage/DashboardStoragePanel.tsx"])
+ result = lookup_paths(["frontend-modern/src/components/Storage/Storage.tsx"])
self.assertEqual(result["unowned_runtime_files"], [])
self.assertEqual(
{item["subsystem"] for item in result["impacted_subsystems"]},
@@ -960,7 +888,6 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(
match["verification_requirement"]["exact_files"],
[
- "frontend-modern/src/components/Storage/__tests__/DashboardStoragePanel.test.tsx",
"frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx",
"frontend-modern/src/components/Storage/__tests__/Storage.test.tsx",
"frontend-modern/src/components/Storage/__tests__/StorageControls.test.tsx",
@@ -976,54 +903,18 @@ class SubsystemLookupTest(unittest.TestCase):
"frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.ts",
"frontend-modern/src/features/storageBackups/__tests__/storagePoolsTablePresentation.test.ts",
"frontend-modern/src/pages/__tests__/Storage.helpers.test.ts",
- "frontend-modern/src/utils/__tests__/dashboardStoragePresentation.test.ts",
"frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts",
],
)
- def test_lookup_paths_assigns_dashboard_storage_presentation_to_storage_recovery(self) -> None:
- result = lookup_paths(["frontend-modern/src/utils/dashboardStoragePresentation.ts"])
- self.assertEqual(result["unowned_runtime_files"], [])
- self.assertEqual(
- {item["subsystem"] for item in result["impacted_subsystems"]},
- {"storage-recovery"},
- )
+ def test_lookup_paths_reports_retired_dashboard_storage_presentation_as_unowned(self) -> None:
+ path = "frontend-modern/src/utils/dashboardStoragePresentation.ts"
+ result = lookup_paths([path])
+ self.assertEqual(result["unowned_runtime_files"], [path])
+ self.assertEqual(result["impacted_subsystems"], [])
file_entry = result["files"][0]
self.assertEqual(file_entry["classification"], "runtime")
- self.assertEqual(
- {match["subsystem"] for match in file_entry["matches"]},
- {"storage-recovery"},
- )
- 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")
- self.assertEqual(match["verification_requirement"]["id"], "storage-product-surface")
- self.assertEqual(
- match["verification_requirement"]["exact_files"],
- [
- "frontend-modern/src/components/Storage/__tests__/DashboardStoragePanel.test.tsx",
- "frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx",
- "frontend-modern/src/components/Storage/__tests__/Storage.test.tsx",
- "frontend-modern/src/components/Storage/__tests__/StorageControls.test.tsx",
- "frontend-modern/src/components/Storage/__tests__/StorageGroupRow.test.tsx",
- "frontend-modern/src/components/Storage/__tests__/StoragePoolDetail.test.tsx",
- "frontend-modern/src/components/Storage/__tests__/useStoragePageSummary.test.ts",
- "frontend-modern/src/components/Storage/code_standards.test.ts",
- "frontend-modern/src/features/storageBackups/__tests__/resourceStorageMapping.test.ts",
- "frontend-modern/src/features/storageBackups/__tests__/storageAdapters.test.ts",
- "frontend-modern/src/features/storageBackups/__tests__/storageAlertState.test.ts",
- "frontend-modern/src/features/storageBackups/__tests__/storageDomain.test.ts",
- "frontend-modern/src/features/storageBackups/__tests__/storageModelCore.test.ts",
- "frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.ts",
- "frontend-modern/src/features/storageBackups/__tests__/storagePoolsTablePresentation.test.ts",
- "frontend-modern/src/pages/__tests__/Storage.helpers.test.ts",
- "frontend-modern/src/utils/__tests__/dashboardStoragePresentation.test.ts",
- "frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts",
- ],
- )
+ self.assertEqual(file_entry["matches"], [])
def test_lookup_paths_assigns_storage_page_to_storage_recovery(self) -> None:
result = lookup_paths(["frontend-modern/src/pages/Storage.tsx"])
@@ -2234,13 +2125,13 @@ class SubsystemLookupTest(unittest.TestCase):
match["verification_requirement"]["exact_files"],
)
- def test_lookup_paths_assigns_dashboard_guest_row_runtime_to_performance_and_scalability(self) -> None:
+ def test_lookup_paths_assigns_workloads_guest_row_runtime_to_performance_and_scalability(self) -> None:
result = lookup_paths(
[
- "frontend-modern/src/components/Dashboard/GuestRow.tsx",
- "frontend-modern/src/components/Dashboard/GuestRowCells.tsx",
- "frontend-modern/src/components/Dashboard/guestRowModel.tsx",
- "frontend-modern/src/components/Dashboard/useGuestRowState.ts",
+ "frontend-modern/src/components/Workloads/GuestRow.tsx",
+ "frontend-modern/src/components/Workloads/GuestRowCells.tsx",
+ "frontend-modern/src/components/Workloads/guestRowModel.tsx",
+ "frontend-modern/src/components/Workloads/useGuestRowState.ts",
]
)
self.assertEqual(result["unowned_runtime_files"], [])
@@ -2262,12 +2153,12 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(match["lane_context"]["lane_id"], "L10")
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_guest_metadata_runtime_to_performance_and_scalability(self) -> None:
+ def test_lookup_paths_assigns_workloads_guest_metadata_runtime_to_performance_and_scalability(self) -> None:
result = lookup_paths(
- ["frontend-modern/src/components/Dashboard/useDashboardGuestMetadataState.ts"]
+ ["frontend-modern/src/components/Workloads/useWorkloadGuestMetadataState.ts"]
)
self.assertEqual(result["unowned_runtime_files"], [])
self.assertEqual(
@@ -2287,21 +2178,21 @@ class SubsystemLookupTest(unittest.TestCase):
)
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_workload_route_runtime_to_performance_and_scalability(
+ def test_lookup_paths_assigns_workload_route_runtime_to_performance_and_scalability(
self,
) -> None:
result = lookup_paths(
[
- "frontend-modern/src/components/Dashboard/dashboardWorkloadFilterConfigModel.ts",
- "frontend-modern/src/components/Dashboard/dashboardWorkloadRouteModel.ts",
- "frontend-modern/src/components/Dashboard/dashboardWorkloadRouteStateModel.ts",
- "frontend-modern/src/components/Dashboard/dashboardWorkloadUrlSyncModel.ts",
- "frontend-modern/src/components/Dashboard/useDashboardWorkloadFilterOptions.ts",
- "frontend-modern/src/components/Dashboard/useDashboardWorkloadRouteState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardWorkloadUrlSync.ts",
+ "frontend-modern/src/components/Workloads/workloadFilterConfigModel.ts",
+ "frontend-modern/src/components/Workloads/workloadRouteModel.ts",
+ "frontend-modern/src/components/Workloads/workloadRouteStateModel.ts",
+ "frontend-modern/src/components/Workloads/workloadUrlSyncModel.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadFilterOptions.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadRouteState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadUrlSync.ts",
]
)
self.assertEqual(result["unowned_runtime_files"], [])
@@ -2322,16 +2213,16 @@ class SubsystemLookupTest(unittest.TestCase):
)
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_selection_runtime_to_performance_and_scalability(
+ def test_lookup_paths_assigns_workloads_selection_model_runtime_to_performance_and_scalability(
self,
) -> None:
result = lookup_paths(
[
- "frontend-modern/src/components/Dashboard/dashboardSelectionModel.ts",
- "frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts",
+ "frontend-modern/src/components/Workloads/workloadSelectionModel.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts",
]
)
self.assertEqual(result["unowned_runtime_files"], [])
@@ -2352,14 +2243,14 @@ class SubsystemLookupTest(unittest.TestCase):
)
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_workload_table_runtime_to_performance_and_scalability(
+ def test_lookup_paths_assigns_workload_table_runtime_to_performance_and_scalability(
self,
) -> None:
result = lookup_paths(
- ["frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx"]
+ ["frontend-modern/src/components/Workloads/WorkloadsTable.tsx"]
)
self.assertEqual(result["unowned_runtime_files"], [])
self.assertEqual(
@@ -2379,13 +2270,13 @@ class SubsystemLookupTest(unittest.TestCase):
)
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_workload_panel_runtime_to_performance_and_scalability(
+ def test_lookup_paths_assigns_workload_panel_runtime_to_performance_and_scalability(
self,
) -> None:
- result = lookup_paths(["frontend-modern/src/components/Dashboard/WorkloadPanel.tsx"])
+ result = lookup_paths(["frontend-modern/src/components/Workloads/WorkloadPanel.tsx"])
self.assertEqual(result["unowned_runtime_files"], [])
self.assertEqual(
{item["subsystem"] for item in result["impacted_subsystems"]},
@@ -2404,14 +2295,14 @@ class SubsystemLookupTest(unittest.TestCase):
)
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_workload_header_runtime_to_performance_and_scalability(
+ def test_lookup_paths_assigns_workload_header_runtime_to_performance_and_scalability(
self,
) -> None:
result = lookup_paths(
- ["frontend-modern/src/components/Dashboard/WorkloadTableHeader.tsx"]
+ ["frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx"]
)
self.assertEqual(result["unowned_runtime_files"], [])
self.assertEqual(
@@ -2431,14 +2322,14 @@ class SubsystemLookupTest(unittest.TestCase):
)
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_selection_runtime_to_performance_and_scalability(
+ def test_lookup_paths_assigns_workloads_selection_state_runtime_to_performance_and_scalability(
self,
) -> None:
result = lookup_paths(
- ["frontend-modern/src/components/Dashboard/useDashboardSelectionState.ts"]
+ ["frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts"]
)
self.assertEqual(result["unowned_runtime_files"], [])
self.assertEqual(
@@ -2458,14 +2349,14 @@ class SubsystemLookupTest(unittest.TestCase):
)
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_workload_url_sync_runtime_to_performance_and_scalability(
+ def test_lookup_paths_assigns_workload_url_sync_runtime_to_performance_and_scalability(
self,
) -> None:
result = lookup_paths(
- ["frontend-modern/src/components/Dashboard/useDashboardWorkloadUrlSync.ts"]
+ ["frontend-modern/src/components/Workloads/useWorkloadUrlSync.ts"]
)
self.assertEqual(result["unowned_runtime_files"], [])
self.assertEqual(
@@ -2485,14 +2376,14 @@ class SubsystemLookupTest(unittest.TestCase):
)
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_workload_derived_state_runtime_to_performance_and_scalability(
+ def test_lookup_paths_assigns_workload_derived_state_runtime_to_performance_and_scalability(
self,
) -> None:
result = lookup_paths(
- ["frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts"]
+ ["frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts"]
)
self.assertEqual(result["unowned_runtime_files"], [])
self.assertEqual(
@@ -2512,14 +2403,14 @@ class SubsystemLookupTest(unittest.TestCase):
)
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_workload_viewport_sync_runtime_to_performance_and_scalability(
+ def test_lookup_paths_assigns_workload_viewport_sync_runtime_to_performance_and_scalability(
self,
) -> None:
result = lookup_paths(
- ["frontend-modern/src/components/Dashboard/useDashboardWorkloadViewportSync.ts"]
+ ["frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts"]
)
self.assertEqual(result["unowned_runtime_files"], [])
self.assertEqual(
@@ -2539,14 +2430,14 @@ class SubsystemLookupTest(unittest.TestCase):
)
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_controls_state_runtime_to_performance_and_scalability(
+ def test_lookup_paths_assigns_workloads_controls_state_runtime_to_performance_and_scalability(
self,
) -> None:
result = lookup_paths(
- ["frontend-modern/src/components/Dashboard/useDashboardControlsState.ts"]
+ ["frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts"]
)
self.assertEqual(result["unowned_runtime_files"], [])
self.assertEqual(
@@ -2566,14 +2457,14 @@ class SubsystemLookupTest(unittest.TestCase):
)
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_grouped_windowing_runtime_to_performance_and_scalability(
+ def test_lookup_paths_assigns_workloads_grouped_windowing_runtime_to_performance_and_scalability(
self,
) -> None:
result = lookup_paths(
- ["frontend-modern/src/components/Dashboard/useGroupedTableWindowing.ts"]
+ ["frontend-modern/src/components/Workloads/useGroupedTableWindowing.ts"]
)
self.assertEqual(result["unowned_runtime_files"], [])
self.assertEqual(
@@ -2594,20 +2485,20 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(match["lane_context"]["lane_id"], "L10")
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
self.assertIn(
- "frontend-modern/src/components/Dashboard/__tests__/useGroupedTableWindowing.test.ts",
+ "frontend-modern/src/components/Workloads/__tests__/useGroupedTableWindowing.test.ts",
match["verification_requirement"]["exact_files"],
)
- def test_lookup_paths_assigns_dashboard_guest_drawer_runtime_to_performance_and_scalability(self) -> None:
+ def test_lookup_paths_assigns_workloads_guest_drawer_runtime_to_performance_and_scalability(self) -> None:
result = lookup_paths(
[
- "frontend-modern/src/components/Dashboard/GuestDrawer.tsx",
- "frontend-modern/src/components/Dashboard/GuestDrawerOverview.tsx",
- "frontend-modern/src/components/Dashboard/guestDrawerModel.ts",
- "frontend-modern/src/components/Dashboard/useGuestDrawerState.ts",
+ "frontend-modern/src/components/Workloads/GuestDrawer.tsx",
+ "frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx",
+ "frontend-modern/src/components/Workloads/guestDrawerModel.ts",
+ "frontend-modern/src/components/Workloads/useGuestDrawerState.ts",
]
)
self.assertEqual(result["unowned_runtime_files"], [])
@@ -2628,14 +2519,14 @@ class SubsystemLookupTest(unittest.TestCase):
)
self.assertEqual(match["lane_context"]["lane_id"], "L10")
- def test_lookup_paths_assigns_dashboard_workload_topology_runtime_to_performance_and_scalability(self) -> None:
+ def test_lookup_paths_assigns_workload_topology_runtime_to_performance_and_scalability(self) -> None:
result = lookup_paths(
[
- "frontend-modern/src/components/Dashboard/workloadTopology.ts",
- "frontend-modern/src/components/Dashboard/useGuestDrawerState.ts",
- "frontend-modern/src/components/Dashboard/useGuestRowState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardWorkloadRouteState.ts",
- "frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts",
+ "frontend-modern/src/components/Workloads/workloadTopology.ts",
+ "frontend-modern/src/components/Workloads/useGuestDrawerState.ts",
+ "frontend-modern/src/components/Workloads/useGuestRowState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadRouteState.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadsDerivedState.ts",
]
)
self.assertEqual(result["unowned_runtime_files"], [])
@@ -2657,15 +2548,15 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(match["lane_context"]["lane_id"], "L10")
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_disk_list_runtime_to_performance_and_scalability(self) -> None:
+ def test_lookup_paths_assigns_workloads_disk_list_runtime_to_performance_and_scalability(self) -> None:
result = lookup_paths(
[
- "frontend-modern/src/components/Dashboard/DiskList.tsx",
- "frontend-modern/src/components/Dashboard/diskListModel.ts",
- "frontend-modern/src/components/Dashboard/useDiskListState.ts",
+ "frontend-modern/src/components/Workloads/DiskList.tsx",
+ "frontend-modern/src/components/Workloads/diskListModel.ts",
+ "frontend-modern/src/components/Workloads/useDiskListState.ts",
]
)
self.assertEqual(result["unowned_runtime_files"], [])
@@ -2687,15 +2578,15 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(match["lane_context"]["lane_id"], "L10")
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_filter_runtime_to_performance_and_scalability(self) -> None:
+ def test_lookup_paths_assigns_workloads_filter_runtime_to_performance_and_scalability(self) -> None:
result = lookup_paths(
[
- "frontend-modern/src/components/Dashboard/DashboardFilter.tsx",
- "frontend-modern/src/components/Dashboard/dashboardFilterModel.ts",
- "frontend-modern/src/components/Dashboard/useDashboardFilterState.ts",
+ "frontend-modern/src/components/Workloads/WorkloadsFilter.tsx",
+ "frontend-modern/src/components/Workloads/workloadsFilterModel.ts",
+ "frontend-modern/src/components/Workloads/useWorkloadsFilterState.ts",
]
)
self.assertEqual(result["unowned_runtime_files"], [])
@@ -2717,15 +2608,15 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(match["lane_context"]["lane_id"], "L10")
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_threshold_slider_runtime_to_performance_and_scalability(self) -> None:
+ def test_lookup_paths_assigns_workloads_threshold_slider_runtime_to_performance_and_scalability(self) -> None:
result = lookup_paths(
[
- "frontend-modern/src/components/Dashboard/ThresholdSlider.tsx",
- "frontend-modern/src/components/Dashboard/thresholdSliderModel.ts",
- "frontend-modern/src/components/Dashboard/useThresholdSliderState.ts",
+ "frontend-modern/src/components/Workloads/ThresholdSlider.tsx",
+ "frontend-modern/src/components/Workloads/thresholdSliderModel.ts",
+ "frontend-modern/src/components/Workloads/useThresholdSliderState.ts",
]
)
self.assertEqual(result["unowned_runtime_files"], [])
@@ -2747,7 +2638,7 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(match["lane_context"]["lane_id"], "L10")
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
def test_lookup_paths_assigns_threshold_slider_presentation_to_performance_and_scalability(
@@ -2773,15 +2664,15 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(match["lane_context"]["lane_id"], "L10")
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_stacked_disk_bar_runtime_to_performance_and_scalability(self) -> None:
+ def test_lookup_paths_assigns_workloads_stacked_disk_bar_runtime_to_performance_and_scalability(self) -> None:
result = lookup_paths(
[
- "frontend-modern/src/components/Dashboard/StackedDiskBar.tsx",
- "frontend-modern/src/components/Dashboard/stackedDiskBarModel.ts",
- "frontend-modern/src/components/Dashboard/useStackedDiskBarState.ts",
+ "frontend-modern/src/components/Workloads/StackedDiskBar.tsx",
+ "frontend-modern/src/components/Workloads/stackedDiskBarModel.ts",
+ "frontend-modern/src/components/Workloads/useStackedDiskBarState.ts",
]
)
self.assertEqual(result["unowned_runtime_files"], [])
@@ -2803,19 +2694,19 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(match["lane_context"]["lane_id"], "L10")
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_stacked_memory_bar_runtime_to_performance_and_scalability(self) -> None:
+ def test_lookup_paths_assigns_workloads_stacked_memory_bar_runtime_to_performance_and_scalability(self) -> None:
result = lookup_paths(
[
- "frontend-modern/src/components/Dashboard/StackedMemoryBar.tsx",
- "frontend-modern/src/components/Dashboard/stackedMemoryBarModel.ts",
- "frontend-modern/src/components/Dashboard/useStackedMemoryBarState.ts",
+ "frontend-modern/src/components/Workloads/StackedMemoryBar.tsx",
+ "frontend-modern/src/components/Workloads/stackedMemoryBarModel.ts",
+ "frontend-modern/src/components/Workloads/useStackedMemoryBarState.ts",
]
)
self.assertEqual(result["unowned_runtime_files"], [])
@@ -2837,15 +2728,15 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(match["lane_context"]["lane_id"], "L10")
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_metric_bar_runtime_to_performance_and_scalability(self) -> None:
+ def test_lookup_paths_assigns_workloads_metric_bar_runtime_to_performance_and_scalability(self) -> None:
result = lookup_paths(
[
- "frontend-modern/src/components/Dashboard/MetricBar.tsx",
- "frontend-modern/src/components/Dashboard/metricBarModel.ts",
- "frontend-modern/src/components/Dashboard/useMetricBarState.ts",
+ "frontend-modern/src/components/Workloads/MetricBar.tsx",
+ "frontend-modern/src/components/Workloads/metricBarModel.ts",
+ "frontend-modern/src/components/Workloads/useMetricBarState.ts",
]
)
self.assertEqual(result["unowned_runtime_files"], [])
@@ -2867,15 +2758,15 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(match["lane_context"]["lane_id"], "L10")
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
- def test_lookup_paths_assigns_dashboard_enhanced_cpu_bar_runtime_to_performance_and_scalability(self) -> None:
+ def test_lookup_paths_assigns_workloads_enhanced_cpu_bar_runtime_to_performance_and_scalability(self) -> None:
result = lookup_paths(
[
- "frontend-modern/src/components/Dashboard/EnhancedCPUBar.tsx",
- "frontend-modern/src/components/Dashboard/enhancedCpuBarModel.ts",
- "frontend-modern/src/components/Dashboard/useEnhancedCPUBarState.ts",
+ "frontend-modern/src/components/Workloads/EnhancedCPUBar.tsx",
+ "frontend-modern/src/components/Workloads/enhancedCpuBarModel.ts",
+ "frontend-modern/src/components/Workloads/useEnhancedCPUBarState.ts",
]
)
self.assertEqual(result["unowned_runtime_files"], [])
@@ -2897,7 +2788,7 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(match["lane_context"]["lane_id"], "L10")
self.assertEqual(
match["verification_requirement"]["id"],
- "dashboard-workload-hot-path",
+ "workloads-hot-path",
)
def test_lookup_paths_assigns_settings_page_shell_to_frontend_primitives(self) -> None:
@@ -4874,7 +4765,6 @@ class SubsystemLookupTest(unittest.TestCase):
"frontend-modern/src/components/Infrastructure/__tests__/unifiedResourceTableStateModel.test.ts",
"frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.ts",
"frontend-modern/src/features/infrastructure/__tests__/infrastructurePageModel.test.ts",
- "frontend-modern/src/hooks/__tests__/useDashboardTrends.test.ts",
"frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts",
"frontend-modern/src/pages/__tests__/Infrastructure.empty-state.test.tsx",
"frontend-modern/src/pages/__tests__/Infrastructure.pbs-pmg.test.tsx",
diff --git a/tests/integration/pw-measure.mjs b/tests/integration/pw-measure.mjs
index 3b58c4b4c0..14932deb8d 100644
--- a/tests/integration/pw-measure.mjs
+++ b/tests/integration/pw-measure.mjs
@@ -8,7 +8,7 @@ const context = await browser.newContext({
const page = await context.newPage();
// Navigate via Vite proxy which handles WebSocket
-await page.goto('http://localhost:5173/dashboard', { waitUntil: 'networkidle', timeout: 30000 });
+await page.goto('http://localhost:5173/infrastructure', { waitUntil: 'networkidle', timeout: 30000 });
// Force a hard reload to clear HMR state
await page.reload({ waitUntil: 'networkidle', timeout: 30000 });
// Give websocket time to connect and data to load
@@ -21,28 +21,28 @@ if (await btn.count() > 0) {
await page.waitForTimeout(1000);
}
-// Wait for dashboard content - look for KPI strip grid
+// Wait for infrastructure content.
try {
await page.waitForFunction(() => {
- const s = document.querySelector('[data-testid="dashboard-page"] > section');
- return s && s.children.length >= 4;
+ const s = document.querySelector('[data-testid="infrastructure-page"]');
+ return s && s.textContent?.includes('Infrastructure');
}, { timeout: 20000 });
- console.log('Dashboard loaded');
+ console.log('Infrastructure loaded');
} catch (e) {
- console.log('Timeout waiting for dashboard content, continuing anyway');
+ console.log('Timeout waiting for infrastructure content, continuing anyway');
}
await page.waitForTimeout(1000);
-await page.screenshot({ path: '/tmp/dashboard-v8.png', fullPage: false });
-await page.screenshot({ path: '/tmp/dashboard-v8-full.png', fullPage: true });
+await page.screenshot({ path: '/tmp/infrastructure-v8.png', fullPage: false });
+await page.screenshot({ path: '/tmp/infrastructure-v8-full.png', fullPage: true });
const info = await page.evaluate(() => {
- const s = document.querySelector('[data-testid="dashboard-page"] > section');
+ const s = document.querySelector('[data-testid="infrastructure-page"]');
if (s === null) {
- return { loaded: false, html: document.querySelector('[data-testid="dashboard-page"]')?.innerHTML?.substring(0, 200) };
+ return { loaded: false, html: document.querySelector('[data-testid="infrastructure-page"]')?.innerHTML?.substring(0, 200) };
}
- const dashEl = document.querySelector('[data-testid="dashboard-page"]');
- const dashTop = Math.round(dashEl.getBoundingClientRect().top);
+ const surfaceEl = document.querySelector('[data-testid="infrastructure-page"]');
+ const surfaceTop = Math.round(surfaceEl.getBoundingClientRect().top);
const items = Array.from(s.children).map((el, i) => {
const r = el.getBoundingClientRect();
const prev = i > 0 ? s.children[i - 1].getBoundingClientRect().bottom : null;
@@ -57,18 +57,18 @@ const info = await page.evaluate(() => {
pb: cs.paddingBottom,
};
});
- return { loaded: true, dashTop, items };
+ return { loaded: true, surfaceTop, items };
});
if (info.loaded) {
- console.log('Dashboard starts at y=' + info.dashTop);
+ console.log('Infrastructure starts at y=' + info.surfaceTop);
for (const m of info.items) {
console.log(`child-${m.i}: gap=${m.gap} top=${m.top} h=${m.h} bot=${m.bot} pt=${m.pt} pb=${m.pb}`);
}
const last = info.items[info.items.length - 1];
console.log(`Content ends at y=${last.bot}, below-fold: ${900 - last.bot}px`);
} else {
- console.log('Dashboard not loaded:', info.html);
+ console.log('Infrastructure not loaded:', info.html);
}
await browser.close();
diff --git a/tests/integration/tests/01-core-e2e.spec.ts b/tests/integration/tests/01-core-e2e.spec.ts
index 1f6d4f7232..ddfa2e9a45 100644
--- a/tests/integration/tests/01-core-e2e.spec.ts
+++ b/tests/integration/tests/01-core-e2e.spec.ts
@@ -14,7 +14,7 @@ const truthy = (value: string | undefined) => {
};
test.describe.serial('Core E2E flows', () => {
- test('Bootstrap flow - setup wizard and dashboard', async ({ page }) => {
+ test('Bootstrap flow - setup wizard and infrastructure landing', async ({ page }) => {
await ensureAuthenticated(page);
// v6 default landing page is /infrastructure (was /proxmox/overview in v5)
await expect(page).toHaveURL(/\/(infrastructure|proxmox\/overview)/);
diff --git a/tests/integration/tests/04-mobile.spec.ts b/tests/integration/tests/04-mobile.spec.ts
index b549e95a6d..db3561dce2 100644
--- a/tests/integration/tests/04-mobile.spec.ts
+++ b/tests/integration/tests/04-mobile.spec.ts
@@ -14,7 +14,7 @@ test.describe('Mobile viewport flows', () => {
test('bottom nav bar is visible on mobile', async ({ page }) => {
await dismissWhatsNewModal(page);
- await page.goto('/dashboard');
+ await page.goto('/infrastructure');
await expect(page.locator('#root')).toBeVisible();
const bottomNav = page.locator(
@@ -40,7 +40,7 @@ test.describe('Mobile viewport flows', () => {
test('MobileNavBar has safe-area padding on nav', async ({ page }) => {
await dismissWhatsNewModal(page);
- await page.goto('/dashboard');
+ await page.goto('/infrastructure');
await expect(page.locator('#root')).toBeVisible();
const nav = page.locator('nav.md\\:hidden, nav[class*="md:hidden"]').first();
@@ -125,8 +125,8 @@ test.describe('Mobile viewport flows', () => {
await expect(discoveryTab).toBeVisible({ timeout: 10000 });
});
- test('Dashboard loads without horizontal overflow at mobile viewport', async ({ page }) => {
- await page.goto('/dashboard');
+ test('Infrastructure landing loads without horizontal overflow at mobile viewport', async ({ page }) => {
+ await page.goto('/infrastructure');
await expect(page.locator('#root')).toBeVisible();
const viewportWidth = await getViewportWidth(page);
@@ -135,7 +135,7 @@ test.describe('Mobile viewport flows', () => {
});
test('AI assistant button is visible above nav bar', async ({ page }) => {
- await page.goto('/dashboard');
+ await page.goto('/infrastructure');
await expect(page.locator('#root')).toBeVisible();
const nav = page.locator('nav.md\\:hidden, nav[class*="md:hidden"]').first();
diff --git a/tests/integration/tests/11-first-session.spec.ts b/tests/integration/tests/11-first-session.spec.ts
index 38b4fc15ea..625755dbb8 100644
--- a/tests/integration/tests/11-first-session.spec.ts
+++ b/tests/integration/tests/11-first-session.spec.ts
@@ -63,7 +63,7 @@ test.describe.serial('First-session experience', () => {
await expect(page.getByText('TrueNAS', { exact: false }).first()).toBeVisible();
});
- test('dashboard shows key navigation elements', async ({ page }, testInfo) => {
+ test('shell shows key navigation elements', async ({ page }, testInfo) => {
test.skip(testInfo.project.name.startsWith('mobile-'), 'Desktop-only first-session coverage');
await ensureAuthenticated(page);
diff --git a/tests/integration/tests/16-dev-runtime-recovery.spec.ts b/tests/integration/tests/16-dev-runtime-recovery.spec.ts
index c8dfb7d2ae..94efd8d291 100644
--- a/tests/integration/tests/16-dev-runtime-recovery.spec.ts
+++ b/tests/integration/tests/16-dev-runtime-recovery.spec.ts
@@ -21,6 +21,7 @@ test.describe.serial('Managed dev runtime recovery', () => {
try {
await ensureAuthenticated(page);
+ await expect(page).not.toHaveURL(/\/dashboard(?:[/?#]|$)/);
await expect
.poll(() => securityStatusRequests.count(), {
diff --git a/tests/integration/tests/19-telemetry-disclosure.spec.ts b/tests/integration/tests/19-telemetry-disclosure.spec.ts
index d61ad9e290..2bff608b3d 100644
--- a/tests/integration/tests/19-telemetry-disclosure.spec.ts
+++ b/tests/integration/tests/19-telemetry-disclosure.spec.ts
@@ -140,25 +140,24 @@ test.describe('Telemetry disclosure', () => {
localStorage.removeItem('pulse_whats_new_v2_shown');
});
- await page.goto('/dashboard', { waitUntil: 'domcontentloaded' });
+ await page.goto('/infrastructure', { waitUntil: 'domcontentloaded' });
const dialog = page.getByRole('dialog');
const spotlight = page.locator('[data-tour-spotlight]');
const assistantLauncher = page.getByRole('button', { name: 'Expand Pulse Assistant' });
- const dashboardTab = page.locator(
- '[role="tab"][title="Environment overview and command center"]',
- );
const infrastructureTab = page.locator(
'[role="tab"][title="All agents and nodes across platforms"]',
);
- await expect(dialog).toHaveAttribute('aria-label', 'Welcome to Pulse v6');
- await expect(dialog.getByText('Step 1 of 5')).toBeVisible();
- await expect(dialog.getByText('Quick Tour')).toBeVisible();
+ await expect(dialog).toHaveAttribute('aria-label', 'Pulse navigation guide');
+ await expect(dialog.getByText('Step 1 of 4')).toBeVisible();
+ await expect(dialog.getByText('Nav guide')).toBeVisible();
await expect(assistantLauncher).toBeHidden();
- await expect(spotlight).toHaveAttribute('data-tour-step', 'dashboard');
- await expect(dialog).toHaveAttribute('data-tour-step', 'dashboard');
- await expectSpotlightAround(spotlight, dashboardTab);
- await expect(dialog.getByText(/Start here for health, alerts, capacity/i)).toBeVisible();
+ await expect(spotlight).toHaveAttribute('data-tour-step', 'infrastructure');
+ await expect(dialog).toHaveAttribute('data-tour-step', 'infrastructure');
+ await expectSpotlightAround(spotlight, infrastructureTab);
+ await expect(
+ dialog.getByText(/Start here to add, inspect, and manage infrastructure sources/i),
+ ).toBeVisible();
await expect(dialog.getByRole('link', { name: 'Telemetry details' })).toBeVisible();
const privacyLink = dialog.getByRole('link', { name: 'Telemetry details' });
@@ -179,11 +178,6 @@ test.describe('Telemetry disclosure', () => {
'Migration Guide: Unified Navigation',
);
- await dialog.getByRole('button', { name: 'Next' }).click();
- await expect(dialog).toHaveAttribute('data-tour-step', 'infrastructure');
- await expect(spotlight).toHaveAttribute('data-tour-step', 'infrastructure');
- await expectSpotlightAround(spotlight, infrastructureTab);
-
for (let step = 0; step < 3; step += 1) {
await dialog.getByRole('button', { name: 'Next' }).click();
}
diff --git a/tests/integration/tests/20-local-doc-links.spec.ts b/tests/integration/tests/20-local-doc-links.spec.ts
index 9ac967ad25..d6e057a696 100644
--- a/tests/integration/tests/20-local-doc-links.spec.ts
+++ b/tests/integration/tests/20-local-doc-links.spec.ts
@@ -126,7 +126,7 @@ test.describe('Local docs links', () => {
});
});
- await page.goto('/dashboard', { waitUntil: 'domcontentloaded' });
+ await page.goto('/infrastructure', { waitUntil: 'domcontentloaded' });
const securityGuideLink = page.getByRole('link', { name: 'Learn More' }).first();
await expect(securityGuideLink).toHaveAttribute('href', '/docs/SECURITY.md');
diff --git a/tests/integration/tests/57-dashboard-infrastructure-transition.spec.ts b/tests/integration/tests/57-dashboard-infrastructure-transition.spec.ts
deleted file mode 100644
index be6f9b2573..0000000000
--- a/tests/integration/tests/57-dashboard-infrastructure-transition.spec.ts
+++ /dev/null
@@ -1,116 +0,0 @@
-import { test, expect, type Page } from '@playwright/test';
-import { ensureAuthenticated, getMockMode, setMockMode } from './helpers';
-
-const waitForDashboardReady = async (page: Page) => {
- await expect(page).toHaveURL(/\/dashboard(?:\?.*)?$/);
- await expect(page.getByTestId('dashboard-page')).toBeVisible();
- await page.waitForFunction(
- () => !document.querySelector('[data-testid="dashboard-loading"]'),
- undefined,
- { timeout: 30_000 },
- );
-};
-
-const waitForInfrastructureReady = async (page: Page) => {
- await expect(page).toHaveURL(/\/infrastructure(?:\?.*)?$/);
- await expect(page.getByTestId('infrastructure-page')).toBeVisible();
- await page.waitForFunction(
- () => {
- if (document.querySelector('[data-testid="infrastructure-loading"]')) {
- return false;
- }
- if (document.querySelector('[data-testid="infrastructure-summary"]')) {
- return true;
- }
- const text = document.body?.textContent || '';
- return text.includes('No infrastructure resources yet');
- },
- undefined,
- { timeout: 30_000 },
- );
-};
-
-test('dashboard handoff keeps infrastructure tab switches free of transient loading shells', async ({
- page,
-}) => {
- await ensureAuthenticated(page);
-
- let initialMockMode: { enabled: boolean } | null = null;
- try {
- initialMockMode = await getMockMode(page);
- if (!initialMockMode.enabled) {
- await setMockMode(page, true);
- }
- } catch (error) {
- console.warn(`[transition] unable to read/set mock mode, continuing: ${String(error)}`);
- }
-
- try {
- await page.goto('/dashboard');
- await waitForDashboardReady(page);
-
- await page.evaluate(() => {
- const state = {
- routeFallback: false,
- infrastructureLoading: false,
- };
- const root = document.getElementById('root') || document.body;
- const observer = new MutationObserver(() => {
- const text = document.body?.innerText || '';
- if (text.includes('Loading view...')) {
- state.routeFallback = true;
- }
- if (document.querySelector('[data-testid="infrastructure-loading"]')) {
- state.infrastructureLoading = true;
- }
- });
- observer.observe(root, {
- childList: true,
- subtree: true,
- characterData: true,
- attributes: true,
- });
- (window as typeof window & {
- __pulseTransitionObserver?: MutationObserver;
- __pulseTransitionState?: typeof state;
- }).__pulseTransitionObserver = observer;
- (window as typeof window & {
- __pulseTransitionObserver?: MutationObserver;
- __pulseTransitionState?: typeof state;
- }).__pulseTransitionState = state;
- });
-
- await page.getByRole('tab', { name: 'Infrastructure', exact: true }).first().click();
- await waitForInfrastructureReady(page);
-
- const transitionState = await page.evaluate(() => {
- const win = window as typeof window & {
- __pulseTransitionObserver?: MutationObserver;
- __pulseTransitionState?: {
- routeFallback: boolean;
- infrastructureLoading: boolean;
- };
- };
- win.__pulseTransitionObserver?.disconnect();
- return (
- win.__pulseTransitionState ?? {
- routeFallback: false,
- infrastructureLoading: false,
- }
- );
- });
-
- expect(transitionState).toEqual({
- routeFallback: false,
- infrastructureLoading: false,
- });
- } finally {
- if (initialMockMode && !initialMockMode.enabled) {
- try {
- await setMockMode(page, false);
- } catch (error) {
- console.warn(`[transition] unable to restore mock mode, continuing: ${String(error)}`);
- }
- }
- }
-});
diff --git a/tests/integration/tests/57-release-candidate-shell.spec.ts b/tests/integration/tests/57-release-candidate-shell.spec.ts
index 483fbf7157..4309ba2c39 100644
--- a/tests/integration/tests/57-release-candidate-shell.spec.ts
+++ b/tests/integration/tests/57-release-candidate-shell.spec.ts
@@ -67,8 +67,8 @@ test.describe('Release candidate shell', () => {
}),
);
- await page.goto('/dashboard', { waitUntil: 'domcontentloaded' });
- await page.waitForURL(/\/dashboard/, { timeout: 15_000 });
+ await page.goto('/infrastructure', { waitUntil: 'domcontentloaded' });
+ await page.waitForURL(/\/infrastructure/, { timeout: 15_000 });
await expect(
page.getByRole('status').filter({ hasText: 'public v6 release candidate' }),
diff --git a/tests/integration/tests/60-page-header-consistency.spec.ts b/tests/integration/tests/60-page-header-consistency.spec.ts
index 9d24a29e81..9b11724a56 100644
--- a/tests/integration/tests/60-page-header-consistency.spec.ts
+++ b/tests/integration/tests/60-page-header-consistency.spec.ts
@@ -12,13 +12,6 @@ type WorkerFixtures = {
};
const PAGE_HEADER_ROUTES = [
- {
- slug: "dashboard",
- route: "/dashboard",
- title: "Dashboard",
- description:
- "Track infrastructure health, active risks, storage pressure, and recovery readiness from one overview.",
- },
{
slug: "workloads",
route: "/workloads",
@@ -74,7 +67,6 @@ const ALIGNED_PAGE_HEADER_ROUTES = [
PAGE_HEADER_ROUTES[1],
PAGE_HEADER_ROUTES[2],
PAGE_HEADER_ROUTES[3],
- PAGE_HEADER_ROUTES[4],
] as const;
const test = base.extend<{}, WorkerFixtures>({
diff --git a/tests/integration/tests/64-dashboard-proxmox-refresh-stability.spec.ts b/tests/integration/tests/64-workloads-proxmox-refresh-stability.spec.ts
similarity index 97%
rename from tests/integration/tests/64-dashboard-proxmox-refresh-stability.spec.ts
rename to tests/integration/tests/64-workloads-proxmox-refresh-stability.spec.ts
index 1d3cca5cc9..6c61eca51a 100644
--- a/tests/integration/tests/64-dashboard-proxmox-refresh-stability.spec.ts
+++ b/tests/integration/tests/64-workloads-proxmox-refresh-stability.spec.ts
@@ -29,7 +29,7 @@ const test = base.extend<Record<string, never>, WorkerFixtures>({
"..",
"tmp",
"playwright-auth",
- `dashboard-proxmox-refresh-stability-${workerInfo.project.name}.json`,
+ `workloads-proxmox-refresh-stability-${workerInfo.project.name}.json`,
);
fs.mkdirSync(path.dirname(storageStatePath), { recursive: true });
await createAuthenticatedStorageState(browser, storageStatePath);
@@ -112,7 +112,7 @@ async function readGuestDrawerActiveTab(
return "unknown";
}
-test.describe.serial("Dashboard Proxmox refresh stability", () => {
+test.describe.serial("Workloads Proxmox refresh stability", () => {
test.setTimeout(180_000);
test.afterAll(async ({ browser }) => {
diff --git a/tests/integration/tests/65-offline-proxmox-node-visibility.spec.ts b/tests/integration/tests/65-offline-proxmox-node-visibility.spec.ts
index 90567b3374..116205cbbb 100644
--- a/tests/integration/tests/65-offline-proxmox-node-visibility.spec.ts
+++ b/tests/integration/tests/65-offline-proxmox-node-visibility.spec.ts
@@ -84,75 +84,6 @@ const OFFLINE_RESOURCE = {
},
} as const;
-const DASHBOARD_SUMMARY_RESPONSE = {
- health: {
- totalResources: 1,
- byStatus: {
- online: 0,
- offline: 1,
- running: 0,
- stopped: 0,
- degraded: 0,
- paused: 0,
- unknown: 0,
- },
- },
- infrastructure: {
- total: 1,
- byStatus: {
- online: 0,
- offline: 1,
- running: 0,
- stopped: 0,
- degraded: 0,
- paused: 0,
- unknown: 0,
- },
- byType: {
- agent: 1,
- },
- topCPU: [],
- topMemory: [],
- },
- workloads: {
- total: 0,
- running: 0,
- stopped: 0,
- byType: {},
- },
- storage: {
- total: 0,
- totalCapacity: 0,
- totalUsed: 0,
- warningCount: 0,
- criticalCount: 0,
- },
- problemResources: [
- {
- id: 'offline-pve',
- type: 'agent',
- name: 'PVE Offline',
- status: 'offline',
- sources: ['proxmox'],
- aiSafeSummary: '',
- canonicalIdentity: {
- displayName: 'PVE Offline',
- hostname: 'pve-offline.lab.local',
- platformId: 'offline-pve',
- },
- policy: {
- sensitivity: 'internal',
- routing: {
- scope: 'local-first',
- },
- },
- problems: ['Offline'],
- worstValue: 200,
- lastSeen: '2026-04-21T20:00:00Z',
- },
- ],
-} as const;
-
const EMPTY_INFRASTRUCTURE_CHARTS = {
nodeData: {},
agentData: {},
@@ -197,7 +128,7 @@ const EMPTY_RECOVERY_ROLLUPS = {
test.describe('Offline Proxmox node visibility', () => {
test.setTimeout(180_000);
- test('keeps an offline Proxmox node visible on dashboard and infrastructure surfaces', async ({
+ test('keeps an offline Proxmox node visible on the infrastructure surface', async ({
page,
}, testInfo) => {
test.skip(testInfo.project.name.startsWith('mobile-'), 'Desktop runtime proof');
@@ -210,15 +141,6 @@ test.describe('Offline Proxmox node visibility', () => {
await page.route('**/api/resources**', async (route) => {
const requestUrl = new URL(route.request().url());
- if (requestUrl.pathname === '/api/resources/dashboard-summary') {
- await route.fulfill({
- status: 200,
- contentType: 'application/json',
- body: JSON.stringify(DASHBOARD_SUMMARY_RESPONSE),
- });
- return;
- }
-
if (requestUrl.pathname === '/api/resources') {
await route.fulfill({
status: 200,
@@ -263,15 +185,6 @@ test.describe('Offline Proxmox node visibility', () => {
});
});
- await page.goto('/dashboard', { waitUntil: 'domcontentloaded' });
- await expect(page.getByTestId('dashboard-page')).toBeVisible();
-
- const dashboardProblemTable = page.locator('table').filter({
- has: page.getByText('PVE Offline', { exact: true }),
- }).first();
- await expect(dashboardProblemTable).toContainText('PVE Offline');
- await expect(dashboardProblemTable).toContainText('Offline');
-
await page.goto('/infrastructure?source=proxmox-pve', { waitUntil: 'domcontentloaded' });
await expect(page.getByTestId('infrastructure-page')).toBeVisible();
diff --git a/tests/integration/tests/71-dashboard-estate-orientation.spec.ts b/tests/integration/tests/71-dashboard-estate-orientation.spec.ts
deleted file mode 100644
index e03919e1ba..0000000000
--- a/tests/integration/tests/71-dashboard-estate-orientation.spec.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-import { expect, test, type Page } from '@playwright/test';
-import { ensureAuthenticated, getMockMode, setMockMode } from './helpers';
-
-const waitForDashboardEstateSummary = async (page: Page) => {
- await expect(page).toHaveURL(/\/dashboard(?:\?.*)?$/);
- await expect(page.getByTestId('dashboard-page')).toBeVisible();
- await expect(page.getByTestId('dashboard-estate-summary')).toBeVisible();
- await expect(page.getByRole('heading', { name: 'Connected infrastructure' })).toBeVisible();
-};
-
-test('dashboard first viewport preserves connected infrastructure orientation', async ({
- page,
-}) => {
- await ensureAuthenticated(page);
-
- let initialMockMode: { enabled: boolean } | null = null;
- try {
- initialMockMode = await getMockMode(page);
- if (!initialMockMode.enabled) {
- await setMockMode(page, true);
- }
- } catch (error) {
- console.warn(`[dashboard-estate] unable to read/set mock mode, continuing: ${String(error)}`);
- }
-
- try {
- await page.goto('/dashboard');
- await waitForDashboardEstateSummary(page);
-
- const estateSummary = page.getByTestId('dashboard-estate-summary');
- await expect(estateSummary.getByRole('link', { name: 'View infrastructure' })).toBeVisible();
- await expect(estateSummary.getByText(/systems? reporting|systems? need/)).toBeVisible();
- await expect(estateSummary.getByText('Resource summary fallback')).toHaveCount(0);
- await expect(estateSummary.getByText('No system-level attention')).toHaveCount(0);
- await expect(estateSummary.getByText('No source coverage yet')).toHaveCount(0);
- await expect(estateSummary.getByText('No dashboard issues found')).toHaveCount(0);
-
- const estateBox = await estateSummary.boundingBox();
- const kpiBox = await page.getByTestId('dashboard-kpi-infrastructure').boundingBox();
- expect(estateBox?.y ?? 0).toBeLessThan(kpiBox?.y ?? Number.POSITIVE_INFINITY);
-
- const hasHorizontalOverflow = await page.evaluate(
- () => document.documentElement.scrollWidth > document.documentElement.clientWidth + 1,
- );
- expect(hasHorizontalOverflow).toBe(false);
- } finally {
- if (initialMockMode && !initialMockMode.enabled) {
- try {
- await setMockMode(page, false);
- } catch (error) {
- console.warn(`[dashboard-estate] unable to restore mock mode, continuing: ${String(error)}`);
- }
- }
- }
-});
diff --git a/tests/integration/tests/helpers.ts b/tests/integration/tests/helpers.ts
index 9095f4f604..72c96ef2b9 100644
--- a/tests/integration/tests/helpers.ts
+++ b/tests/integration/tests/helpers.ts
@@ -146,12 +146,12 @@ async function completeSetupWizard(
name: "Open Platform connections",
exact: true,
});
- const secureDashboardHeading = wizard.getByText("Secure Your Dashboard");
+ const securePulseHeading = wizard.getByText("Secure Pulse");
const continueButton = wizard.getByRole("button", {
name: /verify bootstrap token|continue to setup|continue/i,
});
const finishButton = wizard.getByRole("button", {
- name: /go to dashboard|skip for now/i,
+ name: /open infrastructure|skip for now/i,
});
const bootstrapTokenInput = page.getByPlaceholder(
"Paste your bootstrap token",
@@ -178,7 +178,7 @@ async function completeSetupWizard(
return "completion";
}
if (
- await secureDashboardHeading
+ await securePulseHeading
.isVisible({ timeout: 100 })
.catch(() => false)
) {
@@ -401,7 +401,7 @@ export async function ensureFirstRunExperience(
const firstRunLandingPattern =
completionTarget === "platforms"
? SETUP_COMPLETION_HANDOFFS.platforms.urlPattern
- : /\/(settings\/infrastructure\/install|proxmox|dashboard|nodes|hosts|docker|infrastructure)/;
+ : /\/(settings\/infrastructure\/install|proxmox|nodes|hosts|docker|infrastructure)/;
if (!firstRunLandingPattern.test(page.url())) {
if (completionTarget === "platforms") {
throw new Error(
@@ -423,8 +423,8 @@ export async function loginAsAdmin(page: Page) {
await page.fill('input[name="password"]', E2E_CREDENTIALS.password);
await page.click('button[type="submit"]');
- // Wait for redirect to dashboard
- await page.waitForURL(/\/(dashboard|nodes|proxmox)/);
+ // Wait for redirect to the authenticated application shell.
+ await page.waitForURL(/\/(infrastructure|nodes|proxmox)/);
}
export async function login(page: Page, credentials = E2E_CREDENTIALS) {
@@ -432,7 +432,7 @@ export async function login(page: Page, credentials = E2E_CREDENTIALS) {
await waitForAppShell(page);
const authenticatedURL =
- /\/(proxmox|dashboard|nodes|hosts|docker|infrastructure)/;
+ /\/(proxmox|nodes|hosts|docker|infrastructure)/;
const usernameInput = page.locator('input[name="username"]');
const state = await Promise.race([
@@ -528,7 +528,7 @@ export async function ensureAuthenticated(page: Page) {
await maybeCompleteSetupWizard(page);
await login(page);
await expect(page).toHaveURL(
- /\/(proxmox|dashboard|nodes|hosts|docker|infrastructure)/,
+ /\/(proxmox|nodes|hosts|docker|infrastructure)/,
);
}
diff --git a/tests/integration/tests/journeys/01-smoke-bootstrap-login-dashboard.spec.ts b/tests/integration/tests/journeys/01-smoke-bootstrap-login-infrastructure.spec.ts
similarity index 89%
rename from tests/integration/tests/journeys/01-smoke-bootstrap-login-dashboard.spec.ts
rename to tests/integration/tests/journeys/01-smoke-bootstrap-login-infrastructure.spec.ts
index ea3e409a24..9b8baf2edb 100644
--- a/tests/integration/tests/journeys/01-smoke-bootstrap-login-dashboard.spec.ts
+++ b/tests/integration/tests/journeys/01-smoke-bootstrap-login-infrastructure.spec.ts
@@ -13,24 +13,24 @@ import {
} from '../helpers';
/**
- * Journey: Bootstrap β†’ First Login β†’ Dashboard Renders
+ * Journey: Bootstrap β†’ First Login β†’ Infrastructure Renders
*
* Covers the core smoke path every new Pulse user hits:
* 1. Pulse boots and responds to health checks
* 2. Setup wizard completes (handled by ensureAuthenticated)
- * 3. Login succeeds and redirects to infrastructure dashboard
- * 4. Dashboard renders with key navigation tabs
+ * 3. Login succeeds and redirects to Infrastructure
+ * 4. Infrastructure renders with key navigation tabs
* 5. Mock mode can be enabled for deterministic data
* 6. Main navigation tabs are clickable and render content
* 7. Logout and re-login cycle works
* 8. API returns valid state after full cycle
*
* This satisfies L12 score-2 criteria: "Stable smoke journeys green:
- * bootstrap β†’ first login β†’ dashboard renders."
+ * bootstrap β†’ first login β†’ infrastructure renders."
*/
/** Regex matching valid authenticated landing pages (superset of helpers.ts login()). */
-const AUTHENTICATED_URL = /\/(infrastructure|proxmox|dashboard|nodes|hosts|docker)/;
+const AUTHENTICATED_URL = /\/(infrastructure|proxmox|nodes|hosts|docker)/;
let mockModeWasEnabled: boolean | null = null;
@@ -43,7 +43,7 @@ async function captureMockBaseline(page: import('@playwright/test').Page): Promi
return state;
}
-test.describe.serial('Journey: Bootstrap β†’ Login β†’ Dashboard', () => {
+test.describe.serial('Journey: Bootstrap β†’ Login β†’ Infrastructure', () => {
test.afterAll(async ({ browser }) => {
// Restore mock mode to its original state to avoid leaking into other suites.
if (mockModeWasEnabled !== null) {
@@ -74,7 +74,7 @@ test.describe.serial('Journey: Bootstrap β†’ Login β†’ Dashboard', () => {
expect(res.ok(), `Health check failed with status ${res.status()}`).toBeTruthy();
});
- test('bootstrap and login land on infrastructure dashboard', async ({ page }, testInfo) => {
+ test('bootstrap and login land on Infrastructure', async ({ page }, testInfo) => {
test.skip(testInfo.project.name.startsWith('mobile-'), 'Desktop smoke journey');
await ensureAuthenticated(page);
@@ -103,7 +103,6 @@ test.describe.serial('Journey: Bootstrap β†’ Login β†’ Dashboard', () => {
// Core navigation tabs that must always be present
const expectedTabs = [
- 'Dashboard',
'Infrastructure',
'Alerts',
'Settings',
@@ -135,20 +134,21 @@ test.describe.serial('Journey: Bootstrap β†’ Login β†’ Dashboard', () => {
expect(currentState.enabled).toBe(true);
});
- test('dashboard tab renders KPI content', async ({ page }, testInfo) => {
+ test('infrastructure landing renders resource content', async ({ page }, testInfo) => {
test.skip(testInfo.project.name.startsWith('mobile-'), 'Desktop smoke journey');
await ensureAuthenticated(page);
- await page.goto('/dashboard', { waitUntil: 'domcontentloaded' });
- await expect(page).toHaveURL(/\/dashboard/);
+ await page.goto('/infrastructure', { waitUntil: 'domcontentloaded' });
+ await expect(page).toHaveURL(/\/infrastructure/);
await expect(page.locator('#root')).toBeVisible();
- // Wait for at least one heading or KPI widget to appear.
- const content = page.locator('h1, h2, h3, [role="heading"], [class*="card"], [class*="kpi"], [class*="summary"]').first();
+ const content = page.locator(
+ 'table, [role="table"], [role="grid"], [class*="resource"], [class*="table"], h1, h2',
+ ).first();
await expect(
content,
- 'Dashboard should render content (headings, cards, or KPI widgets)',
+ 'Infrastructure should render resource content',
).toBeVisible({ timeout: 15_000 });
});
@@ -216,7 +216,7 @@ test.describe.serial('Journey: Bootstrap β†’ Login β†’ Dashboard', () => {
const entitlementsRequests = trackBrowserRequests(page, '/api/license/entitlements');
try {
- await page.goto('/dashboard', { waitUntil: 'domcontentloaded' });
+ await page.goto('/infrastructure', { waitUntil: 'domcontentloaded' });
await expect(page.locator('#root')).toBeVisible();
await page.goto('/infrastructure', { waitUntil: 'domcontentloaded' });