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 panel empty states on shared primitive
rcourtman03b593461ff8
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.mdindex 9782fd0c3f..9b5424451e 100644--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md@@ -533,6 +533,11 @@ Agent profile loading indicators follow that same split:profile semantics, but spinner shell, size, tone, and accessible statusbehavior must compose frontend-primitives' `LoadingSpinner` instead oflifecycle-local `animate-spin` border classes.+Agent profile empty states follow that same split:+`AgentProfilesPanel.tsx` may own profile and assignment empty-state copy and+lifecycle conditions, but compact empty-state spacing, icon treatment, and text+hierarchy must compose frontend-primitives' `EmptyState` `variant="panel"`+instead of lifecycle-local centered icon/text shells.## Extension Pointsdiff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex ca47f2a5ae..2f6815fc8c 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -2683,6 +2683,15 @@ Docker, Kubernetes, Proxmox, Standalone, TrueNAS, vSphere, and future platformfeature tables; source-specific consumers own only the empty-state icon, title,description, and actions. Platform feature tables must not import`EmptyState` directly or recreate a `Card`-wrapped empty-state shell.+Embedded settings and patrol panel empty states follow the same+shared-template registry, but compose `EmptyState` directly with+`variant="panel"` when they are not platform table/card empty states. The+primitive owns compact spacing, icon treatment, text hierarchy,+framed-versus-panel density, and action-slot layout; feature panels own only+the empty-state copy, icon choice, and callbacks. Migrated panels such as+Agent profiles, Audit Webhooks, Audit Log, Availability, Diagnostics, SSO+providers, and Patrol Run History must not recreate local `text-center` icon+stacks, dashed empty-state frames, or page-local empty-state action buttons.Platform table loading states are registry-backed too.`PlatformTableLoadingState` owns the repeated table-card compact`role="status"` loading row for platform pages and tables; platform consumersdiff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.mdindex 86702dab86..731f150a44 100644--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md@@ -65,9 +65,14 @@ Patrol-specific presentation helpers.must compose the shared `MetadataBadge`. Patrol and AI finding loadingindicators must compose the shared `LoadingSpinner` for border-based spinnershell, size, tone, and accessibility behavior; icon-specific refresh- rotation remains local icon state. If Patrol needs a new badge shape, tone,- or loading indicator variant, extend the shared primitive and registry guard- instead of adding page-local rounded pill spans or spinner spans.+ rotation remains local icon state. Patrol run-history empty states own+ Patrol-specific copy through the Patrol presentation helper, but compact+ empty-state spacing, icon treatment, and text hierarchy must compose the+ frontend-primitives-owned `EmptyState` `variant="panel"` instead of+ page-local centered icon/text shells. If Patrol needs a new badge shape,+ tone, loading indicator variant, or empty-state shell variant, extend the+ shared primitive and registry guard instead of adding page-local rounded pill+ spans, spinner spans, or empty-state wrappers.3. Keep remediation execution badge copy and severity styling aligned through `frontend-modern/src/components/patrol/RemediationStatus.tsx` and `frontend-modern/src/utils/remediationPresentation.ts`4. Add or change Patrol header, summary, status runtime-state presentation, or runtime provider action presentation through `frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx`, `frontend-modern/src/features/patrol/PatrolIntelligenceSummary.tsx`, `frontend-modern/src/components/patrol/PatrolStatusBar.tsx`, `frontend-modern/src/utils/patrolRuntimePresentation.ts`, and `frontend-modern/src/utils/patrolRuntimeActions.ts`Patrol summary presentation may show recent activity mix and trigger mode asdiff --git a/frontend-modern/scripts/shared-template-registry.json b/frontend-modern/scripts/shared-template-registry.jsonindex 734db0f3c4..4615c47c9e 100644--- a/frontend-modern/scripts/shared-template-registry.json+++ b/frontend-modern/scripts/shared-template-registry.json@@ -1040,6 +1040,66 @@"scripts/shared-template-audit.mjs"]},+ {+ "id": "panel-empty-state-shell",+ "category": "empty-state",+ "summary": "Embedded settings panel empty states must compose EmptyState for shared compact spacing, icon treatment, text hierarchy, and action slots instead of recreating local centered icon stacks.",+ "canonical": {+ "path": "src/components/shared/EmptyState.tsx",+ "export": "EmptyState"+ },+ "requiredConsumers": [+ { "path": "src/components/Settings/AgentProfilesPanel.tsx" },+ { "path": "src/components/Settings/AuditWebhookPanel.tsx" },+ { "path": "src/components/Settings/AuditLogPanel.tsx" },+ { "path": "src/components/Settings/AvailabilitySettingsPanel.tsx" },+ { "path": "src/components/Settings/DiagnosticsResultsPanel.tsx" },+ { "path": "src/components/patrol/RunHistoryPanel.tsx" },+ { "path": "src/components/Settings/SSOProvidersPanel.tsx" }+ ],+ "forbiddenPatterns": [+ {+ "path": "src/components/Settings/AgentProfilesPanel.tsx",+ "patterns": ["text-center py-8 text-muted"]+ },+ {+ "path": "src/components/Settings/AuditWebhookPanel.tsx",+ "patterns": [+ "py-10 flex flex-col items-center justify-center text-muted border-2 border-dashed border-border rounded-md"+ ]+ },+ {+ "path": "src/components/Settings/AuditLogPanel.tsx",+ "patterns": [+ "text-center py-12 px-4 bg-surface-alt rounded-md border border-dashed border-border"+ ]+ },+ {+ "path": "src/components/Settings/AvailabilitySettingsPanel.tsx",+ "patterns": ["flex flex-col items-center justify-center gap-3 px-4 py-12 text-center"]+ },+ {+ "path": "src/components/Settings/DiagnosticsResultsPanel.tsx",+ "patterns": [+ "Activity class=\"mx-auto mb-4 h-12 w-12 text-muted\"",+ "inline-flex min-h-10 items-center gap-2 rounded-md bg-blue-600"+ ]+ },+ {+ "path": "src/components/patrol/RunHistoryPanel.tsx",+ "patterns": ["text-center py-8"]+ },+ {+ "path": "src/components/Settings/SSOProvidersPanel.tsx",+ "patterns": ["text-center py-8 text-muted"]+ }+ ],+ "proof": [+ "src/components/shared/EmptyState.test.tsx",+ "src/components/shared/SharedPrimitives.guardrails.test.ts",+ "scripts/shared-template-audit.mjs"+ ]+ },{"id": "action-icon-button-shell","category": "action-button",@@ -3221,6 +3281,71 @@"scripts/shared-template-audit.mjs"]},+ {+ "id": "settings-panel-local-centered-empty-state",+ "category": "empty-state",+ "summary": "Migrated settings panels must not recreate centered text/icon empty-state shells.",+ "canonical": {+ "path": "src/components/shared/EmptyState.tsx",+ "export": "EmptyState"+ },+ "scopes": [+ "src/components/Settings/AgentProfilesPanel.tsx",+ "src/components/Settings/SSOProvidersPanel.tsx"+ ],+ "extensions": [".tsx"],+ "allPatterns": ["text-center py-8 text-muted"],+ "legacyReason": "Retired migration debt. Embedded settings panel empty states must use EmptyState variant=\"panel\" instead of local centered icon/text stacks.",+ "allowedPaths": [],+ "ignoredPaths": [],+ "proof": [+ "src/components/shared/EmptyState.test.tsx",+ "src/components/shared/SharedPrimitives.guardrails.test.ts",+ "scripts/shared-template-audit.mjs"+ ]+ },+ {+ "id": "settings-panel-local-action-empty-state",+ "category": "empty-state",+ "summary": "Availability settings must not recreate the centered action empty-state shell.",+ "canonical": {+ "path": "src/components/shared/EmptyState.tsx",+ "export": "EmptyState"+ },+ "scopes": ["src/components/Settings/AvailabilitySettingsPanel.tsx"],+ "extensions": [".tsx"],+ "allPatterns": ["flex flex-col items-center justify-center gap-3 px-4 py-12 text-center"],+ "legacyReason": "Retired migration debt. Availability settings empty states must use EmptyState variant=\"panel\" with a Button action slot.",+ "allowedPaths": [],+ "ignoredPaths": [],+ "proof": [+ "src/components/shared/EmptyState.test.tsx",+ "src/components/shared/SharedPrimitives.guardrails.test.ts",+ "scripts/shared-template-audit.mjs"+ ]+ },+ {+ "id": "settings-panel-local-dashed-empty-state",+ "category": "empty-state",+ "summary": "Audit Log must not recreate a local dashed empty-state frame.",+ "canonical": {+ "path": "src/components/shared/EmptyState.tsx",+ "export": "EmptyState"+ },+ "scopes": ["src/components/Settings/AuditLogPanel.tsx"],+ "extensions": [".tsx"],+ "allPatterns": [+ "text-center py-12 px-4 bg-surface-alt rounded-md border border-dashed border-border"+ ],+ "legacyReason": "Retired migration debt. Audit Log empty states must use EmptyState so framed panel spacing, icon treatment, and action slots stay shared.",+ "allowedPaths": [],+ "ignoredPaths": [],+ "proof": [+ "src/components/shared/EmptyState.test.tsx",+ "src/components/shared/SharedPrimitives.guardrails.test.ts",+ "scripts/shared-template-audit.mjs"+ ]+ },{"id": "table-card-frame-local-wrapper","category": "table-card",diff --git a/frontend-modern/src/components/Settings/AgentProfilesPanel.tsx b/frontend-modern/src/components/Settings/AgentProfilesPanel.tsxindex d19bbdb911..fc1b4b5756 100644--- a/frontend-modern/src/components/Settings/AgentProfilesPanel.tsx+++ b/frontend-modern/src/components/Settings/AgentProfilesPanel.tsx@@ -1,6 +1,7 @@import { Component, For, Show } from 'solid-js';import { Button } from '@/components/shared/Button';import { Card } from '@/components/shared/Card';+import { EmptyState } from '@/components/shared/EmptyState';import SettingsPanel from '@/components/shared/SettingsPanel';import { Dialog } from '@/components/shared/Dialog';import { FormSelect } from '@/components/shared/FormSelect';@@ -147,19 +148,16 @@ export const AgentProfilesPanel: Component = () => {><Show when={loading()}><div class="flex items-center justify-center py-8">- <LoadingSpinner- size="xl"- tone="info"- label="Loading configuration profiles"- />+ <LoadingSpinner size="xl" tone="info" label="Loading configuration profiles" /></div></Show><Show when={!loading() && profiles().length === 0}>- <div class="text-center py-8 text-muted">- <Settings class="w-12 h-12 mx-auto mb-3 opacity-50" />- <p class="text-sm">{getAgentProfilesEmptyState()}</p>- </div>+ <EmptyState+ variant="panel"+ icon={<Settings class="h-5 w-5" />}+ title={getAgentProfilesEmptyState()}+ /></Show><Show when={!loading() && profiles().length > 0}>@@ -232,10 +230,11 @@ export const AgentProfilesPanel: Component = () => {bodyClass="divide-y divide-border"><Show when={connectedAgents().length === 0}>- <div class="text-center py-8 text-muted">- <Users class="w-12 h-12 mx-auto mb-3 opacity-50" />- <p class="text-sm">{getAgentProfileAssignmentsEmptyState()}</p>- </div>+ <EmptyState+ variant="panel"+ icon={<Users class="h-5 w-5" />}+ title={getAgentProfileAssignmentsEmptyState()}+ /></Show><Show when={connectedAgents().length > 0}>diff --git a/frontend-modern/src/components/Settings/AuditLogPanel.tsx b/frontend-modern/src/components/Settings/AuditLogPanel.tsxindex ca59e5410e..01355d7d73 100644--- a/frontend-modern/src/components/Settings/AuditLogPanel.tsx+++ b/frontend-modern/src/components/Settings/AuditLogPanel.tsx@@ -4,6 +4,8 @@ import RefreshCw from 'lucide-solid/icons/refresh-cw';import Info from 'lucide-solid/icons/info';import Play from 'lucide-solid/icons/play';import ShieldAlert from 'lucide-solid/icons/shield-alert';+import { Button } from '@/components/shared/Button';+import { EmptyState } from '@/components/shared/EmptyState';import { showTooltip, hideTooltip } from '@/components/shared/Tooltip';import { UpgradeButtonLink } from '@/components/shared/UpgradeLink';import { FilterBar, type FilterDef, type FilterSelectOption } from '@/components/shared/FilterBar';@@ -466,30 +468,22 @@ export default function AuditLogPanel() {</Show><Show when={!loading() && isPersistent() && filteredEvents().length === 0}>- <div class="text-center py-12 px-4 bg-surface-alt rounded-md border border-dashed border-border">- <div class="flex flex-col items-center max-w-sm mx-auto">- <Show- when={activeFilterCount() > 0}- fallback={<Shield class="w-12 h-12 text-slate-300 mb-4" />}- >- <ShieldAlert class="w-12 h-12 text-blue-300 dark:text-blue-900 mb-4" />- </Show>- <h3 class="text-lg font-medium text-base-content">- {getAuditLogEmptyState(activeFilterCount()).title}- </h3>- <p class="mt-2 text-sm text-muted">- {getAuditLogEmptyState(activeFilterCount()).description}- </p>- <Show when={activeFilterCount() > 0}>- <button- onClick={clearFilters}- class="mt-6 px-4 py-2 text-sm font-medium text-blue-600 dark:text-blue-400 border border-blue-200 dark:border-blue-800 rounded-md hover:bg-blue-50 dark:hover:bg-blue-900"- >+ <EmptyState+ variant="panel"+ icon={+ activeFilterCount() > 0 ? <ShieldAlert class="h-5 w-5" /> : <Shield class="h-5 w-5" />+ }+ title={getAuditLogEmptyState(activeFilterCount()).title}+ description={getAuditLogEmptyState(activeFilterCount()).description}+ tone={activeFilterCount() > 0 ? 'info' : 'default'}+ actions={+ activeFilterCount() > 0 ? (+ <Button type="button" variant="info" size="mdCompact" onClick={clearFilters}>Clear all filters- </button>- </Show>- </div>- </div>+ </Button>+ ) : undefined+ }+ /></Show><Show when={!loading() && isPersistent()}>diff --git a/frontend-modern/src/components/Settings/AuditWebhookPanel.tsx b/frontend-modern/src/components/Settings/AuditWebhookPanel.tsxindex 7a64c07281..333c1e6ca8 100644--- a/frontend-modern/src/components/Settings/AuditWebhookPanel.tsx+++ b/frontend-modern/src/components/Settings/AuditWebhookPanel.tsx@@ -6,6 +6,7 @@ import Trash2 from 'lucide-solid/icons/trash-2';import ExternalLink from 'lucide-solid/icons/external-link';import { Card } from '@/components/shared/Card';import { Dialog } from '@/components/shared/Dialog';+import { EmptyState } from '@/components/shared/EmptyState';import { FeatureGateSection } from '@/components/shared/FeatureGateSection';import SettingsPanel from '@/components/shared/SettingsPanel';import { formControl } from '@/components/shared/Form';@@ -71,11 +72,7 @@ export const AuditWebhookPanel: Component<AuditWebhookPanelProps> = (props) => {return (<div class="space-y-6">- <SettingsPanel- title="Audit Webhooks"- noPadding- bodyClass="divide-y divide-border"- >+ <SettingsPanel title="Audit Webhooks" noPadding bodyClass="divide-y divide-border"><div class="space-y-6 p-4 sm:p-6"><Show when={!canManage()}><div class={AUDIT_WEBHOOK_READONLY_NOTICE_CLASS}>@@ -117,10 +114,11 @@ export const AuditWebhookPanel: Component<AuditWebhookPanelProps> = (props) => {</For><Show when={webhookUrls().length === 0}>- <div class="py-10 flex flex-col items-center justify-center text-muted border-2 border-dashed border-border rounded-md">- <Globe size={36} class="opacity-40 mb-3" />- <p class="text-sm">{emptyStateCopy().title}</p>- </div>+ <EmptyState+ variant="panel"+ icon={<Globe class="h-5 w-5" />}+ title={emptyStateCopy().title}+ /></Show></div></Show>@@ -176,8 +174,8 @@ export const AuditWebhookPanel: Component<AuditWebhookPanelProps> = (props) => {<p class="text-sm text-muted mb-4">This stops audit events from being delivered to{' '}<span class="font-medium text-base-content break-all">{urlToRemove()}</span>. Any- external receiver using this URL will stop receiving Pulse audit traffic. You can- add the URL back later if needed.+ external receiver using this URL will stop receiving Pulse audit traffic. You can add+ the URL back later if needed.</p><div class="flex justify-end gap-3"><buttondiff --git a/frontend-modern/src/components/Settings/AvailabilitySettingsPanel.tsx b/frontend-modern/src/components/Settings/AvailabilitySettingsPanel.tsxindex ceded7f79b..b5a736d5a7 100644--- a/frontend-modern/src/components/Settings/AvailabilitySettingsPanel.tsx+++ b/frontend-modern/src/components/Settings/AvailabilitySettingsPanel.tsx@@ -13,6 +13,7 @@ import RotateCw from 'lucide-solid/icons/rotate-cw';import Activity from 'lucide-solid/icons/activity';import X from 'lucide-solid/icons/x';import { Button } from '@/components/shared/Button';+import { EmptyState } from '@/components/shared/EmptyState';import SettingsPanel from '@/components/shared/SettingsPanel';import { Dialog } from '@/components/shared/Dialog';import {@@ -236,30 +237,24 @@ export const AvailabilitySettingsPanel: Component = () => {<Showwhen={sortedTargets().length > 0}fallback={- <div class="flex flex-col items-center justify-center gap-3 px-4 py-12 text-center">- <div class="flex h-11 w-11 items-center justify-center rounded-md border border-border bg-surface-alt text-muted">- <Activity class="h-5 w-5" />- </div>- <div class="space-y-1">- <div class="text-sm font-semibold text-base-content">- No availability checks yet- </div>- <p class="max-w-xl text-sm leading-6 text-muted">- Add a ping, TCP port, MQTT broker, ESPHome device, HTTP health check, or another- endpoint that only needs reachability monitoring.- </p>- </div>- <Button- type="button"- variant="primary"- size="mdCompact"- class="min-h-9 gap-2"- onClick={() => openAddDialog('service')}- >- <Plus class="h-4 w-4" />- Add service/device check- </Button>- </div>+ <EmptyState+ variant="panel"+ icon={<Activity class="h-5 w-5" />}+ title="No availability checks yet"+ description="Add a ping, TCP port, MQTT broker, ESPHome device, HTTP health check, or another endpoint that only needs reachability monitoring."+ actions={+ <Button+ type="button"+ variant="primary"+ size="mdCompact"+ class="min-h-9 gap-2"+ onClick={() => openAddDialog('service')}+ >+ <Plus class="h-4 w-4" />+ Add service/device check+ </Button>+ }+ />}><For each={sortedTargets()}>diff --git a/frontend-modern/src/components/Settings/DiagnosticsResultsPanel.tsx b/frontend-modern/src/components/Settings/DiagnosticsResultsPanel.tsxindex d14dd2e525..a1cd6d1eda 100644--- a/frontend-modern/src/components/Settings/DiagnosticsResultsPanel.tsx+++ b/frontend-modern/src/components/Settings/DiagnosticsResultsPanel.tsx@@ -15,6 +15,8 @@ import Server from 'lucide-solid/icons/server';import Shield from 'lucide-solid/icons/shield';import Sparkles from 'lucide-solid/icons/sparkles';import XCircle from 'lucide-solid/icons/x-circle';+import { Button } from '@/components/shared/Button';+import { EmptyState } from '@/components/shared/EmptyState';import { StatusIndicatorBadge } from '@/components/shared/StatusIndicatorBadge';import { getSemanticTonePresentation } from '@/utils/semanticTonePresentation';import {@@ -72,23 +74,26 @@ export const DiagnosticsResultsPanel: Component<DiagnosticsResultsPanelProps> =<Showwhen={props.diagnosticsData}fallback={- <Card padding="lg" class="text-center">- <div class="py-12">- <Activity class="mx-auto mb-4 h-12 w-12 text-muted" />- <h3 class="mb-2 text-lg font-medium text-base-content">- {DIAGNOSTICS_EMPTY_STATE_COPY.title}- </h3>- <p class="mb-6 text-sm text-muted">{DIAGNOSTICS_EMPTY_STATE_COPY.description}</p>- <button- type="button"- onClick={props.onRunDiagnostics}- disabled={props.loading}- class="inline-flex min-h-10 items-center gap-2 rounded-md bg-blue-600 px-5 py-2.5 text-sm font-medium text-white transition-colors hover:bg-blue-700 disabled:opacity-50 sm:min-h-9"- >- <RefreshCw class={`h-4 w-4 ${props.loading ? 'animate-spin' : ''}`} />- {DIAGNOSTICS_EMPTY_STATE_COPY.actionLabel}- </button>- </div>+ <Card padding="lg">+ <EmptyState+ variant="panel"+ icon={<Activity class="h-5 w-5" />}+ title={DIAGNOSTICS_EMPTY_STATE_COPY.title}+ description={DIAGNOSTICS_EMPTY_STATE_COPY.description}+ actions={+ <Button+ type="button"+ variant="primary"+ size="settingsAction"+ class="gap-2"+ onClick={props.onRunDiagnostics}+ disabled={props.loading}+ >+ <RefreshCw class={`h-4 w-4 ${props.loading ? 'animate-spin' : ''}`} />+ {DIAGNOSTICS_EMPTY_STATE_COPY.actionLabel}+ </Button>+ }+ /></Card>}>@@ -448,7 +453,7 @@ export const DiagnosticsResultsPanel: Component<DiagnosticsResultsPanelProps> =? 'Running': props.diagnosticsData?.aiChat?.enabled? 'Stopped'- : 'Disabled'+ : 'Disabled'}dotuppercasediff --git a/frontend-modern/src/components/Settings/SSOProvidersPanel.tsx b/frontend-modern/src/components/Settings/SSOProvidersPanel.tsxindex 0545c39112..d7e9b35528 100644--- a/frontend-modern/src/components/Settings/SSOProvidersPanel.tsx+++ b/frontend-modern/src/components/Settings/SSOProvidersPanel.tsx@@ -1,4 +1,5 @@import { Component, For, Show } from 'solid-js';+import { EmptyState } from '@/components/shared/EmptyState';import SettingsPanel from '@/components/shared/SettingsPanel';import { Toggle } from '@/components/shared/Toggle';import { formField, labelClass, controlClass, formHelpText } from '@/components/shared/Form';@@ -115,11 +116,12 @@ export const SSOProvidersPanel: Component<SSOProvidersPanelProps> = (props) => {</Show><Show when={!loading() && providers().length === 0}>- <div class="text-center py-8 text-muted">- <Shield class="w-12 h-12 mx-auto mb-3 opacity-40" />- <p class="text-sm">{getSSOProviderEmptyStateTitle()}</p>- <p class="text-xs mt-1">{getSSOProviderEmptyStateDescription()}</p>- </div>+ <EmptyState+ variant="panel"+ icon={<Shield class="h-5 w-5" />}+ title={getSSOProviderEmptyStateTitle()}+ description={getSSOProviderEmptyStateDescription()}+ /></Show><Show when={!loading() && providers().length > 0}>diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.tsindex bebc74467f..9793e6819b 100644--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts@@ -426,6 +426,43 @@ describe('settings architecture guardrails', () => {}});+ it('keeps embedded settings panel empty states on the shared primitive', () => {+ const panelEmptyStateConsumers = [+ agentProfilesPanelSource,+ auditWebhookPanelSource,+ auditLogPanelSource,+ availabilitySettingsPanelSource,+ diagnosticsResultsPanelSource,+ ssoProvidersPanelSource,+ ];++ for (const source of panelEmptyStateConsumers) {+ expect(source).toContain('@/components/shared/EmptyState');+ expect(source).toContain('<EmptyState');+ }++ expect(agentProfilesPanelSource.match(/variant="panel"/g) ?? []).toHaveLength(2);+ expect(auditWebhookPanelSource).toContain('variant="panel"');+ expect(auditLogPanelSource).toContain('variant="panel"');+ expect(availabilitySettingsPanelSource).toContain('variant="panel"');+ expect(diagnosticsResultsPanelSource).toContain('variant="panel"');+ expect(ssoProvidersPanelSource).toContain('variant="panel"');+ expect(agentProfilesPanelSource).not.toContain('text-center py-8 text-muted');+ expect(auditWebhookPanelSource).not.toContain(+ 'py-10 flex flex-col items-center justify-center text-muted border-2 border-dashed border-border rounded-md',+ );+ expect(auditLogPanelSource).not.toContain(+ 'text-center py-12 px-4 bg-surface-alt rounded-md border border-dashed border-border',+ );+ expect(availabilitySettingsPanelSource).not.toContain(+ 'flex flex-col items-center justify-center gap-3 px-4 py-12 text-center',+ );+ expect(diagnosticsResultsPanelSource).not.toContain(+ 'inline-flex min-h-10 items-center gap-2 rounded-md bg-blue-600',+ );+ expect(ssoProvidersPanelSource).not.toContain('text-center py-8 text-muted');+ });+it('keeps telemetry disclosure aligned with the security privacy contract', () => {expect(generalSettingsPanelSource).toContain('aggregate self-hosted adoption');expect(generalSettingsPanelSource).toContain('counts, and coarse feature flags');diff --git a/frontend-modern/src/components/patrol/RunHistoryPanel.tsx b/frontend-modern/src/components/patrol/RunHistoryPanel.tsxindex 54dc7f1772..b9f57557cb 100644--- a/frontend-modern/src/components/patrol/RunHistoryPanel.tsx+++ b/frontend-modern/src/components/patrol/RunHistoryPanel.tsx@@ -1,6 +1,7 @@import { For, Show } from 'solid-js';import type { Accessor } from 'solid-js';import type { PatrolRunRecord } from '@/api/patrol';+import { EmptyState } from '@/components/shared/EmptyState';import { getRunHistoryEmptyState } from '@/utils/patrolEmptyStatePresentation';import {getRunHistoryLoadingState,@@ -58,10 +59,11 @@ export function RunHistoryPanel(props: RunHistoryPanelProps) {</Show><Show when={!props.loading && props.runs.length === 0}>- <div class="text-center py-8">- <RefreshCwIcon class="w-12 h-12 mx-auto text-slate-300 mb-3" />- <p class="text-sm text-muted">{getRunHistoryEmptyState().text}</p>- </div>+ <EmptyState+ variant="panel"+ icon={<RefreshCwIcon class="h-5 w-5" />}+ title={getRunHistoryEmptyState().text}+ /></Show><Show when={!props.loading && props.runs.length > 0}>diff --git a/frontend-modern/src/components/shared/EmptyState.test.tsx b/frontend-modern/src/components/shared/EmptyState.test.tsxnew file mode 100644index 0000000000..442d4a459a--- /dev/null+++ b/frontend-modern/src/components/shared/EmptyState.test.tsx@@ -0,0 +1,53 @@+import { cleanup, render, screen } from '@solidjs/testing-library';+import { afterEach, describe, expect, it } from 'vitest';+import { Button } from './Button';+import { EmptyState } from './EmptyState';++describe('EmptyState', () => {+ afterEach(() => {+ cleanup();+ });++ it('renders the default framed empty-state shell', () => {+ render(() => (+ <EmptyState+ icon={<span data-testid="empty-icon">i</span>}+ title="No rows"+ description="There is nothing to show yet."+ />+ ));++ const shell = screen.getByText('No rows').closest('div');+ expect(screen.getByTestId('empty-icon')).toBeInTheDocument();+ expect(shell?.className).toContain('border-dashed');+ expect(shell?.className).toContain('sm:py-16');+ });++ it('renders compact panel empty states without the framed table shell', () => {+ render(() => (+ <EmptyState+ variant="panel"+ icon={<span data-testid="panel-icon">p</span>}+ title="No providers"+ description="Add a provider to continue."+ actions={<Button size="mdCompact">Add provider</Button>}+ />+ ));++ const shell = screen.getByText('No providers').closest('div');+ expect(screen.getByTestId('panel-icon')).toBeInTheDocument();+ expect(screen.getByText('No providers').className).toContain('text-sm');+ expect(screen.getByText('Add a provider to continue.').className).toContain('max-w-xl');+ expect(shell?.className).toContain('py-8');+ expect(shell?.className).not.toContain('border-dashed');+ expect(screen.getByRole('button', { name: 'Add provider' })).toBeInTheDocument();+ });++ it('supports left-aligned panel empty states', () => {+ render(() => <EmptyState variant="panel" align="left" title="No matches" />);++ const shell = screen.getByText('No matches').closest('div');+ expect(shell?.className).toContain('items-start');+ expect(shell?.className).toContain('text-left');+ });+});diff --git a/frontend-modern/src/components/shared/EmptyState.tsx b/frontend-modern/src/components/shared/EmptyState.tsxindex e0ce6164ac..10aa30da90 100644--- a/frontend-modern/src/components/shared/EmptyState.tsx+++ b/frontend-modern/src/components/shared/EmptyState.tsx@@ -8,10 +8,14 @@ type EmptyStateProps = {actions?: JSX.Element;tone?: EmptyStateTone;align?: 'center' | 'left';+ variant?: 'framed' | 'panel';} & JSX.HTMLAttributes<HTMLDivElement>;export function EmptyState(props: EmptyStateProps) {- const merged = mergeProps({ tone: 'default' as EmptyStateTone, align: 'center' as const }, props);+ const merged = mergeProps(+ { tone: 'default' as EmptyStateTone, align: 'center' as const, variant: 'framed' as const },+ props,+ );const [local, others] = splitProps(merged, ['icon','title',@@ -19,41 +23,50 @@ export function EmptyState(props: EmptyStateProps) {'actions','tone','align',+ 'variant','class',]);const alignment = local.align;const tone = local.tone;+ const variant = local.variant;const presentation = getEmptyStatePresentation(tone);const containerClass = [- 'flex flex-col py-10 px-6 sm:py-16 sm:px-8 w-full animate-fade-in',- 'bg-base border border-dashed border-border rounded-md',+ 'flex w-full animate-fade-in flex-col',+ variant === 'framed'+ ? 'rounded-md border border-dashed border-border bg-base px-6 py-10 sm:px-8 sm:py-16'+ : 'px-4 py-8',alignment === 'center' ? 'items-center text-center' : 'items-start text-left',local.class ?? '',].join(' ').trim();+ const iconClass =+ variant === 'framed'+ ? `mb-6 flex h-16 w-16 items-center justify-center rounded-md sm:h-20 sm:w-20 ${presentation.iconClass}`+ : `mb-3 flex h-12 w-12 items-center justify-center rounded-md ${presentation.iconClass}`;+ const iconInnerClass = variant === 'framed' ? 'scale-125' : '';+ const titleClass =+ variant === 'framed'+ ? `mb-2 text-lg font-bold tracking-tight sm:text-xl ${presentation.titleClass}`+ : `mb-1 text-sm font-semibold ${presentation.titleClass}`;+ const descriptionClass =+ variant === 'framed'+ ? `mb-6 max-w-sm text-sm leading-relaxed sm:max-w-md ${presentation.descriptionClass}`+ : `mb-4 max-w-xl text-sm leading-6 ${presentation.descriptionClass}`;return (<div class={containerClass} {...others}><Show when={local.icon}>- <div- class={`w-16 h-16 sm:w-20 sm:h-20 mb-6 rounded-md flex items-center justify-center ${presentation.iconClass}`}- >- <div class="scale-125">{local.icon}</div>+ <div class={iconClass}>+ <div class={iconInnerClass}>{local.icon}</div></div></Show>- <h3 class={`text-lg sm:text-xl font-bold tracking-tight mb-2 ${presentation.titleClass}`}>- {local.title}- </h3>+ <h3 class={titleClass}>{local.title}</h3><Show when={local.description}>- <p- class={`text-sm max-w-sm sm:max-w-md ${presentation.descriptionClass} mb-6 leading-relaxed`}- >- {local.description}- </p>+ <p class={descriptionClass}>{local.description}</p></Show><Show when={local.actions}>diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.tsindex 01ef20c14e..419d630579 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 emptyStateSource from '@/components/shared/EmptyState.tsx?raw';import inlineNoticeSource from '@/components/shared/InlineNotice.tsx?raw';import demoBannerSource from '@/components/DemoBanner.tsx?raw';import commercialMigrationBannerSource from '@/components/CommercialMigrationBanner.tsx?raw';@@ -235,6 +236,7 @@ import agentIntegrationsPanelSource from '@/components/Settings/AgentIntegrationimport apiAccessPanelSource from '@/components/Settings/APIAccessPanel.tsx?raw';import agentProfilesPanelSource from '@/components/Settings/AgentProfilesPanel.tsx?raw';import apiTokenManagerSource from '@/components/Settings/APITokenManager.tsx?raw';+import auditWebhookPanelSource from '@/components/Settings/AuditWebhookPanel.tsx?raw';import auditLogPanelSource from '@/components/Settings/AuditLogPanel.tsx?raw';import billingAdminPanelSource from '@/components/Settings/BillingAdminPanel.tsx?raw';import diagnosticsResultsPanelSource from '@/components/Settings/DiagnosticsResultsPanel.tsx?raw';@@ -274,6 +276,7 @@ import approvalBannerSource from '@/components/patrol/ApprovalBanner.tsx?raw';import approvalSectionSource from '@/components/patrol/ApprovalSection.tsx?raw';import investigationMessagesSource from '@/components/patrol/InvestigationMessages.tsx?raw';import investigationSectionSource from '@/components/patrol/InvestigationSection.tsx?raw';+import runHistoryPanelSource from '@/components/patrol/RunHistoryPanel.tsx?raw';import runHistoryEntrySource from '@/components/patrol/RunHistoryEntry.tsx?raw';import runToolCallTraceSource from '@/components/patrol/RunToolCallTrace.tsx?raw';import patrolStatusBarSource from '@/components/patrol/PatrolStatusBar.tsx?raw';@@ -4408,6 +4411,134 @@ describe('shared primitive guardrails', () => {}});+ it('keeps embedded panel empty states on the shared EmptyState primitive', () => {+ 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 };+ allPatterns?: string[];+ scopes?: string[];+ extensions?: string[];+ allowedPaths?: string[];+ ignoredPaths?: string[];+ }>;+ };+ const registeredRule = registry.rules?.find((rule) => rule.id === 'panel-empty-state-shell');+ const centeredGuard = registry.patternGuards?.find(+ (guard) => guard.id === 'settings-panel-local-centered-empty-state',+ );+ const actionGuard = registry.patternGuards?.find(+ (guard) => guard.id === 'settings-panel-local-action-empty-state',+ );+ const dashedGuard = registry.patternGuards?.find(+ (guard) => guard.id === 'settings-panel-local-dashed-empty-state',+ );+ const consumers: Array<[string, string]> = [+ ['src/components/Settings/AgentProfilesPanel.tsx', agentProfilesPanelSource],+ ['src/components/Settings/AuditWebhookPanel.tsx', auditWebhookPanelSource],+ ['src/components/Settings/AuditLogPanel.tsx', auditLogPanelSource],+ ['src/components/Settings/AvailabilitySettingsPanel.tsx', availabilitySettingsPanelSource],+ ['src/components/Settings/DiagnosticsResultsPanel.tsx', diagnosticsResultsPanelSource],+ ['src/components/patrol/RunHistoryPanel.tsx', runHistoryPanelSource],+ ['src/components/Settings/SSOProvidersPanel.tsx', ssoProvidersPanelSource],+ ];+ const consumerPaths = consumers.map(([path]) => path);++ expect(registeredRule?.canonical?.path).toBe('src/components/shared/EmptyState.tsx');+ expect(registeredRule?.canonical?.export).toBe('EmptyState');+ expect(registeredRule?.requiredConsumers?.map((consumer) => consumer.path)).toEqual(+ consumerPaths,+ );+ expect(registeredRule?.forbiddenPatterns).toEqual([+ {+ path: 'src/components/Settings/AgentProfilesPanel.tsx',+ patterns: ['text-center py-8 text-muted'],+ },+ {+ path: 'src/components/Settings/AuditWebhookPanel.tsx',+ patterns: [+ 'py-10 flex flex-col items-center justify-center text-muted border-2 border-dashed border-border rounded-md',+ ],+ },+ {+ path: 'src/components/Settings/AuditLogPanel.tsx',+ patterns: [+ 'text-center py-12 px-4 bg-surface-alt rounded-md border border-dashed border-border',+ ],+ },+ {+ path: 'src/components/Settings/AvailabilitySettingsPanel.tsx',+ patterns: ['flex flex-col items-center justify-center gap-3 px-4 py-12 text-center'],+ },+ {+ path: 'src/components/Settings/DiagnosticsResultsPanel.tsx',+ patterns: [+ 'Activity class="mx-auto mb-4 h-12 w-12 text-muted"',+ 'inline-flex min-h-10 items-center gap-2 rounded-md bg-blue-600',+ ],+ },+ {+ path: 'src/components/patrol/RunHistoryPanel.tsx',+ patterns: ['text-center py-8'],+ },+ {+ path: 'src/components/Settings/SSOProvidersPanel.tsx',+ patterns: ['text-center py-8 text-muted'],+ },+ ]);+ expect(centeredGuard?.canonical?.export).toBe('EmptyState');+ expect(centeredGuard?.scopes).toEqual([+ 'src/components/Settings/AgentProfilesPanel.tsx',+ 'src/components/Settings/SSOProvidersPanel.tsx',+ ]);+ expect(centeredGuard?.extensions).toEqual(['.tsx']);+ expect(centeredGuard?.allPatterns).toEqual(['text-center py-8 text-muted']);+ expect(actionGuard?.canonical?.export).toBe('EmptyState');+ expect(actionGuard?.scopes).toEqual(['src/components/Settings/AvailabilitySettingsPanel.tsx']);+ expect(actionGuard?.allPatterns).toEqual([+ 'flex flex-col items-center justify-center gap-3 px-4 py-12 text-center',+ ]);+ expect(dashedGuard?.canonical?.export).toBe('EmptyState');+ expect(dashedGuard?.scopes).toEqual(['src/components/Settings/AuditLogPanel.tsx']);+ expect(dashedGuard?.allPatterns).toEqual([+ 'text-center py-12 px-4 bg-surface-alt rounded-md border border-dashed border-border',+ ]);+ for (const guard of [centeredGuard, actionGuard, dashedGuard]) {+ expect(guard?.allowedPaths ?? []).toHaveLength(0);+ expect(guard?.ignoredPaths ?? []).toHaveLength(0);+ }++ expect(emptyStateSource).toContain("variant: 'framed'");+ expect(emptyStateSource).toContain("variant === 'framed'");+ expect(emptyStateSource).toContain("'px-4 py-8'");++ for (const [path, source] of consumers) {+ expect(source).toContain('@/components/shared/EmptyState');+ expect(source).toContain('<EmptyState');+ const forbiddenPatterns =+ registeredRule?.forbiddenPatterns?.find((entry) => entry.path === path)?.patterns ?? [];+ for (const pattern of forbiddenPatterns) {+ expect(source).not.toContain(pattern);+ }+ }+ expect(availabilitySettingsPanelSource).toContain('variant="panel"');+ expect(agentProfilesPanelSource.match(/variant="panel"/g) ?? []).toHaveLength(2);+ expect(auditWebhookPanelSource).toContain('variant="panel"');+ expect(diagnosticsResultsPanelSource).toContain('variant="panel"');+ expect(runHistoryPanelSource).toContain('variant="panel"');+ expect(ssoProvidersPanelSource).toContain('variant="panel"');+ expect(auditLogPanelSource).toContain('<EmptyState');+ expect(auditLogPanelSource).toContain('variant="panel"');+ expect(auditLogPanelSource).toContain('tone={activeFilterCount() > 0 ?');+ expect(auditLogPanelSource).not.toContain('Clear all filters</button>');+ });+it('keeps platform table loading states on the shared status-row template', () => {const registry = JSON.parse(sharedTemplateRegistrySource) as {rules?: Array<{diff --git a/frontend-modern/src/utils/__tests__/patrolEmptyStatePresentation.test.ts b/frontend-modern/src/utils/__tests__/patrolEmptyStatePresentation.test.tsindex 0e95ef9d95..69db702b98 100644--- a/frontend-modern/src/utils/__tests__/patrolEmptyStatePresentation.test.ts+++ b/frontend-modern/src/utils/__tests__/patrolEmptyStatePresentation.test.ts@@ -1,4 +1,5 @@import { describe, expect, it } from 'vitest';+import runHistoryPanelSource from '@/components/patrol/RunHistoryPanel.tsx?raw';import {getInvestigationMessagesState,getInvestigationSectionState,@@ -22,6 +23,9 @@ describe('patrolEmptyStatePresentation', () => {expect(getRunHistoryEmptyState()).toEqual({text: 'No patrol runs yet. Trigger a run to populate history.',});+ expect(runHistoryPanelSource).toContain('@/components/shared/EmptyState');+ expect(runHistoryPanelSource).toContain('variant="panel"');+ expect(runHistoryPanelSource).not.toContain('text-center py-8');});it('returns investigation section loading and empty states', () => {@@ -96,7 +100,8 @@ describe('patrolEmptyStatePresentation', () => {getPatrolFindingsEmptyState({filter: 'active',runtimeState: 'blocked',- blockedReason: 'Quickstart credits exhausted. Connect your API key to continue using Patrol.',+ blockedReason:+ 'Quickstart credits exhausted. Connect your API key to continue using Patrol.',}),).toEqual({title: 'Patrol paused',