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.

Rename primary navigation model for runtime lenses

rcourtman4a5873d49c7f
diff --git a/docs/release-control/v6/internal/PLATFORM_SUPPORT_MODEL.md b/docs/release-control/v6/internal/PLATFORM_SUPPORT_MODEL.md
index 996a40565f..d891f805ce 100644
--- a/docs/release-control/v6/internal/PLATFORM_SUPPORT_MODEL.md
+++ b/docs/release-control/v6/internal/PLATFORM_SUPPORT_MODEL.md
@@ -1,6 +1,6 @@
# Pulse v6 Platform Support Model
-Last updated: 2026-04-25
+Last updated: 2026-05-20
Status: ACTIVE
This file is the canonical governed model for platform support in Pulse v6.
@@ -158,8 +158,11 @@ path defines the support floor.
Current agent-backed primary platforms:
1. `agent` for unified-agent hosts
-2. `docker`
-3. `kubernetes`
+2. `kubernetes`
+
+Current agent-backed runtime lenses:
+
+1. `docker` for the Docker / Podman container-runtime lens
### Hybrid
@@ -174,8 +177,9 @@ Current governed hybrid-capable platforms:
3. `truenas`
`docker` and `kubernetes` do not become hybrid platforms merely because they
-run on a machine that also reports as `agent`; those are parallel first-class
-platforms sharing one physical host.
+run on a machine that also reports as `agent`; Kubernetes is a parallel
+first-class platform, while Docker / Podman is a runtime lens sharing one
+physical host.
## Canonical Resource Projection Rules
diff --git a/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md b/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md
index ab087f9152..954d8a341c 100644
--- a/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md
+++ b/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md
@@ -136,8 +136,9 @@ entered that commercial context.
New platform work must therefore strengthen that mixed-estate operator surface
and follow `docs/release-control/v6/internal/PLATFORM_SUPPORT_MODEL.md`
instead of being admitted ad hoc.
-Under that governed platform model, `docker` and `kubernetes` are first-class
-top-level platforms, while `podman` stays a runtime variant inside `docker`
+Under that governed platform model, `kubernetes` is a first-class top-level
+orchestrator platform, while `docker` is the first-class Docker / Podman
+container-runtime lens and `podman` stays a runtime variant inside that lens
rather than becoming its own top-level platform.
The same model also sets the current posture for platform breadth: `truenas`
is at the declared support floor summarized below, and `vmware-vsphere` is the
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index 10dde99c7e..ba63cd27ba 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -117,7 +117,7 @@ runtime cost control, and shared AI transport surfaces.
present Pulse code as the intelligence engine, a prompt-keyword router, a
learned operational-meaning engine, or a deterministic finding author.
10. Platform/runtime top-level pages registered in
- `frontend-modern/src/App.tsx` and the platform tab list in
+ `frontend-modern/src/App.tsx` and the primary tab list in
`frontend-modern/src/AppLayout.tsx` must keep the AI launcher chrome
intact: they extend `aiChatStore`-aware route shells rather than mounting
bespoke layouts that suppress the Assistant launcher, Patrol entry, or
diff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.md
index 89c572f628..aef14147f9 100644
--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md
+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md
@@ -489,9 +489,9 @@ or other self-hosted uncapped continuity plans.
navigation. `App.tsx` registers one top-level route per supported platform
or runtime family (Proxmox, the Docker / Podman container-runtime lens,
Kubernetes, TrueNAS, vSphere) using the canonical path constants from
- `frontend-modern/src/routing/resourceLinks.ts`. The `PlatformTab` list in
- `AppLayout.tsx` must enumerate exactly those supported destinations, but
- product navigation is support-and-evidence gated:
+ `frontend-modern/src/routing/resourceLinks.ts`. The `PrimaryTab` list in
+ `AppLayout.tsx` must enumerate exactly those supported platform/runtime
+ destinations, but product navigation is support-and-evidence gated:
`enabled`, `live`, and inclusion in the rendered primary navigation derive
from the governed support manifest plus canonical resource evidence in
`state.resources`. Admitted-only, presentation-only, unsupported, or
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index fc1adcff02..cc76fb0ee9 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -749,7 +749,7 @@ AI runtime.
the container-runtime lens and may be labelled `Containers` in the shell,
while shared source badges, filters, and runtime management copy continue
to use `Docker / Podman` where the capability itself is being named.
-8. Keep shared source/platform vocabulary on the governed manifest boundary. `frontend-modern/src/utils/platformSupportManifest.generated.ts` must be the tracked frontend projection of `docs/release-control/v6/internal/PLATFORM_SUPPORT_MANIFEST.json`, `frontend-modern/src/utils/platformSupportManifest.ts`, `frontend-modern/src/utils/sourcePlatforms.ts`, and `frontend-modern/src/utils/sourcePlatformOptions.ts` must consume that generated projection instead of embedding divergent future-label lists, setup/onboarding path allowlists, host-profile labels, or presentation-only guesses, and `frontend-modern/scripts/canonical-platform-audit.mjs` must fail when the generated projection drifts from the governed manifest. The generic `docker` source-platform label is "Docker / Podman" in shared selectors, badges, and filter options so v5 Docker users can find the runtime surface while Podman-backed rows are not mislabeled as Docker-only; "Container runtime" remains the governed platform family, not the primary customer-facing label. Identity colour is semantic, not page-local decoration: shared source/platform badges, host identity badges, and container runtime badges must use the shared presentation helpers so Docker remains on the Docker/Podman blue runtime tone, Podman uses its distinct runtime tone, Proxmox PVE remains orange, and those meanings do not drift across table rows, filters, drawers, or platform pages. Agent host-profile entries, including Unraid, stay in the generated `agentHostProfiles` projection and shared wrapper helpers; frontend primitives may render those labels for Pulse Agent install/identity copy but must not add them to the first-class platform union.
+8. Keep shared source/platform vocabulary on the governed manifest boundary. `frontend-modern/src/utils/platformSupportManifest.generated.ts` must be the tracked frontend projection of `docs/release-control/v6/internal/PLATFORM_SUPPORT_MANIFEST.json`, `frontend-modern/src/utils/platformSupportManifest.ts`, `frontend-modern/src/utils/sourcePlatforms.ts`, and `frontend-modern/src/utils/sourcePlatformOptions.ts` must consume that generated projection instead of embedding divergent future-label lists, setup/onboarding path allowlists, host-profile labels, or presentation-only guesses, and `frontend-modern/scripts/canonical-platform-audit.mjs` must fail when the generated projection drifts from the governed manifest. The generic `docker` source-platform label is "Docker / Podman" in shared selectors, badges, and filter options so v5 Docker users can find the runtime surface while Podman-backed rows are not mislabeled as Docker-only; "Container runtime" remains the governed runtime family, not the primary customer-facing label. Identity colour is semantic, not page-local decoration: shared source/platform badges, host identity badges, and container runtime badges must use the shared presentation helpers so Docker remains on the Docker/Podman blue runtime tone, Podman uses its distinct runtime tone, Proxmox PVE remains orange, and those meanings do not drift across table rows, filters, drawers, or platform pages. Agent host-profile entries, including Unraid, stay in the generated `agentHostProfiles` projection and shared wrapper helpers; frontend primitives may render those labels for Pulse Agent install/identity copy but must not add them to the first-class platform union.
The generated host-profile projection also carries runtime platform fallback
metadata for shared explanation and parity with backend normalization, but
frontend primitives must still render host-profile labels through
@@ -980,14 +980,14 @@ AI runtime.
shared canonical surface already exists; new shared platform-page
primitives live under `frontend-modern/src/features/platformPage/` so the
chrome stays reusable across families.
- `frontend-modern/src/AppLayout.tsx` may extend the `PlatformTab` list with
- new family entries, but primary navigation is a support-and-evidence-gated
- surface: rendered platform tabs, command/search destinations, keyboard
- shortcuts, and authenticated landing fallbacks must derive from the
- governed support manifest plus current runtime resource evidence.
- Supported platform families appear when evidence proves they are present;
- admitted-only, presentation-only, unsupported, or absent families stay
- hidden rather than rendering as disabled placeholders.
+ `frontend-modern/src/AppLayout.tsx` may extend the `PrimaryTab` list with
+ new platform or runtime-family entries, but primary navigation is a
+ support-and-evidence-gated surface: rendered tabs, command/search
+ destinations, keyboard shortcuts, and authenticated landing fallbacks must
+ derive from the governed support manifest plus current runtime resource
+ evidence. Supported platform/runtime families appear when evidence proves
+ they are present; admitted-only, presentation-only, unsupported, or absent
+ families stay hidden rather than rendering as disabled placeholders.
The `MOBILE_NAV_PLATFORM_PRIORITY` ordering in
`frontend-modern/src/components/shared/mobileNavBarModel.ts` mirrors
that platform-first set so mobile and desktop primary navigation stay
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 4ab796c98f..bf2899c854 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -799,6 +799,12 @@ canonical `/api/discovery` payload.
top-level tabs are warm after authentication, but it must not fetch storage
summary charts, recovery history, provider state, or preview data from
`frontend-modern/src/App.tsx` itself.
+ The shared app shell's authenticated landing and primary-tab routing may
+ use the infrastructure navigation model that includes both owning platform
+ pages and runtime lenses such as Containers. Storage and recovery route
+ owners must treat that as shell-owned navigation evidence, not as a reason
+ to restore Storage or Recovery as equal primary tabs or depend on
+ platform-only tab terminology.
37. Keep public self-hosted purchase handoff and activation routes on the
adjacent commercial/auth boundary. When `internal/api/router.go`,
`internal/api/router_routes_cloud.go`, `internal/api/licensing_handlers.go`,
diff --git a/frontend-modern/src/App.tsx b/frontend-modern/src/App.tsx
index 912f603ef0..cce6f2c99a 100644
--- a/frontend-modern/src/App.tsx
+++ b/frontend-modern/src/App.tsx
@@ -61,11 +61,11 @@ import {
} from '@/utils/appShellScrollRestoration';
import { DarkModeContext, WebSocketContext, useWebSocket } from '@/contexts/appRuntime';
import {
- buildPrimaryPlatformNavigationVisibility,
- selectFirstVisiblePrimaryPlatformNavigationId,
- type PlatformNavigationVisibility,
- type PrimaryPlatformNavId,
-} from '@/features/platformNavigation/platformNavigationModel';
+ buildPrimaryInfrastructureNavigationVisibility,
+ selectFirstVisiblePrimaryInfrastructureNavigationId,
+ type InfrastructureNavigationVisibility,
+ type PrimaryInfrastructureNavId,
+} from '@/features/infrastructureNavigation/infrastructureNavigationModel';
function isPublicRoutePath(pathname: string): boolean {
// Public routes must be viewable without authentication.
@@ -95,7 +95,7 @@ const SetupCompletionPreviewPage = lazy(() =>
);
const ROOT_PATROL_PATH = PATROL_PATH;
-const PRIMARY_PLATFORM_ROUTE_BY_ID: Record<PrimaryPlatformNavId, string> = {
+const PRIMARY_INFRASTRUCTURE_ROUTE_BY_ID: Record<PrimaryInfrastructureNavId, string> = {
proxmox: buildProxmoxPath(),
docker: buildDockerPath(),
kubernetes: buildKubernetesPath(),
@@ -104,11 +104,11 @@ const PRIMARY_PLATFORM_ROUTE_BY_ID: Record<PrimaryPlatformNavId, string> = {
};
function getDefaultWorkspaceRoute(
- visibility: PlatformNavigationVisibility,
+ visibility: InfrastructureNavigationVisibility,
hasSettingsAccess: boolean,
): string {
- const platformId = selectFirstVisiblePrimaryPlatformNavigationId(visibility);
- if (platformId) return PRIMARY_PLATFORM_ROUTE_BY_ID[platformId];
+ const navId = selectFirstVisiblePrimaryInfrastructureNavigationId(visibility);
+ if (navId) return PRIMARY_INFRASTRUCTURE_ROUTE_BY_ID[navId];
return hasSettingsAccess ? '/settings/infrastructure' : '/alerts';
}
@@ -251,10 +251,10 @@ function App() {
const navigate = useNavigate();
const location = useLocation();
const isPublicRoute = createMemo(() => isPublicRoutePath(location.pathname));
- const platformNavigationVisibility = createMemo(() =>
- buildPrimaryPlatformNavigationVisibility(runtime.state().resources || []),
+ const infrastructureNavigationVisibility = createMemo(() =>
+ buildPrimaryInfrastructureNavigationVisibility(runtime.state().resources || []),
);
- const platformNavigationResolved = createMemo(() => {
+ const infrastructureNavigationResolved = createMemo(() => {
const store = runtime.enhancedStore();
return Boolean(store?.initialDataReceived?.());
});
@@ -280,10 +280,13 @@ function App() {
if (runtime.isLoading() || runtime.needsAuth() || isPublicRoute()) return;
const normalizedPath = location.pathname.replace(/\/+$/, '') || '/';
if (normalizedPath !== '/' && normalizedPath !== '/login') return;
- if (!platformNavigationResolved()) return;
- navigate(getDefaultWorkspaceRoute(platformNavigationVisibility(), hasSettingsAccess()), {
- replace: true,
- });
+ if (!infrastructureNavigationResolved()) return;
+ navigate(
+ getDefaultWorkspaceRoute(infrastructureNavigationVisibility(), hasSettingsAccess()),
+ {
+ replace: true,
+ },
+ );
});
createEffect(() => {
@@ -370,7 +373,7 @@ function App() {
useKeyboardShortcuts({
enabled: () => !runtime.needsAuth(),
- platformVisibility: platformNavigationVisibility,
+ infrastructureVisibility: infrastructureNavigationVisibility,
isShortcutsOpen: shortcutsOpen,
isCommandPaletteOpen: commandPaletteOpen,
onToggleShortcuts: () => {
@@ -487,14 +490,14 @@ function App() {
<KeyboardShortcutsModal
isOpen={shortcutsOpen()}
onClose={() => setShortcutsOpen(false)}
- platformVisibility={platformNavigationVisibility}
+ infrastructureVisibility={infrastructureNavigationVisibility}
/>
</Show>
<Show when={commandPaletteOpen()}>
<CommandPaletteModal
isOpen={commandPaletteOpen()}
onClose={() => setCommandPaletteOpen(false)}
- platformVisibility={platformNavigationVisibility}
+ infrastructureVisibility={infrastructureNavigationVisibility}
/>
</Show>
<Show when={tokenRevealStore.state() !== null}>
diff --git a/frontend-modern/src/AppLayout.tsx b/frontend-modern/src/AppLayout.tsx
index cbe5e0ab48..ce38ff52f7 100644
--- a/frontend-modern/src/AppLayout.tsx
+++ b/frontend-modern/src/AppLayout.tsx
@@ -13,15 +13,15 @@ import CpuIcon from 'lucide-solid/icons/cpu';
import { ProxmoxIcon } from '@/components/icons/ProxmoxIcon';
import {
MobileNavBar,
- type MobileNavBarPlatformTab as PlatformTab,
+ type MobileNavBarPrimaryTab as PrimaryTab,
type MobileNavBarUtilityTab as UtilityTab,
} from '@/components/shared/MobileNavBar';
import {
- buildPrimaryPlatformNavigationVisibility,
- primaryPlatformNavigationIsVisible,
- selectFirstVisiblePrimaryPlatformNavigationId,
- type PrimaryPlatformNavId,
-} from '@/features/platformNavigation/platformNavigationModel';
+ buildPrimaryInfrastructureNavigationVisibility,
+ primaryInfrastructureNavigationIsVisible,
+ selectFirstVisiblePrimaryInfrastructureNavigationId,
+ type PrimaryInfrastructureNavId,
+} from '@/features/infrastructureNavigation/infrastructureNavigationModel';
import { dialogStackHasBlockingDialog } from '@/components/shared/useDialogState';
import { OrgSwitcher } from '@/components/OrgSwitcher';
import { PulsePatrolLogo } from '@/components/Brand/PulsePatrolLogo';
@@ -221,10 +221,10 @@ export function AppLayout(props: AppLayoutProps) {
setKioskMode(!kioskMode());
};
- const platformNavigationVisibility = createMemo(() =>
- buildPrimaryPlatformNavigationVisibility(props.state().resources || []),
+ const infrastructureNavigationVisibility = createMemo(() =>
+ buildPrimaryInfrastructureNavigationVisibility(props.state().resources || []),
);
- const primaryPlatformRouteById: Record<PrimaryPlatformNavId, string> = {
+ const primaryInfrastructureRouteById: Record<PrimaryInfrastructureNavId, string> = {
proxmox: ROOT_PROXMOX_PATH,
docker: ROOT_DOCKER_PATH,
kubernetes: ROOT_KUBERNETES_PATH,
@@ -232,10 +232,10 @@ export function AppLayout(props: AppLayoutProps) {
vmware: ROOT_VMWARE_PATH,
};
const primaryWorkspacePath = createMemo(() => {
- const platformId = selectFirstVisiblePrimaryPlatformNavigationId(
- platformNavigationVisibility(),
+ const navId = selectFirstVisiblePrimaryInfrastructureNavigationId(
+ infrastructureNavigationVisibility(),
);
- return platformId ? primaryPlatformRouteById[platformId] : ROOT_ALERTS_PATH;
+ return navId ? primaryInfrastructureRouteById[navId] : ROOT_ALERTS_PATH;
});
createEffect(() => {
@@ -322,11 +322,11 @@ export function AppLayout(props: AppLayoutProps) {
// equal primary tabs — their tables are reused inside each platform page
// via embedded tableOnly surfaces, and their routes remain wired in App.tsx
// purely for route-compatibility with existing deep links.
- const platformTabs = createMemo<PlatformTab[]>(() => {
- const visible = platformNavigationVisibility();
- const isVisible = (id: PlatformTab['id']) =>
- primaryPlatformNavigationIsVisible(visible, id as PrimaryPlatformNavId);
- const allPlatforms: PlatformTab[] = [
+ const primaryTabs = createMemo<PrimaryTab[]>(() => {
+ const visible = infrastructureNavigationVisibility();
+ const isVisible = (id: PrimaryTab['id']) =>
+ primaryInfrastructureNavigationIsVisible(visible, id as PrimaryInfrastructureNavId);
+ const allPrimaryTabs: PrimaryTab[] = [
{
id: 'proxmox',
label: 'Proxmox',
@@ -384,7 +384,7 @@ export function AppLayout(props: AppLayoutProps) {
},
];
- return allPlatforms.filter((platform) => platform.alwaysShow || platform.enabled);
+ return allPrimaryTabs.filter((tab) => tab.alwaysShow || tab.enabled);
});
const utilityTabs = createMemo(() => {
@@ -447,8 +447,8 @@ export function AppLayout(props: AppLayoutProps) {
return tabs;
});
- const handlePlatformClick = (platform: PlatformTab) => {
- const targetRoute = platform.enabled ? platform.route : platform.settingsRoute;
+ const handlePrimaryClick = (tab: PrimaryTab) => {
+ const targetRoute = tab.enabled ? tab.route : tab.settingsRoute;
void (async () => {
try {
await preloadRouteModule(targetRoute);
@@ -485,11 +485,11 @@ export function AppLayout(props: AppLayoutProps) {
});
};
- const getPlatformTargetRoute = (platform: PlatformTab) => {
- if (platform.enabled) {
- return platform.route;
+ const getPrimaryTargetRoute = (tab: PrimaryTab) => {
+ if (tab.enabled) {
+ return tab.route;
}
- return platform.settingsRoute;
+ return tab.settingsRoute;
};
return (
@@ -676,11 +676,11 @@ export function AppLayout(props: AppLayoutProps) {
aria-label="Primary navigation"
>
<div class="flex items-end gap-1" role="group" aria-label="Infrastructure">
- <For each={platformTabs()}>
- {(platform) => {
- const isActive = () => getActiveTabDesktop() === platform.id;
- const disabled = () => !platform.enabled;
- const Icon = platform.icon;
+ <For each={primaryTabs()}>
+ {(tab) => {
+ const isActive = () => getActiveTabDesktop() === tab.id;
+ const disabled = () => !tab.enabled;
+ const Icon = tab.icon;
const baseClasses =
'tab relative px-1.5 sm:px-3 py-1.5 text-xs sm:text-sm font-medium flex items-center gap-1 sm:gap-1.5 rounded-t border border-transparent transition-colors whitespace-nowrap cursor-pointer';
@@ -696,22 +696,22 @@ export function AppLayout(props: AppLayoutProps) {
const title = () =>
disabled()
- ? `${platform.label} is not configured yet. Click to open settings.`
- : platform.tooltip;
+ ? `${tab.label} is not configured yet. Click to open settings.`
+ : tab.tooltip;
return (
<div
class={className()}
role="tab"
tabIndex={0}
- aria-label={platform.label}
+ aria-label={tab.label}
aria-disabled={disabled()}
- onMouseEnter={() => warmNavigationTarget(getPlatformTargetRoute(platform))}
- onClick={() => handlePlatformClick(platform)}
+ onMouseEnter={() => warmNavigationTarget(getPrimaryTargetRoute(tab))}
+ onClick={() => handlePrimaryClick(tab)}
onKeyDown={(event) => {
if (event.key === 'Enter' || event.key === ' ') {
event.preventDefault();
- handlePlatformClick(platform);
+ handlePrimaryClick(tab);
}
}}
title={title()}
@@ -720,14 +720,14 @@ export function AppLayout(props: AppLayoutProps) {
<Icon class={NAV_TAB_ICON_CLASS} />
</span>
<span class="hidden xs:inline-flex items-center gap-1">
- <span>{platform.label}</span>
- <Show when={platform.badge}>
+ <span>{tab.label}</span>
+ <Show when={tab.badge}>
<span class="px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted bg-surface-hover rounded">
- {platform.badge}
+ {tab.badge}
</span>
</Show>
</span>
- <span class="xs:hidden">{platform.label.charAt(0)}</span>
+ <span class="xs:hidden">{tab.label.charAt(0)}</span>
</div>
);
}}
@@ -831,9 +831,9 @@ export function AppLayout(props: AppLayoutProps) {
<Show when={!kioskMode()}>
<MobileNavBar
activeTab={getActiveTabMobile}
- platformTabs={platformTabs}
+ primaryTabs={primaryTabs}
utilityTabs={utilityTabs}
- onPlatformClick={handlePlatformClick}
+ onPrimaryClick={handlePrimaryClick}
onUtilityClick={handleUtilityClick}
/>
</Show>
diff --git a/frontend-modern/src/__tests__/App.architecture.test.ts b/frontend-modern/src/__tests__/App.architecture.test.ts
index 0f156dbe52..f907c81bdb 100644
--- a/frontend-modern/src/__tests__/App.architecture.test.ts
+++ b/frontend-modern/src/__tests__/App.architecture.test.ts
@@ -72,14 +72,14 @@ describe('App architecture', () => {
expect(appLayoutSource).toContain("id: 'truenas',");
expect(appLayoutSource).toContain("id: 'vmware',");
// Governed platform/runtime primary nav: Infrastructure / Workloads /
- // Storage / Recovery are not duplicated as equal primary PlatformTab
+ // Storage / Recovery are not duplicated as equal primary tab
// entries, and the Docker / Podman route is presented as the Containers
// runtime lens in shell chrome.
expect(appSource).toContain('getDefaultWorkspaceRoute');
- expect(appSource).toContain('platformNavigationResolved');
- expect(appSource).toContain('buildPrimaryPlatformNavigationVisibility');
- expect(appLayoutSource).toContain('buildPrimaryPlatformNavigationVisibility');
- expect(appLayoutSource).toContain('primaryPlatformNavigationIsVisible');
+ expect(appSource).toContain('infrastructureNavigationResolved');
+ expect(appSource).toContain('buildPrimaryInfrastructureNavigationVisibility');
+ expect(appLayoutSource).toContain('buildPrimaryInfrastructureNavigationVisibility');
+ expect(appLayoutSource).toContain('primaryInfrastructureNavigationIsVisible');
expect(appLayoutSource).toContain("label: 'Containers'");
expect(appLayoutSource).toContain("'Docker / Podman runtime lens");
expect(appLayoutSource).not.toContain("id: 'infrastructure',");
@@ -209,23 +209,23 @@ describe('App architecture', () => {
expect(appLayoutSource).not.toContain('props.connected()');
expect(appLayoutSource).toContain('const utilityTabs = createMemo(() =>');
expect(appLayoutSource).toContain(
- 'type MobileNavBarPlatformTab as PlatformTab,\n type MobileNavBarUtilityTab as UtilityTab,',
+ 'type MobileNavBarPrimaryTab as PrimaryTab,\n type MobileNavBarUtilityTab as UtilityTab,',
);
expect(appLayoutSource).toContain("const NAV_TAB_ICON_CLASS = 'w-4 h-4 shrink-0';");
expect(appLayoutSource).toContain('function getDesktopUtilityTabAriaLabel(tab: UtilityTab)');
expect(appLayoutSource).toContain('return `${count} ${tab.label}`;');
- expect(appLayoutSource).toContain('const platformTabs = createMemo<PlatformTab[]>(() =>');
+ expect(appLayoutSource).toContain('const primaryTabs = createMemo<PrimaryTab[]>(() =>');
expect(appLayoutSource).toContain("id: 'proxmox',");
expect(appLayoutSource).toContain('icon: ProxmoxIcon,');
- expect(appLayoutSource).toContain('const Icon = platform.icon;');
expect(appLayoutSource).toContain('const Icon = tab.icon;');
- expect(appLayoutSource).toContain('aria-label={platform.label}');
+ expect(appLayoutSource).toContain('const Icon = tab.icon;');
+ expect(appLayoutSource).toContain('aria-label={tab.label}');
expect(appLayoutSource).toContain('aria-label={getDesktopUtilityTabAriaLabel(tab)}');
expect(appLayoutSource).toContain(
'<span aria-hidden="true" class="inline-flex items-center justify-center">',
);
expect(appLayoutSource).toContain('<Icon class={NAV_TAB_ICON_CLASS} />');
- expect(appLayoutSource).not.toContain('type PlatformTab = {');
+ expect(appLayoutSource).not.toContain('type PrimaryTab = {');
expect(appLayoutSource).not.toContain('type UtilityTab = {');
expect(appLayoutSource).not.toContain('const platformTabsDesktop = createMemo(() =>');
expect(appLayoutSource).not.toContain('const platformTabsMobile = createMemo(() =>');
diff --git a/frontend-modern/src/components/shared/KeyboardShortcutsModal.tsx b/frontend-modern/src/components/shared/KeyboardShortcutsModal.tsx
index f7eb6a1088..8f3a34598b 100644
--- a/frontend-modern/src/components/shared/KeyboardShortcutsModal.tsx
+++ b/frontend-modern/src/components/shared/KeyboardShortcutsModal.tsx
@@ -1,9 +1,9 @@
import { For, createMemo } from 'solid-js';
import { Dialog } from '@/components/shared/Dialog';
import {
- primaryPlatformNavigationIsVisible,
- type PlatformNavigationVisibility,
-} from '@/features/platformNavigation/platformNavigationModel';
+ primaryInfrastructureNavigationIsVisible,
+ type InfrastructureNavigationVisibility,
+} from '@/features/infrastructureNavigation/infrastructureNavigationModel';
interface ShortcutGroup {
title: string;
@@ -13,7 +13,7 @@ interface ShortcutGroup {
interface KeyboardShortcutsModalProps {
isOpen: boolean;
onClose: () => void;
- platformVisibility: () => PlatformNavigationVisibility;
+ infrastructureVisibility: () => InfrastructureNavigationVisibility;
}
const UNIFIED_NAV_SHORTCUTS: ShortcutGroup = {
@@ -30,7 +30,7 @@ const UNIFIED_NAV_SHORTCUTS: ShortcutGroup = {
],
};
-const NAV_PLATFORM_SHORTCUTS: Record<string, keyof PlatformNavigationVisibility> = {
+const NAV_PRIMARY_SHORTCUTS: Record<string, keyof InfrastructureNavigationVisibility> = {
'g then p': 'proxmox',
'g then d': 'docker',
'g then k': 'kubernetes',
@@ -50,11 +50,11 @@ const SEARCH_SHORTCUTS: ShortcutGroup = {
export function KeyboardShortcutsModal(props: KeyboardShortcutsModalProps) {
const shortcutGroups = createMemo<ShortcutGroup[]>(() => {
- const platformVisibility = props.platformVisibility();
+ const infrastructureVisibility = props.infrastructureVisibility();
const visibleNavigationItems = UNIFIED_NAV_SHORTCUTS.items.filter((item) => {
- const platformId = NAV_PLATFORM_SHORTCUTS[item.keys];
- if (!platformId) return true;
- return primaryPlatformNavigationIsVisible(platformVisibility, platformId);
+ const navId = NAV_PRIMARY_SHORTCUTS[item.keys];
+ if (!navId) return true;
+ return primaryInfrastructureNavigationIsVisible(infrastructureVisibility, navId);
});
return [{ ...UNIFIED_NAV_SHORTCUTS, items: visibleNavigationItems }, SEARCH_SHORTCUTS];
});
diff --git a/frontend-modern/src/components/shared/MobileNavBar.tsx b/frontend-modern/src/components/shared/MobileNavBar.tsx
index ef4c9828c5..fa657a6b40 100644
--- a/frontend-modern/src/components/shared/MobileNavBar.tsx
+++ b/frontend-modern/src/components/shared/MobileNavBar.tsx
@@ -7,8 +7,8 @@ import {
} from './mobileNavBarModel';
export type {
- MobileNavBarPlatformTab,
MobileNavBarProps,
+ MobileNavBarPrimaryTab,
MobileNavBarUtilityTab,
} from './mobileNavBarModel';
@@ -26,33 +26,33 @@ export function MobileNavBar(props: MobileNavBarProps) {
role="tablist"
aria-label="Mobile navigation"
>
- <For each={mobileNav.orderedPlatformTabs()}>
- {(platform) => {
- const Icon = platform.icon;
+ <For each={mobileNav.orderedPrimaryTabs()}>
+ {(tab) => {
+ const Icon = tab.icon;
return (
<button
type="button"
- data-tab-id={platform.id}
- onClick={() => mobileNav.handlePlatformClick(platform)}
- title={platform.tooltip}
+ data-tab-id={tab.id}
+ onClick={() => mobileNav.handlePrimaryClick(tab)}
+ title={tab.tooltip}
class={getMobileNavTabButtonClass({
- active: props.activeTab() === platform.id,
- enabled: platform.enabled,
+ active: props.activeTab() === tab.id,
+ enabled: tab.enabled,
})}
>
<span aria-hidden="true" class="relative flex items-center justify-center">
<Icon class={tabIconClass} />
</span>
- <span class="whitespace-nowrap">{platform.label}</span>
- <Show when={!platform.enabled}>
+ <span class="whitespace-nowrap">{tab.label}</span>
+ <Show when={!tab.enabled}>
<span class="rounded-full bg-amber-100 px-1.5 py-0.5 text-[9px] font-semibold text-amber-700 dark:bg-amber-900 dark:text-amber-200">
Setup
</span>
</Show>
- <Show when={platform.badge}>
+ <Show when={tab.badge}>
<span class="rounded-full bg-surface-hover px-1.5 py-0.5 text-[9px] font-semibold text-muted">
- {platform.badge}
+ {tab.badge}
</span>
</Show>
</button>
@@ -82,7 +82,10 @@ export function MobileNavBar(props: MobileNavBarProps) {
</span>
<Show when={alertBadges()}>
{(badges) => (
- <span aria-hidden="true" class="absolute -right-2 -top-1 flex items-center gap-1">
+ <span
+ aria-hidden="true"
+ class="absolute -right-2 -top-1 flex items-center gap-1"
+ >
<Show when={badges().critical > 0}>
<span class="inline-flex h-4 min-w-[16px] items-center justify-center rounded-full bg-red-600 px-1 text-[10px] font-bold text-white">
{badges().critical}
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 8883a3031a..695f38a829 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -1216,7 +1216,7 @@ describe('shared primitive guardrails', () => {
expect(mobileNavBarStateSource).toContain('scrollIntoView');
expect(mobileNavBarStateSource).toContain('export function useMobileNavBarState');
- expect(mobileNavBarModelSource).toContain('buildOrderedMobileNavPlatformTabs');
+ expect(mobileNavBarModelSource).toContain('buildOrderedMobileNavPrimaryTabs');
expect(mobileNavBarModelSource).toContain('buildOrderedMobileNavUtilityTabs');
expect(mobileNavBarModelSource).toContain('getMobileNavAlertBadgeCounts');
expect(mobileNavBarModelSource).toContain('getMobileNavFadeState');
diff --git a/frontend-modern/src/components/shared/__tests__/CommandPaletteModal.test.tsx b/frontend-modern/src/components/shared/__tests__/CommandPaletteModal.test.tsx
index 6070622c02..a94c7174e1 100644
--- a/frontend-modern/src/components/shared/__tests__/CommandPaletteModal.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/CommandPaletteModal.test.tsx
@@ -5,7 +5,7 @@ import type { Resource } from '@/types/resource';
import commandPaletteModalSource from '@/components/shared/CommandPaletteModal.tsx?raw';
import commandPaletteModelSource from '@/components/shared/commandPaletteModel.ts?raw';
import commandPaletteStateSource from '@/components/shared/useCommandPaletteState.ts?raw';
-import { buildPrimaryPlatformNavigationVisibility } from '@/features/platformNavigation/platformNavigationModel';
+import { buildPrimaryInfrastructureNavigationVisibility } from '@/features/infrastructureNavigation/infrastructureNavigationModel';
const navigateMock = vi.fn();
@@ -34,8 +34,8 @@ const makeResource = (overrides: Partial<Resource>): Resource =>
...overrides,
}) as Resource;
-const platformVisibility = () =>
- buildPrimaryPlatformNavigationVisibility([
+const infrastructureVisibility = () =>
+ buildPrimaryInfrastructureNavigationVisibility([
makeResource({ id: 'pve-1', type: 'agent', platformType: 'proxmox-pve' }),
makeResource({ id: 'docker-1', type: 'docker-host', platformType: 'docker' }),
makeResource({ id: 'k8s-1', type: 'k8s-cluster', platformType: 'kubernetes' }),
@@ -85,7 +85,7 @@ describe('CommandPaletteModal', () => {
<CommandPaletteModal
isOpen={true}
onClose={vi.fn()}
- platformVisibility={platformVisibility}
+ infrastructureVisibility={infrastructureVisibility}
/>
));
@@ -101,7 +101,7 @@ describe('CommandPaletteModal', () => {
<CommandPaletteModal
isOpen={true}
onClose={onClose}
- platformVisibility={platformVisibility}
+ infrastructureVisibility={infrastructureVisibility}
/>
));
@@ -117,7 +117,7 @@ describe('CommandPaletteModal', () => {
<CommandPaletteModal
isOpen={true}
onClose={onClose}
- platformVisibility={platformVisibility}
+ infrastructureVisibility={infrastructureVisibility}
/>
));
@@ -134,8 +134,8 @@ describe('CommandPaletteModal', () => {
<CommandPaletteModal
isOpen={true}
onClose={vi.fn()}
- platformVisibility={() =>
- buildPrimaryPlatformNavigationVisibility([
+ infrastructureVisibility={() =>
+ buildPrimaryInfrastructureNavigationVisibility([
makeResource({ id: 'pve-1', type: 'agent', platformType: 'proxmox-pve' }),
])
}
diff --git a/frontend-modern/src/components/shared/__tests__/MobileNavBar.test.tsx b/frontend-modern/src/components/shared/__tests__/MobileNavBar.test.tsx
index 58c6c34fa1..c2f0eaf15e 100644
--- a/frontend-modern/src/components/shared/__tests__/MobileNavBar.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/MobileNavBar.test.tsx
@@ -40,7 +40,7 @@ describe('MobileNavBar', () => {
expect(mobileNavBarStateSource).toContain('scrollIntoView');
expect(mobileNavBarStateSource).toContain('export function useMobileNavBarState');
- expect(mobileNavBarModelSource).toContain('buildOrderedMobileNavPlatformTabs');
+ expect(mobileNavBarModelSource).toContain('buildOrderedMobileNavPrimaryTabs');
expect(mobileNavBarModelSource).toContain('buildOrderedMobileNavUtilityTabs');
expect(mobileNavBarModelSource).toContain('getMobileNavAlertBadgeCounts');
expect(mobileNavBarModelSource).toContain('getMobileNavFadeState');
@@ -59,7 +59,7 @@ describe('MobileNavBar', () => {
render(() => (
<MobileNavBar
activeTab={() => 'ai'}
- platformTabs={() => []}
+ primaryTabs={() => []}
utilityTabs={() => [
{
id: 'ai',
@@ -72,7 +72,7 @@ describe('MobileNavBar', () => {
icon: PatrolIcon,
},
]}
- onPlatformClick={() => {}}
+ onPrimaryClick={() => {}}
onUtilityClick={() => {}}
/>
));
@@ -88,7 +88,7 @@ describe('MobileNavBar', () => {
const { container } = render(() => (
<MobileNavBar
activeTab={() => null}
- platformTabs={() => [
+ primaryTabs={() => [
{
id: 'infrastructure',
label: 'Infrastructure',
@@ -113,7 +113,7 @@ describe('MobileNavBar', () => {
icon: SettingsIcon,
},
]}
- onPlatformClick={() => {}}
+ onPrimaryClick={() => {}}
onUtilityClick={() => {}}
/>
));
@@ -127,13 +127,13 @@ describe('MobileNavBar', () => {
});
it('orders tabs, renders alert badges, and shows fades from scroll state', async () => {
- const onPlatformClick = vi.fn();
+ const onPrimaryClick = vi.fn();
const onUtilityClick = vi.fn();
const { container } = render(() => (
<MobileNavBar
activeTab={() => 'infrastructure'}
- platformTabs={() => [
+ primaryTabs={() => [
{
id: 'proxmox',
label: 'Proxmox',
@@ -190,7 +190,7 @@ describe('MobileNavBar', () => {
icon: AlertsIcon,
},
]}
- onPlatformClick={onPlatformClick}
+ onPrimaryClick={onPrimaryClick}
onUtilityClick={onUtilityClick}
/>
));
@@ -214,7 +214,7 @@ describe('MobileNavBar', () => {
expect(screen.getByText('Pro')).toBeInTheDocument();
fireEvent.click(screen.getByTitle('Storage'));
- expect(onPlatformClick).toHaveBeenCalledWith(expect.objectContaining({ id: 'storage' }));
+ expect(onPrimaryClick).toHaveBeenCalledWith(expect.objectContaining({ id: 'storage' }));
fireEvent.click(screen.getByTitle('Alerts'));
expect(onUtilityClick).toHaveBeenCalledWith(expect.objectContaining({ id: 'alerts' }));
diff --git a/frontend-modern/src/components/shared/commandPaletteModel.ts b/frontend-modern/src/components/shared/commandPaletteModel.ts
index af70d96bc6..5bc6e23207 100644
--- a/frontend-modern/src/components/shared/commandPaletteModel.ts
+++ b/frontend-modern/src/components/shared/commandPaletteModel.ts
@@ -1,12 +1,12 @@
import {
- primaryPlatformNavigationIsVisible,
- type PlatformNavigationVisibility,
-} from '@/features/platformNavigation/platformNavigationModel';
+ primaryInfrastructureNavigationIsVisible,
+ type InfrastructureNavigationVisibility,
+} from '@/features/infrastructureNavigation/infrastructureNavigationModel';
export interface CommandPaletteModalProps {
isOpen: boolean;
onClose: () => void;
- platformVisibility: () => PlatformNavigationVisibility;
+ infrastructureVisibility: () => InfrastructureNavigationVisibility;
}
export type CommandPaletteModalCommand = {
@@ -29,12 +29,12 @@ export type CommandPaletteCommandPaths = {
export function buildCommandPaletteCommands(options: {
paths: CommandPaletteCommandPaths;
- platformVisibility: PlatformNavigationVisibility;
+ infrastructureVisibility: InfrastructureNavigationVisibility;
navigate: (path: string) => void;
}): CommandPaletteModalCommand[] {
const commands: CommandPaletteModalCommand[] = [];
- if (primaryPlatformNavigationIsVisible(options.platformVisibility, 'proxmox')) {
+ if (primaryInfrastructureNavigationIsVisible(options.infrastructureVisibility, 'proxmox')) {
commands.push({
id: 'nav-proxmox',
label: 'Go to Proxmox',
@@ -45,7 +45,7 @@ export function buildCommandPaletteCommands(options: {
});
}
- if (primaryPlatformNavigationIsVisible(options.platformVisibility, 'docker')) {
+ if (primaryInfrastructureNavigationIsVisible(options.infrastructureVisibility, 'docker')) {
commands.push({
id: 'nav-docker',
label: 'Go to Containers',
@@ -56,7 +56,7 @@ export function buildCommandPaletteCommands(options: {
});
}
- if (primaryPlatformNavigationIsVisible(options.platformVisibility, 'kubernetes')) {
+ if (primaryInfrastructureNavigationIsVisible(options.infrastructureVisibility, 'kubernetes')) {
commands.push(
{
id: 'nav-kubernetes',
@@ -76,7 +76,7 @@ export function buildCommandPaletteCommands(options: {
);
}
- if (primaryPlatformNavigationIsVisible(options.platformVisibility, 'truenas')) {
+ if (primaryInfrastructureNavigationIsVisible(options.infrastructureVisibility, 'truenas')) {
commands.push({
id: 'nav-truenas',
label: 'Go to TrueNAS',
@@ -87,7 +87,7 @@ export function buildCommandPaletteCommands(options: {
});
}
- if (primaryPlatformNavigationIsVisible(options.platformVisibility, 'vmware')) {
+ if (primaryInfrastructureNavigationIsVisible(options.infrastructureVisibility, 'vmware')) {
commands.push({
id: 'nav-vmware',
label: 'Go to vSphere',
diff --git a/frontend-modern/src/components/shared/mobileNavBarModel.ts b/frontend-modern/src/components/shared/mobileNavBarModel.ts
index 79a25b570b..655cbafbe3 100644
--- a/frontend-modern/src/components/shared/mobileNavBarModel.ts
+++ b/frontend-modern/src/components/shared/mobileNavBarModel.ts
@@ -2,7 +2,7 @@ import type { Component } from 'solid-js';
export type MobileNavBarIcon = Component<{ class?: string }>;
-export type MobileNavBarPlatformTab = {
+export type MobileNavBarPrimaryTab = {
id: string;
label: string;
route: string;
@@ -28,13 +28,13 @@ export type MobileNavBarUtilityTab = {
export type MobileNavBarProps = {
activeTab: () => string | null;
- platformTabs: () => MobileNavBarPlatformTab[];
+ primaryTabs: () => MobileNavBarPrimaryTab[];
utilityTabs: () => MobileNavBarUtilityTab[];
- onPlatformClick: (platform: MobileNavBarPlatformTab) => void;
+ onPrimaryClick: (tab: MobileNavBarPrimaryTab) => void;
onUtilityClick: (tab: MobileNavBarUtilityTab) => void;
};
-const MOBILE_NAV_PLATFORM_PRIORITY = [
+const MOBILE_NAV_PRIMARY_PRIORITY = [
'proxmox',
'docker',
'kubernetes',
@@ -64,10 +64,10 @@ export function buildOrderedMobileNavTabs<T extends { id: string }>(
return ordered;
}
-export function buildOrderedMobileNavPlatformTabs(
- tabs: MobileNavBarPlatformTab[],
-): MobileNavBarPlatformTab[] {
- return buildOrderedMobileNavTabs(tabs, MOBILE_NAV_PLATFORM_PRIORITY);
+export function buildOrderedMobileNavPrimaryTabs(
+ tabs: MobileNavBarPrimaryTab[],
+): MobileNavBarPrimaryTab[] {
+ return buildOrderedMobileNavTabs(tabs, MOBILE_NAV_PRIMARY_PRIORITY);
}
export function buildOrderedMobileNavUtilityTabs(
diff --git a/frontend-modern/src/components/shared/useCommandPaletteState.ts b/frontend-modern/src/components/shared/useCommandPaletteState.ts
index 6ad8da36c6..d4723480e3 100644
--- a/frontend-modern/src/components/shared/useCommandPaletteState.ts
+++ b/frontend-modern/src/components/shared/useCommandPaletteState.ts
@@ -31,7 +31,7 @@ export function useCommandPaletteState(props: CommandPaletteModalProps) {
trueNasPath: buildTrueNASPath(),
vmwarePath: buildVmwarePath(),
},
- platformVisibility: props.platformVisibility(),
+ infrastructureVisibility: props.infrastructureVisibility(),
navigate,
}),
);
diff --git a/frontend-modern/src/components/shared/useMobileNavBarState.ts b/frontend-modern/src/components/shared/useMobileNavBarState.ts
index 3c6f41e48d..0e23cf7ab8 100644
--- a/frontend-modern/src/components/shared/useMobileNavBarState.ts
+++ b/frontend-modern/src/components/shared/useMobileNavBarState.ts
@@ -1,15 +1,15 @@
import { createEffect, createMemo, createSignal, onCleanup } from 'solid-js';
import {
- buildOrderedMobileNavPlatformTabs,
+ buildOrderedMobileNavPrimaryTabs,
buildOrderedMobileNavUtilityTabs,
getMobileNavFadeState,
- type MobileNavBarPlatformTab,
+ type MobileNavBarPrimaryTab,
type MobileNavBarProps,
type MobileNavBarUtilityTab,
} from './mobileNavBarModel';
export type {
- MobileNavBarPlatformTab,
+ MobileNavBarPrimaryTab,
MobileNavBarProps,
MobileNavBarUtilityTab,
} from './mobileNavBarModel';
@@ -19,8 +19,8 @@ export function useMobileNavBarState(props: MobileNavBarProps) {
const [showLeftFade, setShowLeftFade] = createSignal(false);
const [navRef, setNavRef] = createSignal<HTMLDivElement>();
- const orderedPlatformTabs = createMemo(() =>
- buildOrderedMobileNavPlatformTabs(props.platformTabs()),
+ const orderedPrimaryTabs = createMemo(() =>
+ buildOrderedMobileNavPrimaryTabs(props.primaryTabs()),
);
const orderedUtilityTabs = createMemo(() =>
buildOrderedMobileNavUtilityTabs(props.utilityTabs()),
@@ -62,8 +62,8 @@ export function useMobileNavBarState(props: MobileNavBarProps) {
});
});
- const handlePlatformClick = (platform: MobileNavBarPlatformTab) => {
- props.onPlatformClick(platform);
+ const handlePrimaryClick = (tab: MobileNavBarPrimaryTab) => {
+ props.onPrimaryClick(tab);
};
const handleUtilityClick = (tab: MobileNavBarUtilityTab) => {
@@ -71,9 +71,9 @@ export function useMobileNavBarState(props: MobileNavBarProps) {
};
return {
- handlePlatformClick,
+ handlePrimaryClick,
handleUtilityClick,
- orderedPlatformTabs,
+ orderedPrimaryTabs,
orderedUtilityTabs,
setNavRef,
showFade,
diff --git a/frontend-modern/src/features/platformNavigation/__tests__/platformNavigationModel.test.ts b/frontend-modern/src/features/infrastructureNavigation/__tests__/infrastructureNavigationModel.test.ts
similarity index 81%
rename from frontend-modern/src/features/platformNavigation/__tests__/platformNavigationModel.test.ts
rename to frontend-modern/src/features/infrastructureNavigation/__tests__/infrastructureNavigationModel.test.ts
index 7ffc765619..bc6ca03bbf 100644
--- a/frontend-modern/src/features/platformNavigation/__tests__/platformNavigationModel.test.ts
+++ b/frontend-modern/src/features/infrastructureNavigation/__tests__/infrastructureNavigationModel.test.ts
@@ -1,10 +1,10 @@
import { describe, expect, it } from 'vitest';
import type { Resource } from '@/types/resource';
import {
- buildPrimaryPlatformNavigationVisibility,
+ buildPrimaryInfrastructureNavigationVisibility,
collectResourcePlatformEvidence,
- selectFirstVisiblePrimaryPlatformNavigationId,
-} from '../platformNavigationModel';
+ selectFirstVisiblePrimaryInfrastructureNavigationId,
+} from '../infrastructureNavigationModel';
const resource = (overrides: Partial<Resource>): Resource =>
({
@@ -20,9 +20,9 @@ const resource = (overrides: Partial<Resource>): Resource =>
...overrides,
}) as Resource;
-describe('platformNavigationModel', () => {
- it('shows primary platform destinations only when supported resource evidence is present', () => {
- expect(buildPrimaryPlatformNavigationVisibility([])).toEqual({
+describe('infrastructureNavigationModel', () => {
+ it('shows primary infrastructure destinations only when supported resource evidence is present', () => {
+ expect(buildPrimaryInfrastructureNavigationVisibility([])).toEqual({
proxmox: false,
docker: false,
kubernetes: false,
@@ -31,7 +31,7 @@ describe('platformNavigationModel', () => {
});
expect(
- buildPrimaryPlatformNavigationVisibility([
+ buildPrimaryInfrastructureNavigationVisibility([
resource({ id: 'pve-1', platformType: 'proxmox-pve', type: 'agent' }),
resource({
id: 'pod-1',
@@ -59,7 +59,8 @@ describe('platformNavigationModel', () => {
'proxmox-pmg',
);
expect(
- buildPrimaryPlatformNavigationVisibility([resource({ id: 'pmg-1', type: 'pmg' })]).proxmox,
+ buildPrimaryInfrastructureNavigationVisibility([resource({ id: 'pmg-1', type: 'pmg' })])
+ .proxmox,
).toBe(true);
});
@@ -79,7 +80,7 @@ describe('platformNavigationModel', () => {
).toEqual(['truenas']);
expect(
- buildPrimaryPlatformNavigationVisibility([
+ buildPrimaryInfrastructureNavigationVisibility([
resource({
id: 'truenas-app-nextcloud',
type: 'app-container',
@@ -99,7 +100,7 @@ describe('platformNavigationModel', () => {
});
expect(
- buildPrimaryPlatformNavigationVisibility([
+ buildPrimaryInfrastructureNavigationVisibility([
resource({
id: 'docker-container-frigate-141',
type: 'app-container',
@@ -119,7 +120,7 @@ describe('platformNavigationModel', () => {
it('selects the first visible platform using the canonical primary navigation order', () => {
expect(
- selectFirstVisiblePrimaryPlatformNavigationId({
+ selectFirstVisiblePrimaryInfrastructureNavigationId({
proxmox: false,
docker: false,
kubernetes: true,
@@ -129,7 +130,7 @@ describe('platformNavigationModel', () => {
).toBe('kubernetes');
expect(
- selectFirstVisiblePrimaryPlatformNavigationId({
+ selectFirstVisiblePrimaryInfrastructureNavigationId({
proxmox: false,
docker: false,
kubernetes: false,
diff --git a/frontend-modern/src/features/platformNavigation/platformNavigationModel.ts b/frontend-modern/src/features/infrastructureNavigation/infrastructureNavigationModel.ts
similarity index 64%
rename from frontend-modern/src/features/platformNavigation/platformNavigationModel.ts
rename to frontend-modern/src/features/infrastructureNavigation/infrastructureNavigationModel.ts
index 38fe1e2b0a..c912a9fe74 100644
--- a/frontend-modern/src/features/platformNavigation/platformNavigationModel.ts
+++ b/frontend-modern/src/features/infrastructureNavigation/infrastructureNavigationModel.ts
@@ -7,16 +7,16 @@ import {
} from '@/utils/platformSupportManifest';
import { normalizeSourcePlatformKey, resolveResourcePlatformType } from '@/utils/sourcePlatforms';
-export type PrimaryPlatformNavId = 'proxmox' | 'docker' | 'kubernetes' | 'truenas' | 'vmware';
+export type PrimaryInfrastructureNavId = 'proxmox' | 'docker' | 'kubernetes' | 'truenas' | 'vmware';
-export type PlatformNavigationVisibility = Record<PrimaryPlatformNavId, boolean>;
+export type InfrastructureNavigationVisibility = Record<PrimaryInfrastructureNavId, boolean>;
-export type PlatformNavigationShortcut = {
+export type InfrastructureNavigationShortcut = {
key: string;
route: string;
};
-export const PRIMARY_PLATFORM_NAV_IDS: readonly PrimaryPlatformNavId[] = [
+export const PRIMARY_INFRASTRUCTURE_NAV_IDS: readonly PrimaryInfrastructureNavId[] = [
'proxmox',
'docker',
'kubernetes',
@@ -24,7 +24,10 @@ export const PRIMARY_PLATFORM_NAV_IDS: readonly PrimaryPlatformNavId[] = [
'vmware',
] as const;
-export const PRIMARY_PLATFORM_NAV_PLATFORM_IDS: Record<PrimaryPlatformNavId, readonly string[]> = {
+export const PRIMARY_INFRASTRUCTURE_NAV_SCOPE_IDS: Record<
+ PrimaryInfrastructureNavId,
+ readonly string[]
+> = {
proxmox: ['proxmox-pve', 'proxmox-pbs', 'proxmox-pmg'],
docker: ['docker'],
kubernetes: ['kubernetes'],
@@ -61,10 +64,7 @@ const addPlatformDataSources = (ids: Set<string>, platformData: Record<string, u
});
};
-const addPlatformScopeEvidence = (
- ids: Set<string>,
- values: unknown,
-): void => {
+const addPlatformScopeEvidence = (ids: Set<string>, values: unknown): void => {
if (!Array.isArray(values)) return;
values.forEach((value) => {
if (typeof value === 'string') addManifestPlatformId(ids, value);
@@ -127,7 +127,9 @@ export function collectResourcePlatformEvidence(resource: Resource): string[] {
return [...ids];
}
-export function buildSupportedResourcePlatformSet(resources: readonly Resource[]): Set<string> {
+export function buildSupportedResourceInfrastructureScopeSet(
+ resources: readonly Resource[],
+): Set<string> {
const present = new Set<string>();
for (const resource of resources) {
for (const platformId of collectResourcePlatformEvidence(resource)) {
@@ -141,53 +143,55 @@ export function buildSupportedResourcePlatformSet(resources: readonly Resource[]
return present;
}
-export function buildPrimaryPlatformNavigationVisibility(
+export function buildPrimaryInfrastructureNavigationVisibility(
resources: readonly Resource[],
-): PlatformNavigationVisibility {
- const presentSupportedPlatforms = buildSupportedResourcePlatformSet(resources);
+): InfrastructureNavigationVisibility {
+ const presentSupportedScopes = buildSupportedResourceInfrastructureScopeSet(resources);
return {
- proxmox: PRIMARY_PLATFORM_NAV_PLATFORM_IDS.proxmox.some((id) =>
- presentSupportedPlatforms.has(id),
+ proxmox: PRIMARY_INFRASTRUCTURE_NAV_SCOPE_IDS.proxmox.some((id) =>
+ presentSupportedScopes.has(id),
),
- docker: PRIMARY_PLATFORM_NAV_PLATFORM_IDS.docker.some((id) =>
- presentSupportedPlatforms.has(id),
+ docker: PRIMARY_INFRASTRUCTURE_NAV_SCOPE_IDS.docker.some((id) =>
+ presentSupportedScopes.has(id),
),
- kubernetes: PRIMARY_PLATFORM_NAV_PLATFORM_IDS.kubernetes.some((id) =>
- presentSupportedPlatforms.has(id),
+ kubernetes: PRIMARY_INFRASTRUCTURE_NAV_SCOPE_IDS.kubernetes.some((id) =>
+ presentSupportedScopes.has(id),
),
- truenas: PRIMARY_PLATFORM_NAV_PLATFORM_IDS.truenas.some((id) =>
- presentSupportedPlatforms.has(id),
+ truenas: PRIMARY_INFRASTRUCTURE_NAV_SCOPE_IDS.truenas.some((id) =>
+ presentSupportedScopes.has(id),
),
- vmware: PRIMARY_PLATFORM_NAV_PLATFORM_IDS.vmware.some((id) =>
- presentSupportedPlatforms.has(id),
+ vmware: PRIMARY_INFRASTRUCTURE_NAV_SCOPE_IDS.vmware.some((id) =>
+ presentSupportedScopes.has(id),
),
};
}
-export function primaryPlatformNavigationIsVisible(
- visibility: PlatformNavigationVisibility,
- platformId: PrimaryPlatformNavId,
+export function primaryInfrastructureNavigationIsVisible(
+ visibility: InfrastructureNavigationVisibility,
+ navId: PrimaryInfrastructureNavId,
): boolean {
- return visibility[platformId] === true;
+ return visibility[navId] === true;
}
-export function selectFirstVisiblePrimaryPlatformNavigationId(
- visibility: PlatformNavigationVisibility,
-): PrimaryPlatformNavId | null {
+export function selectFirstVisiblePrimaryInfrastructureNavigationId(
+ visibility: InfrastructureNavigationVisibility,
+): PrimaryInfrastructureNavId | null {
return (
- PRIMARY_PLATFORM_NAV_IDS.find((platformId) =>
- primaryPlatformNavigationIsVisible(visibility, platformId),
+ PRIMARY_INFRASTRUCTURE_NAV_IDS.find((navId) =>
+ primaryInfrastructureNavigationIsVisible(visibility, navId),
) ?? null
);
}
-export function filterPlatformNavigationShortcuts(
- shortcuts: Record<string, PlatformNavigationShortcut>,
- visibility: PlatformNavigationVisibility,
+export function filterInfrastructureNavigationShortcuts(
+ shortcuts: Record<string, InfrastructureNavigationShortcut>,
+ visibility: InfrastructureNavigationVisibility,
): Record<string, string> {
const routes: Record<string, string> = {};
- for (const [platformId, shortcut] of Object.entries(shortcuts)) {
- if (!primaryPlatformNavigationIsVisible(visibility, platformId as PrimaryPlatformNavId)) {
+ for (const [navId, shortcut] of Object.entries(shortcuts)) {
+ if (
+ !primaryInfrastructureNavigationIsVisible(visibility, navId as PrimaryInfrastructureNavId)
+ ) {
continue;
}
routes[shortcut.key] = shortcut.route;
@@ -195,7 +199,7 @@ export function filterPlatformNavigationShortcuts(
return routes;
}
-export function createEmptyPlatformNavigationVisibility(): PlatformNavigationVisibility {
+export function createEmptyInfrastructureNavigationVisibility(): InfrastructureNavigationVisibility {
return {
proxmox: false,
docker: false,
@@ -205,8 +209,8 @@ export function createEmptyPlatformNavigationVisibility(): PlatformNavigationVis
};
}
-export function platformNavigationVisibilityFromResources(
+export function infrastructureNavigationVisibilityFromResources(
resources: Accessor<readonly Resource[]>,
-): PlatformNavigationVisibility {
- return buildPrimaryPlatformNavigationVisibility(resources());
+): InfrastructureNavigationVisibility {
+ return buildPrimaryInfrastructureNavigationVisibility(resources());
}
diff --git a/frontend-modern/src/hooks/useKeyboardShortcuts.ts b/frontend-modern/src/hooks/useKeyboardShortcuts.ts
index 08233fe783..af25c45469 100644
--- a/frontend-modern/src/hooks/useKeyboardShortcuts.ts
+++ b/frontend-modern/src/hooks/useKeyboardShortcuts.ts
@@ -8,10 +8,10 @@ import {
buildVmwarePath,
} from '@/routing/resourceLinks';
import {
- createEmptyPlatformNavigationVisibility,
- filterPlatformNavigationShortcuts,
- type PlatformNavigationVisibility,
-} from '@/features/platformNavigation/platformNavigationModel';
+ createEmptyInfrastructureNavigationVisibility,
+ filterInfrastructureNavigationShortcuts,
+ type InfrastructureNavigationVisibility,
+} from '@/features/infrastructureNavigation/infrastructureNavigationModel';
import { focusActiveTypeToSearch } from '@/hooks/useTypeToSearch';
type KeyboardShortcutsOptions = {
@@ -25,7 +25,7 @@ type KeyboardShortcutsOptions = {
onCloseCommandPalette?: () => void;
onToggleCommandPalette?: () => void;
onFocusSearch?: () => boolean | void;
- platformVisibility?: Accessor<PlatformNavigationVisibility>;
+ infrastructureVisibility?: Accessor<InfrastructureNavigationVisibility>;
};
const isEditableTarget = (target: EventTarget | null): boolean => {
@@ -82,9 +82,9 @@ export function useKeyboardShortcuts(options: KeyboardShortcutsOptions = {}) {
};
const getRoutes = (): Record<string, string> => {
- const platformVisibility =
- options.platformVisibility?.() ?? createEmptyPlatformNavigationVisibility();
- const platformRoutes = filterPlatformNavigationShortcuts(
+ const infrastructureVisibility =
+ options.infrastructureVisibility?.() ?? createEmptyInfrastructureNavigationVisibility();
+ const infrastructureRoutes = filterInfrastructureNavigationShortcuts(
{
proxmox: { key: 'p', route: buildProxmoxPath() },
docker: { key: 'd', route: buildDockerPath() },
@@ -92,10 +92,10 @@ export function useKeyboardShortcuts(options: KeyboardShortcutsOptions = {}) {
truenas: { key: 'n', route: buildTrueNASPath() },
vmware: { key: 'v', route: buildVmwarePath() },
},
- platformVisibility,
+ infrastructureVisibility,
);
return {
- ...platformRoutes,
+ ...infrastructureRoutes,
a: '/alerts',
r: '/patrol',
t: '/settings',
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index aeb041b58b..b3ea933562 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -3063,7 +3063,7 @@ describe('frontend resource type boundaries', () => {
expect(mobileNavBarStateSource).toContain('window.addEventListener');
expect(mobileNavBarStateSource).toContain('requestAnimationFrame');
expect(mobileNavBarStateSource).toContain('scrollIntoView');
- expect(mobileNavBarModelSource).toContain('buildOrderedMobileNavPlatformTabs');
+ expect(mobileNavBarModelSource).toContain('buildOrderedMobileNavPrimaryTabs');
expect(mobileNavBarModelSource).toContain('buildOrderedMobileNavUtilityTabs');
expect(mobileNavBarModelSource).toContain('getMobileNavAlertBadgeCounts');
expect(mobileNavBarModelSource).toContain('getMobileNavFadeState');