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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Converge platform notices on shared primitive
rcourtman9ee313b8a7f3
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex 1aed897a3e..45b44c35bf 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -159,6 +159,8 @@ work extends shared components instead of creating new local variants.130. `frontend-modern/scripts/shared-template-registry.json`131. `frontend-modern/src/features/platformPage/sharedPlatformPage.tsx`131a. `frontend-modern/src/features/platformPage/PlatformResourceDetailTableRow.tsx`+131b. `frontend-modern/src/features/platformPage/PlatformOutdatedAgentNotice.tsx`+131c. `frontend-modern/src/features/platformPage/PlatformOutdatedSensorSetupNotice.tsx`132. `frontend-modern/src/utils/platformSupportManifest.generated.ts`133. `frontend-modern/src/utils/platformSupportManifest.ts`134. `frontend-modern/src/utils/sourcePlatformOptions.ts`@@ -167,6 +169,8 @@ work extends shared components instead of creating new local variants.137. `frontend-modern/src/components/shared/Button.tsx`138. `frontend-modern/src/components/shared/buttonModel.ts`139. `frontend-modern/src/components/shared/Button.test.tsx`+139a. `frontend-modern/src/components/shared/InlineNotice.tsx`+139b. `frontend-modern/src/components/shared/InlineNotice.test.tsx`140. `frontend-modern/src/components/shared/CopyableCodeRow.tsx`141. `frontend-modern/src/components/shared/DetailSectionTable.tsx`142. `frontend-modern/src/components/shared/detailSectionModel.ts`@@ -275,7 +279,10 @@ PersistentVolumeClaim-specific columns. Kubernetes networking inventory alsofollows that same primitive boundary while the unified-resource owner suppliesService, Ingress, and EndpointSlice-specific columns.Outdated-agent notices on platform pages are part of this same shared-frontend/platform primitive boundary. Agent-backed and hybrid platform pages may+frontend/platform primitive boundary and must compose+`frontend-modern/src/components/shared/InlineNotice.tsx` for the dense notice+shell, icon/content layout, and action-link chrome. Agent-backed and hybrid+platform pages maysurface a compact stale-agent cue when their row model carries Pulse agentidentity and version evidence, but the CTA must route to the canonicalInfrastructure settings update-command surface with scoped agent IDs instead of@@ -3340,6 +3347,16 @@ palette and the `scale="compact"` density used by smaller settings notices, andthe `settings-callout-card-shell` shared-template registry rule requires currentsettings consumers to compose it instead of reintroducing local panel shells.+Platform inline notices that sit inside platform pages but are not settings+callouts must route through the shared `InlineNotice` primitive. Platform owners+provide only the affected-resource copy, render predicate, and destination; the+shared primitive owns the dense warning/info/danger/success tone palette,+icon/content layout, and action-link chrome. The+`platform-inline-notice-shell` registry rule covers current outdated-agent and+outdated-sensor notices, and the+`platform-inline-notice-local-amber-shell` pattern guard blocks future+`platformPage` files from reintroducing page-local amber notice shells.+Alert incident-event filter containers, labels, and chips must now routethrough the shared presentation helpers in`frontend-modern/src/utils/alertIncidentPresentation.ts` instead of allowingdiff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.jsonindex 3fb7b7b042..dbc8d5b4b8 100644--- a/docs/release-control/v6/internal/subsystems/registry.json+++ b/docs/release-control/v6/internal/subsystems/registry.json@@ -3144,6 +3144,8 @@"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/platformPage/PlatformOutdatedAgentNotice.tsx",+ "frontend-modern/src/features/platformPage/PlatformOutdatedSensorSetupNotice.tsx","frontend-modern/src/features/platformPage/PlatformResourceDetailTableRow.tsx","frontend-modern/src/features/platformPage/sharedPlatformPage.tsx","frontend-modern/src/hooks/createNonSuspendingQuery.ts",@@ -3579,6 +3581,8 @@"match_files": ["frontend-modern/scripts/shared-template-audit.mjs","frontend-modern/scripts/shared-template-registry.json",+ "frontend-modern/src/features/platformPage/PlatformOutdatedAgentNotice.tsx",+ "frontend-modern/src/features/platformPage/PlatformOutdatedSensorSetupNotice.tsx","frontend-modern/src/features/platformPage/PlatformResourceDetailTableRow.tsx","frontend-modern/src/features/platformPage/sharedPlatformPage.tsx"],diff --git a/frontend-modern/scripts/shared-template-registry.json b/frontend-modern/scripts/shared-template-registry.jsonindex 66d8f0558f..3b8256dfe5 100644--- a/frontend-modern/scripts/shared-template-registry.json+++ b/frontend-modern/scripts/shared-template-registry.json@@ -337,6 +337,40 @@"scripts/shared-template-audit.mjs"]},+ {+ "id": "platform-inline-notice-shell",+ "category": "callout",+ "summary": "Platform inline notices must compose InlineNotice for shared dense notice tone, icon/content layout, and action-link chrome instead of copying platform-local amber notice shells.",+ "canonical": {+ "path": "src/components/shared/InlineNotice.tsx",+ "export": "InlineNotice"+ },+ "requiredConsumers": [+ { "path": "src/features/platformPage/PlatformOutdatedAgentNotice.tsx" },+ { "path": "src/features/platformPage/PlatformOutdatedSensorSetupNotice.tsx" }+ ],+ "forbiddenPatterns": [+ {+ "path": "src/features/platformPage/PlatformOutdatedAgentNotice.tsx",+ "patterns": [+ "rounded-lg border border-amber-300 bg-amber-50",+ "text-amber-900 underline-offset-2"+ ]+ },+ {+ "path": "src/features/platformPage/PlatformOutdatedSensorSetupNotice.tsx",+ "patterns": [+ "rounded-lg border border-amber-300 bg-amber-50",+ "text-amber-900 underline-offset-2"+ ]+ }+ ],+ "proof": [+ "src/components/shared/SharedPrimitives.guardrails.test.ts",+ "src/components/shared/InlineNotice.test.tsx",+ "scripts/shared-template-audit.mjs"+ ]+ },{"id": "status-dot-shell","category": "status-indicator",@@ -2308,6 +2342,29 @@"scripts/shared-template-audit.mjs"]},+ {+ "id": "platform-inline-notice-local-amber-shell",+ "category": "callout",+ "summary": "Platform page code must not recreate the dense amber inline notice shell locally; compose InlineNotice so notice tone, spacing, icon layout, and action-link chrome stay shared.",+ "canonical": {+ "path": "src/components/shared/InlineNotice.tsx",+ "export": "InlineNotice"+ },+ "scopes": ["src/features/platformPage"],+ "extensions": [".tsx"],+ "allPatterns": [+ "rounded-lg border",+ "border-amber-300 bg-amber-50",+ "dark:border-amber-800/60 dark:bg-amber-900/20"+ ],+ "allowedPaths": [],+ "ignoredPaths": ["src/components/shared/SharedPrimitives.guardrails.test.ts"],+ "proof": [+ "src/components/shared/SharedPrimitives.guardrails.test.ts",+ "src/components/shared/InlineNotice.test.tsx",+ "scripts/shared-template-audit.mjs"+ ]+ },{"id": "patrol-ai-local-loading-spinner-shell","category": "loading-indicator",diff --git a/frontend-modern/src/components/shared/InlineNotice.test.tsx b/frontend-modern/src/components/shared/InlineNotice.test.tsxnew file mode 100644index 0000000000..8aef715a30--- /dev/null+++ b/frontend-modern/src/components/shared/InlineNotice.test.tsx@@ -0,0 +1,55 @@+import { cleanup, render, screen } from '@solidjs/testing-library';+import { afterEach, describe, expect, it } from 'vitest';+import { InlineNotice } from './InlineNotice';++describe('InlineNotice', () => {+ afterEach(() => {+ cleanup();+ });++ it('renders dense status copy, icon, and action link through the shared primitive', () => {+ render(() => (+ <InlineNotice+ role="status"+ icon={<span data-testid="notice-icon">!</span>}+ actionHref="/settings/infrastructure"+ actionLabel="Open Infrastructure settings"+ actionIcon={<span data-testid="action-icon">go</span>}+ >+ Update the affected agent to see inventory.+ </InlineNotice>+ ));++ expect(screen.getByRole('status')).toHaveTextContent(+ 'Update the affected agent to see inventory.',+ );+ expect(screen.getByTestId('notice-icon')).toBeInTheDocument();+ expect(screen.getByRole('link', { name: 'Open Infrastructure settings' })).toHaveAttribute(+ 'href',+ '/settings/infrastructure',+ );+ expect(screen.getByTestId('action-icon')).toBeInTheDocument();+ });++ it('owns warning notice and action-link tone classes', () => {+ render(() => (+ <InlineNotice actionHref="/settings/infrastructure" actionLabel="Open settings">+ Shared warning notice.+ </InlineNotice>+ ));++ const notice = screen.getByText('Shared warning notice.').closest('.rounded-lg');+ expect(notice?.className).toContain('border-amber-300');+ expect(notice?.className).toContain('bg-amber-50');+ expect(screen.getByRole('link', { name: 'Open settings' }).className).toContain(+ 'text-amber-900',+ );+ });++ it('supports non-warning platform notice tones without changing consumers', () => {+ render(() => <InlineNotice tone="info">Shared informational notice.</InlineNotice>);++ const notice = screen.getByText('Shared informational notice.').closest('.rounded-lg');+ expect(notice?.className).toContain('border-blue-300');+ });+});diff --git a/frontend-modern/src/components/shared/InlineNotice.tsx b/frontend-modern/src/components/shared/InlineNotice.tsxnew file mode 100644index 0000000000..fdbf223e2f--- /dev/null+++ b/frontend-modern/src/components/shared/InlineNotice.tsx@@ -0,0 +1,100 @@+import { mergeProps, Show, splitProps, type JSX } from 'solid-js';++export type InlineNoticeTone = 'danger' | 'info' | 'success' | 'warning';++interface InlineNoticeProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'class'> {+ tone?: InlineNoticeTone;+ icon?: JSX.Element;+ actionHref?: string;+ actionLabel?: JSX.Element;+ actionIcon?: JSX.Element;+ actionAriaLabel?: string;+ class?: string;+}++export const INLINE_NOTICE_BASE_CLASS =+ 'flex items-start gap-2 rounded-lg border px-3 py-2 text-sm';++export const INLINE_NOTICE_TONE_CLASSES: Record<InlineNoticeTone, string> = {+ danger:+ 'border-red-300 bg-red-50 text-red-800 dark:border-red-800/60 dark:bg-red-900/20 dark:text-red-200',+ info: 'border-blue-300 bg-blue-50 text-blue-800 dark:border-blue-800/60 dark:bg-blue-900/20 dark:text-blue-200',+ success:+ 'border-emerald-300 bg-emerald-50 text-emerald-800 dark:border-emerald-800/60 dark:bg-emerald-900/20 dark:text-emerald-200',+ warning:+ 'border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-800/60 dark:bg-amber-900/20 dark:text-amber-200',+};++const INLINE_NOTICE_ICON_CLASS =+ 'mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center [&>svg]:h-4 [&>svg]:w-4';++const INLINE_NOTICE_CONTENT_CLASS = 'min-w-0 flex-1 space-y-1';++const INLINE_NOTICE_ACTION_BASE_CLASS =+ 'inline-flex items-center gap-1 text-xs font-semibold underline-offset-2 hover:underline';++export const INLINE_NOTICE_ACTION_TONE_CLASSES: Record<InlineNoticeTone, string> = {+ danger: 'text-red-900 dark:text-red-100',+ info: 'text-blue-900 dark:text-blue-100',+ success: 'text-emerald-900 dark:text-emerald-100',+ warning: 'text-amber-900 dark:text-amber-100',+};++const INLINE_NOTICE_ACTION_ICON_CLASS =+ 'inline-flex h-3.5 w-3.5 items-center justify-center [&>svg]:h-3.5 [&>svg]:w-3.5';++export function InlineNotice(props: InlineNoticeProps) {+ const merged = mergeProps({ tone: 'warning' as InlineNoticeTone }, props);+ const [local, rest] = splitProps(merged, [+ 'tone',+ 'icon',+ 'actionHref',+ 'actionLabel',+ 'actionIcon',+ 'actionAriaLabel',+ 'children',+ 'class',+ ]);++ return (+ <div+ class={`${INLINE_NOTICE_BASE_CLASS} ${INLINE_NOTICE_TONE_CLASSES[local.tone]} ${+ local.class ?? ''+ }`.trim()}+ {...rest}+ >+ <Show when={local.icon}>+ <span class={INLINE_NOTICE_ICON_CLASS} aria-hidden="true">+ {local.icon}+ </span>+ </Show>+ <div class={INLINE_NOTICE_CONTENT_CLASS}>+ <div>{local.children}</div>+ <Show when={local.actionHref}>+ {(href) => (+ <Show when={local.actionLabel}>+ {(label) => (+ <a+ href={href()}+ aria-label={local.actionAriaLabel}+ class={`${INLINE_NOTICE_ACTION_BASE_CLASS} ${+ INLINE_NOTICE_ACTION_TONE_CLASSES[local.tone]+ }`}+ >+ <span>{label()}</span>+ <Show when={local.actionIcon}>+ <span class={INLINE_NOTICE_ACTION_ICON_CLASS} aria-hidden="true">+ {local.actionIcon}+ </span>+ </Show>+ </a>+ )}+ </Show>+ )}+ </Show>+ </div>+ </div>+ );+}++export default InlineNotice;diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.tsindex 4d08efaf0d..2f43636735 100644--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts@@ -2,6 +2,7 @@ import { readFileSync } from 'node:fs';import { join } from 'node:path';import { describe, expect, it } from 'vitest';import calloutCardSource from '@/components/shared/CalloutCard.tsx?raw';+import inlineNoticeSource from '@/components/shared/InlineNotice.tsx?raw';import assistantCommandHelpDialogSource from '@/components/AI/Chat/AssistantCommandHelpDialog.tsx?raw';import chatMessagesSource from '@/components/AI/Chat/ChatMessages.tsx?raw';import aiChatSource from '@/components/AI/Chat/index.tsx?raw';@@ -137,6 +138,8 @@ import standalonePageSurfaceSource from '@/features/standalone/StandalonePageSurimport sharedPlatformPageSource from '@/features/platformPage/sharedPlatformPage.tsx?raw';import platformAlertSeverityFilterOptionsSource from '@/features/platformPage/platformAlertSeverityFilterOptions.tsx?raw';import platformResourceDetailTableRowSource from '@/features/platformPage/PlatformResourceDetailTableRow.tsx?raw';+import platformOutdatedAgentNoticeSource from '@/features/platformPage/PlatformOutdatedAgentNotice.tsx?raw';+import platformOutdatedSensorSetupNoticeSource from '@/features/platformPage/PlatformOutdatedSensorSetupNotice.tsx?raw';import truenasPageSurfaceSource from '@/features/truenas/TrueNASPageSurface.tsx?raw';import truenasProtectionTableSource from '@/features/truenas/TrueNASProtectionTable.tsx?raw';import vmwarePageSurfaceSource from '@/features/vmware/VmwarePageSurface.tsx?raw';@@ -3195,6 +3198,64 @@ describe('shared primitive guardrails', () => {);});+ it('routes platform inline notices through InlineNotice', () => {+ const registry = JSON.parse(sharedTemplateRegistrySource) as {+ rules?: Array<{+ id: string;+ canonical?: { path?: string; export?: string };+ requiredConsumers?: Array<{ path?: string }>;+ forbiddenPatterns?: Array<{ path?: string; patterns?: string[] }>;+ }>;+ patternGuards?: Array<{+ id: string;+ canonical?: { path?: string; export?: string };+ scopes?: string[];+ allPatterns?: string[];+ }>;+ };+ const registeredRule = registry.rules?.find(+ (rule) => rule.id === 'platform-inline-notice-shell',+ );+ const registeredGuard = registry.patternGuards?.find(+ (guard) => guard.id === 'platform-inline-notice-local-amber-shell',+ );++ expect(registeredRule?.canonical?.path).toBe('src/components/shared/InlineNotice.tsx');+ expect(registeredRule?.canonical?.export).toBe('InlineNotice');+ expect(registeredRule?.requiredConsumers?.map((consumer) => consumer.path)).toEqual([+ 'src/features/platformPage/PlatformOutdatedAgentNotice.tsx',+ 'src/features/platformPage/PlatformOutdatedSensorSetupNotice.tsx',+ ]);+ expect(registeredRule?.forbiddenPatterns).toEqual(+ expect.arrayContaining([+ expect.objectContaining({+ path: 'src/features/platformPage/PlatformOutdatedAgentNotice.tsx',+ patterns: expect.arrayContaining(['rounded-lg border border-amber-300 bg-amber-50']),+ }),+ expect.objectContaining({+ path: 'src/features/platformPage/PlatformOutdatedSensorSetupNotice.tsx',+ patterns: expect.arrayContaining(['rounded-lg border border-amber-300 bg-amber-50']),+ }),+ ]),+ );+ expect(registeredGuard?.canonical?.path).toBe('src/components/shared/InlineNotice.tsx');+ expect(registeredGuard?.canonical?.export).toBe('InlineNotice');+ expect(registeredGuard?.scopes).toEqual(['src/features/platformPage']);+ expect(registeredGuard?.allPatterns).toEqual(+ expect.arrayContaining(['rounded-lg border', 'border-amber-300 bg-amber-50']),+ );+ expect(inlineNoticeSource).toContain('INLINE_NOTICE_TONE_CLASSES');+ expect(inlineNoticeSource).toContain('INLINE_NOTICE_ACTION_TONE_CLASSES');+ for (const source of [+ platformOutdatedAgentNoticeSource,+ platformOutdatedSensorSetupNoticeSource,+ ]) {+ expect(source).toContain('InlineNotice');+ expect(source).not.toContain('rounded-lg border border-amber-300 bg-amber-50');+ expect(source).not.toContain('text-amber-900 underline-offset-2');+ }+ });+it('keeps TLS verification warnings in the shared primitive boundary', () => {expect(tlsVerificationWarningBannerSource).toContain('role="alert"');expect(tlsVerificationWarningBannerSource).toContain('TLS verification disabled.');diff --git a/frontend-modern/src/features/platformPage/PlatformOutdatedAgentNotice.tsx b/frontend-modern/src/features/platformPage/PlatformOutdatedAgentNotice.tsxindex dce0c372f0..3128bfbc35 100644--- a/frontend-modern/src/features/platformPage/PlatformOutdatedAgentNotice.tsx+++ b/frontend-modern/src/features/platformPage/PlatformOutdatedAgentNotice.tsx@@ -1,5 +1,6 @@import { Show, createMemo } from 'solid-js';import { AlertTriangle, ArrowRight } from 'lucide-solid';+import { InlineNotice } from '@/components/shared/InlineNotice';import type { OutdatedAgentHost } from './agentVersion';type PlatformOutdatedAgentNoticeProps = {@@ -49,27 +50,17 @@ export function PlatformOutdatedAgentNotice(props: PlatformOutdatedAgentNoticePrreturn (<Show when={count() > 0}>- <div+ <InlineNoticerole="status"data-testid="platform-outdated-agent-notice"- class="flex items-start gap-2 rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-800 dark:border-amber-800/60 dark:bg-amber-900/20 dark:text-amber-200"+ tone="warning"+ icon={<AlertTriangle aria-hidden="true" />}+ actionHref={props.actionHref}+ actionLabel={actionLabel()}+ actionIcon={<ArrowRight aria-hidden="true" />}>- <AlertTriangle class="mt-0.5 h-4 w-4 shrink-0" aria-hidden="true" />- <div class="min-w-0 flex-1 space-y-1">- <div>{message()}</div>- <Show when={props.actionHref}>- {(href) => (- <a- href={href()}- class="inline-flex items-center gap-1 text-xs font-semibold text-amber-900 underline-offset-2 hover:underline dark:text-amber-100"- >- <span>{actionLabel()}</span>- <ArrowRight class="h-3.5 w-3.5" aria-hidden="true" />- </a>- )}- </Show>- </div>- </div>+ {message()}+ </InlineNotice></Show>);}diff --git a/frontend-modern/src/features/platformPage/PlatformOutdatedSensorSetupNotice.tsx b/frontend-modern/src/features/platformPage/PlatformOutdatedSensorSetupNotice.tsxindex b16a642828..aada988edd 100644--- a/frontend-modern/src/features/platformPage/PlatformOutdatedSensorSetupNotice.tsx+++ b/frontend-modern/src/features/platformPage/PlatformOutdatedSensorSetupNotice.tsx@@ -1,5 +1,6 @@import { Show, createMemo } from 'solid-js';import { AlertTriangle, ArrowRight } from 'lucide-solid';+import { InlineNotice } from '@/components/shared/InlineNotice';import type { OutdatedSensorSetupNode } from './sensorSetup';type PlatformOutdatedSensorSetupNoticeProps = {@@ -29,27 +30,17 @@ export function PlatformOutdatedSensorSetupNotice(props: PlatformOutdatedSensorSreturn (<Show when={count() > 0}>- <div+ <InlineNoticerole="status"data-testid="platform-outdated-sensor-setup-notice"- class="flex items-start gap-2 rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-800 dark:border-amber-800/60 dark:bg-amber-900/20 dark:text-amber-200"+ tone="warning"+ icon={<AlertTriangle aria-hidden="true" />}+ actionHref={props.actionHref}+ actionLabel={actionLabel()}+ actionIcon={<ArrowRight aria-hidden="true" />}>- <AlertTriangle class="mt-0.5 h-4 w-4 shrink-0" aria-hidden="true" />- <div class="min-w-0 flex-1 space-y-1">- <div>{message()}</div>- <Show when={props.actionHref}>- {(href) => (- <a- href={href()}- class="inline-flex items-center gap-1 text-xs font-semibold text-amber-900 underline-offset-2 hover:underline dark:text-amber-100"- >- <span>{actionLabel()}</span>- <ArrowRight class="h-3.5 w-3.5" aria-hidden="true" />- </a>- )}- </Show>- </div>- </div>+ {message()}+ </InlineNotice></Show>);}