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.

Converge settings callouts on shared primitive

rcourtmanffb80c805bf2
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 86b5d2ee97..8f1e32a046 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -235,6 +235,10 @@ boundary: lifecycle UI may consume unified-resource capabilities for enabled or
disabled presentation, but execution must stay inside the API-owned action
executor wired from `internal/api/router.go` and must not shell out, SSH, or call
Docker / Podman from lifecycle-local code.
+Disconnected command-agent state is also API-owned readiness: lifecycle
+surfaces may reflect missing backend-advertised capabilities, but must not
+reconnect, substitute, or directly address an agent to make a stale container
+action executable.
Assistant session rename through `PATCH /api/ai/sessions/{id}` follows that
same browser-safe history boundary. Lifecycle surfaces, MCP adapters, and
agents may display the updated title as human navigation metadata, but they
@@ -453,6 +457,11 @@ custom subnet selection a full-row operator control, not a narrow or hidden
input target; common subnet chips and the custom subnet field must share the
same environment-override and in-flight-save lock semantics as the scan-scope
selector.
+The discovery settings safety notice may use the frontend-primitives-owned
+`CalloutCard` shell, but the lifecycle contract still owns the operator-facing
+scan-scope semantics: environment overrides, immediate persistence, automatic
+interface scan breadth, and custom-subnet guidance must remain visible before
+the selector rather than becoming feature-local styling copy.
Adjacent Assistant resource-context handling in `internal/api/ai_handler.go`
may reference agent-backed resources only as selected-resource, model-only
context. It must not mutate agent lifecycle state, start agent discovery, or
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index aaa98c61bd..8525729d0e 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -1285,17 +1285,20 @@ not a replacement status card, CTA band, or page-local nested card.
capabilities before secondary billing or recovery detail so paid upgrades
can confirm their entitlement immediately after activation without making
default Community look like it is missing an activation key.
-7. Keep hosted settings-shell framing imports safe for bundle initialization.
+7. When settings surfaces need informational, warning, success, or danger
+ callouts, compose `frontend-modern/src/components/shared/CalloutCard.tsx`
+ and register the consumer in
+ `frontend-modern/scripts/shared-template-registry.json` instead of adding
+ feature-local colored panel shells. Compact settings notices must use the
+ shared `scale="compact"` density and keep proof in both
+ `frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts`
+ and
+ `frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts`.
+8. Keep hosted settings-shell framing imports safe for bundle initialization.
Self-hosted billing titles, descriptions, and referral copy used by
`settingsHeaderMeta.ts`, `settingsNavCatalog.ts`, and adjacent settings
shells must flow through
`frontend-modern/src/components/Settings/selfHostedBillingPresentation.ts`
-8. Keep shared settings-shell AI control copy capability-scoped rather than
- upsell-scoped. `AIRuntimeControlsSection.tsx` may describe read-only,
- approval-required, and autonomous action posture, but option labels and
- helper text must avoid tier labels or broad "executes everything" wording;
- paid capability availability belongs to entitlement-backed visibility and
- lock state, not local select copy.
instead of importing generic commercial presentation helpers directly into
hosted settings route shells.
Contextual settings feature gates must use capability-owned presentation
@@ -1303,7 +1306,13 @@ not a replacement status card, CTA band, or page-local nested card.
badge titles, Pro-suffixed option labels, monitored-system limit claims, or
browser-local commercial/onboarding metrics wrappers in SSO, audit,
reporting, AI controls, agent profiles, or shared warning banners.
-8. Keep first-session dashboard empty-state copy on
+9. Keep shared settings-shell AI control copy capability-scoped rather than
+ upsell-scoped. `AIRuntimeControlsSection.tsx` may describe read-only,
+ approval-required, and autonomous action posture, but option labels and
+ helper text must avoid tier labels or broad "executes everything" wording;
+ paid capability availability belongs to entitlement-backed visibility and
+ lock state, not local select copy.
+10. Keep first-session dashboard empty-state copy on
`frontend-modern/src/utils/workloadEmptyStatePresentation.ts`, and make
infrastructure setup guidance name the canonical destination explicitly
instead of falling back to generic settings CTA labels.
@@ -3126,9 +3135,12 @@ Selectable settings cards for compact provider pickers and detail choice panels
must now route through the shared `SelectionCardGroup` primitive instead of
duplicating border-2 active-card styling in feature components.
-Settings informational callouts with icon-plus-copy layouts must now route
-through the shared `CalloutCard` primitive instead of maintaining feature-local
-blue bordered wrappers.
+Settings informational, warning, success, and danger callouts with icon-plus-copy
+layouts must now route through the shared `CalloutCard` primitive instead of
+maintaining feature-local colored bordered wrappers. The primitive owns the tone
+palette and the `scale="compact"` density used by smaller settings notices, and
+the `settings-callout-card-shell` shared-template registry rule requires current
+settings consumers to compose it instead of reintroducing local panel shells.
Alert incident-event filter containers, labels, and chips must now route
through the shared presentation helpers in
diff --git a/frontend-modern/scripts/shared-template-registry.json b/frontend-modern/scripts/shared-template-registry.json
index 97cec6956a..b4f177cf4b 100644
--- a/frontend-modern/scripts/shared-template-registry.json
+++ b/frontend-modern/scripts/shared-template-registry.json
@@ -203,6 +203,53 @@
"scripts/shared-template-audit.mjs"
]
},
+ {
+ "id": "settings-callout-card-shell",
+ "category": "callout",
+ "summary": "Settings informational, warning, success, and danger callouts must compose CalloutCard for shared tone, density, icon, and copy layout instead of recreating local colored panel shells.",
+ "canonical": {
+ "path": "src/components/shared/CalloutCard.tsx",
+ "export": "CalloutCard"
+ },
+ "requiredConsumers": [
+ { "path": "src/components/Settings/AIProviderConfigurationSection.tsx" },
+ { "path": "src/components/Settings/ConnectionEditor/CredentialSlots/VMwareCredentialSlot.tsx" },
+ { "path": "src/components/Settings/DiagnosticsResultsPanel.tsx" },
+ { "path": "src/components/Settings/DiscoverySettingsForm.tsx" },
+ { "path": "src/components/Settings/MonitoredSystemImpactPreview.tsx" },
+ { "path": "src/components/Settings/ReportingPanel.tsx" },
+ { "path": "src/components/Settings/SecurityAuthPanel.tsx" },
+ { "path": "src/components/Settings/SecurityOverviewPanel.tsx" }
+ ],
+ "forbiddenPatterns": [
+ {
+ "path": "src/components/Settings/AIProviderConfigurationSection.tsx",
+ "patterns": [
+ "rounded border border-red-200",
+ "bg-red-50 dark:bg-red-900 px-2 py-1.5"
+ ]
+ },
+ {
+ "path": "src/components/Settings/DiagnosticsResultsPanel.tsx",
+ "patterns": [
+ "rounded-md border border-amber-200 bg-amber-50",
+ "rounded-md border border-red-200 bg-red-50"
+ ]
+ },
+ {
+ "path": "src/components/Settings/DiscoverySettingsForm.tsx",
+ "patterns": [
+ "rounded-md border border-amber-200 bg-amber-50/80",
+ "text-amber-900 dark:text-amber-100"
+ ]
+ }
+ ],
+ "proof": [
+ "src/components/shared/SharedPrimitives.guardrails.test.ts",
+ "src/components/shared/CalloutCard.test.tsx",
+ "scripts/shared-template-audit.mjs"
+ ]
+ },
{
"id": "status-dot-shell",
"category": "status-indicator",
diff --git a/frontend-modern/src/components/Settings/AIProviderConfigurationSection.tsx b/frontend-modern/src/components/Settings/AIProviderConfigurationSection.tsx
index 2e1feddcc8..7118ea6a8a 100644
--- a/frontend-modern/src/components/Settings/AIProviderConfigurationSection.tsx
+++ b/frontend-modern/src/components/Settings/AIProviderConfigurationSection.tsx
@@ -1,5 +1,6 @@
import { For, Show, type Accessor, type Component, type Setter } from 'solid-js';
import type { SetStoreFunction } from 'solid-js/store';
+import { CalloutCard } from '@/components/shared/CalloutCard';
import { HelpIcon } from '@/components/shared/HelpIcon';
import { controlClass } from '@/components/shared/Form';
import { getAIProviderHealthPresentation } from '@/utils/aiProviderHealthPresentation';
@@ -90,20 +91,27 @@ export const AIProviderConfigurationSection: Component<AIProviderConfigurationSe
</p>
</Show>
<Show when={props.providerIssueCount() > 0}>
- <div class="rounded border border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900 px-2 py-1.5">
- <p class="text-xs text-red-700 dark:text-red-300">
- {props.providerIssueCount()} provider{props.providerIssueCount() === 1 ? '' : 's'}{' '}
- configured but currently not usable.
- </p>
- <For each={providerIssueProviders()}>
- {(provider) => (
- <p class="text-[11px] text-red-600 dark:text-red-300">
- <span class="font-medium">{getAIProviderDisplayName(provider) || provider}:</span>{' '}
- {props.providerHealth[provider].message}
- </p>
- )}
- </For>
- </div>
+ <CalloutCard
+ tone="danger"
+ scale="compact"
+ padding="sm"
+ title={`${props.providerIssueCount()} provider${
+ props.providerIssueCount() === 1 ? '' : 's'
+ } configured but currently not usable.`}
+ >
+ <div class="space-y-1 text-[11px]">
+ <For each={providerIssueProviders()}>
+ {(provider) => (
+ <p>
+ <span class="font-medium">
+ {getAIProviderDisplayName(provider) || provider}:
+ </span>{' '}
+ {props.providerHealth[provider].message}
+ </p>
+ )}
+ </For>
+ </div>
+ </CalloutCard>
</Show>
</div>
diff --git a/frontend-modern/src/components/Settings/DiagnosticsResultsPanel.tsx b/frontend-modern/src/components/Settings/DiagnosticsResultsPanel.tsx
index 364b797033..d14dd2e525 100644
--- a/frontend-modern/src/components/Settings/DiagnosticsResultsPanel.tsx
+++ b/frontend-modern/src/components/Settings/DiagnosticsResultsPanel.tsx
@@ -2,6 +2,7 @@ import { Component, For, Show } from 'solid-js';
import type { JSX } from 'solid-js';
import { formatRelativeTime } from '@/utils/format';
import { Card } from '@/components/shared/Card';
+import { CalloutCard } from '@/components/shared/CalloutCard';
import Activity from 'lucide-solid/icons/activity';
import AlertTriangle from 'lucide-solid/icons/alert-triangle';
import CheckCircle from 'lucide-solid/icons/check-circle';
@@ -278,21 +279,28 @@ export const DiagnosticsResultsPanel: Component<DiagnosticsResultsPanelProps> =
/>
</div>
<Show when={(props.diagnosticsData?.metricsStore?.notes?.length || 0) > 0}>
- <div class="mt-3 rounded-md border border-amber-200 bg-amber-50 p-2 dark:border-amber-800 dark:bg-amber-900">
- <div class="flex items-start gap-2 text-xs text-amber-700 dark:text-amber-300">
- <AlertTriangle class="mt-0.5 h-4 w-4 flex-shrink-0" />
- <div class="space-y-1">
- <For each={props.diagnosticsData?.metricsStore?.notes || []}>
- {(note) => <div>{note}</div>}
- </For>
- </div>
+ <CalloutCard
+ tone="warning"
+ scale="compact"
+ padding="sm"
+ class="mt-3"
+ icon={<AlertTriangle class="h-4 w-4" />}
+ >
+ <div class="space-y-1 text-xs">
+ <For each={props.diagnosticsData?.metricsStore?.notes || []}>
+ {(note) => <div>{note}</div>}
+ </For>
</div>
- </div>
+ </CalloutCard>
</Show>
<Show when={props.diagnosticsData?.metricsStore?.error}>
- <div class="mt-3 rounded-md border border-red-200 bg-red-50 p-2 text-xs text-red-700 dark:border-red-800 dark:bg-red-900 dark:text-red-300">
- {props.diagnosticsData?.metricsStore?.error}
- </div>
+ <CalloutCard
+ tone="danger"
+ scale="compact"
+ padding="sm"
+ class="mt-3"
+ description={props.diagnosticsData?.metricsStore?.error}
+ />
</Show>
</Card>
</Show>
diff --git a/frontend-modern/src/components/Settings/DiscoverySettingsForm.tsx b/frontend-modern/src/components/Settings/DiscoverySettingsForm.tsx
index 7863f2a3d1..3ca6b84529 100644
--- a/frontend-modern/src/components/Settings/DiscoverySettingsForm.tsx
+++ b/frontend-modern/src/components/Settings/DiscoverySettingsForm.tsx
@@ -1,4 +1,6 @@
import { Component, For, Show } from 'solid-js';
+import InfoIcon from 'lucide-solid/icons/info';
+import { CalloutCard } from '@/components/shared/CalloutCard';
import { SectionHeader } from '@/components/shared/SectionHeader';
import { Toggle } from '@/components/shared/Toggle';
import type { ToggleChangeEvent } from '@/components/shared/Toggle';
@@ -47,29 +49,17 @@ export const DiscoverySettingsForm: Component<DiscoverySettingsFormProps> = (pro
return (
<div class="space-y-5">
- <div class="rounded-md border border-amber-200 bg-amber-50/80 p-4 dark:border-amber-800 dark:bg-amber-950/40">
- <div class="flex items-start gap-3">
- <svg
- class="mt-0.5 h-5 w-5 flex-shrink-0 text-amber-600 dark:text-amber-400"
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- >
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="2"
- d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
- />
- </svg>
- <div class="text-sm text-amber-900 dark:text-amber-100">
- <p class="mb-1 font-medium">{priorityNotice.title}</p>
- <ul class="space-y-1">
- <For each={priorityNotice.items}>{(item) => <li>• {item}</li>}</For>
- </ul>
- </div>
- </div>
- </div>
+ <CalloutCard
+ tone="warning"
+ scale="compact"
+ padding="md"
+ title={priorityNotice.title}
+ icon={<InfoIcon class="h-5 w-5" />}
+ >
+ <ul class="space-y-1 text-sm">
+ <For each={priorityNotice.items}>{(item) => <li>• {item}</li>}</For>
+ </ul>
+ </CalloutCard>
<section class="space-y-5">
<SectionHeader
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index 1de8e9acde..688e42dbbd 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -29,6 +29,8 @@ import auditWebhookPanelSource from '../AuditWebhookPanel.tsx?raw';
import reportingPanelSource from '../ReportingPanel.tsx?raw';
import rbacFeatureGateSectionSource from '../RBACFeatureGateSection.tsx?raw';
import recoverySettingsPanelSource from '../RecoverySettingsPanel.tsx?raw';
+import securityAuthPanelSource from '../SecurityAuthPanel.tsx?raw';
+import securityOverviewPanelSource from '../SecurityOverviewPanel.tsx?raw';
import systemLogsPanelSource from '../SystemLogsPanel.tsx?raw';
import updatesSettingsPanelSource from '../UpdatesSettingsPanel.tsx?raw';
import updateInstallGuideSource from '../UpdateInstallGuide.tsx?raw';
@@ -309,6 +311,32 @@ describe('settings architecture guardrails', () => {
);
});
+ it('keeps settings callouts on the shared CalloutCard primitive', () => {
+ for (const source of [
+ aiProviderConfigurationSectionSource,
+ diagnosticsResultsPanelSource,
+ discoverySettingsFormSource,
+ monitoredSystemImpactPreviewSource,
+ reportingPanelSource,
+ securityAuthPanelSource,
+ securityOverviewPanelSource,
+ vmwareCredentialSlotSource,
+ ]) {
+ expect(source).toContain('CalloutCard');
+ }
+
+ expect(discoverySettingsFormSource).toContain('scale="compact"');
+ expect(aiProviderConfigurationSectionSource).toContain('scale="compact"');
+ expect(diagnosticsResultsPanelSource).toContain('scale="compact"');
+ expect(discoverySettingsFormSource).not.toContain(
+ 'rounded-md border border-amber-200 bg-amber-50/80',
+ );
+ expect(aiProviderConfigurationSectionSource).not.toContain('rounded border border-red-200');
+ expect(diagnosticsResultsPanelSource).not.toContain(
+ 'rounded-md border border-amber-200 bg-amber-50',
+ );
+ });
+
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/shared/CalloutCard.test.tsx b/frontend-modern/src/components/shared/CalloutCard.test.tsx
index 54a4b42a94..0b103036fc 100644
--- a/frontend-modern/src/components/shared/CalloutCard.test.tsx
+++ b/frontend-modern/src/components/shared/CalloutCard.test.tsx
@@ -29,4 +29,19 @@ describe('CalloutCard', () => {
const description = screen.getByText('Act carefully');
expect(description.className).toContain('text-amber-800');
});
+
+ it('supports compact settings callout scale', () => {
+ render(() => (
+ <CalloutCard
+ title="Compact notice"
+ description="Fits in dense settings panels"
+ tone="danger"
+ scale="compact"
+ padding="sm"
+ />
+ ));
+
+ expect(screen.getByText('Compact notice').className).toContain('text-sm');
+ expect(screen.getByText('Fits in dense settings panels').className).toContain('text-xs');
+ });
});
diff --git a/frontend-modern/src/components/shared/CalloutCard.tsx b/frontend-modern/src/components/shared/CalloutCard.tsx
index e39c9ea4a9..5112e3935b 100644
--- a/frontend-modern/src/components/shared/CalloutCard.tsx
+++ b/frontend-modern/src/components/shared/CalloutCard.tsx
@@ -2,9 +2,11 @@ import { mergeProps, splitProps, type JSX } from 'solid-js';
import { Card } from '@/components/shared/Card';
type CalloutTone = 'danger' | 'info' | 'success' | 'warning';
+type CalloutScale = 'default' | 'compact';
interface CalloutCardProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'title'> {
tone?: CalloutTone;
+ scale?: CalloutScale;
title?: JSX.Element;
description?: JSX.Element;
icon?: JSX.Element;
@@ -42,10 +44,49 @@ const descriptionClassByTone: Record<CalloutTone, string> = {
warning: 'text-sm leading-relaxed text-amber-800 dark:text-amber-200',
};
+const layoutClassByScale: Record<CalloutScale, string> = {
+ default: 'flex flex-col gap-4 sm:flex-row',
+ compact: 'flex items-start gap-3',
+};
+
+const iconSizeClassByScale: Record<CalloutScale, string> = {
+ default: 'rounded-md p-3',
+ compact: 'rounded-md p-2',
+};
+
+const contentClassByScale: Record<CalloutScale, string> = {
+ default: 'min-w-0 space-y-2',
+ compact: 'min-w-0 space-y-1',
+};
+
+const titleClassByScaleAndTone: Record<CalloutScale, Record<CalloutTone, string>> = {
+ default: titleClassByTone,
+ compact: {
+ danger: 'text-sm font-semibold text-red-900 dark:text-red-100',
+ info: 'text-sm font-semibold text-blue-900 dark:text-blue-100',
+ success: 'text-sm font-semibold text-emerald-900 dark:text-emerald-100',
+ warning: 'text-sm font-semibold text-amber-900 dark:text-amber-100',
+ },
+};
+
+const descriptionClassByScaleAndTone: Record<CalloutScale, Record<CalloutTone, string>> = {
+ default: descriptionClassByTone,
+ compact: {
+ danger: 'text-xs leading-relaxed text-red-800 dark:text-red-200',
+ info: 'text-xs leading-relaxed text-blue-800 dark:text-blue-200',
+ success: 'text-xs leading-relaxed text-emerald-800 dark:text-emerald-200',
+ warning: 'text-xs leading-relaxed text-amber-800 dark:text-amber-200',
+ },
+};
+
export function CalloutCard(props: CalloutCardProps) {
- const merged = mergeProps({ padding: 'md' as const, tone: 'info' as CalloutTone }, props);
+ const merged = mergeProps(
+ { padding: 'md' as const, tone: 'info' as CalloutTone, scale: 'default' as CalloutScale },
+ props,
+ );
const [local, rest] = splitProps(merged, [
'tone',
+ 'scale',
'padding',
'title',
'description',
@@ -61,15 +102,24 @@ export function CalloutCard(props: CalloutCardProps) {
class={`${toneClassByTone[local.tone]} ${local.class ?? ''}`.trim()}
{...rest}
>
- <div class="flex flex-col gap-4 sm:flex-row">
- <div classList={{ hidden: !local.icon }} class={`h-fit shrink-0 rounded-md p-3 ${iconClassByTone[local.tone]}`}>
+ <div class={layoutClassByScale[local.scale]}>
+ <div
+ classList={{ hidden: !local.icon }}
+ class={`h-fit shrink-0 ${iconSizeClassByScale[local.scale]} ${iconClassByTone[local.tone]}`}
+ >
{local.icon}
</div>
- <div class="min-w-0 space-y-2">
- <div classList={{ hidden: !local.title }} class={titleClassByTone[local.tone]}>
+ <div class={contentClassByScale[local.scale]}>
+ <div
+ classList={{ hidden: !local.title }}
+ class={titleClassByScaleAndTone[local.scale][local.tone]}
+ >
{local.title}
</div>
- <div classList={{ hidden: !local.description }} class={descriptionClassByTone[local.tone]}>
+ <div
+ classList={{ hidden: !local.description }}
+ class={descriptionClassByScaleAndTone[local.scale][local.tone]}
+ >
{local.description}
</div>
{local.children}
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index bc9da9a201..5920369ff5 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -182,16 +182,19 @@ import resourceDetailDrawerDebugTabSource from '@/components/Infrastructure/Reso
import resourceDetailDrawerKubernetesModelSource from '@/components/Infrastructure/resourceDetailDrawerKubernetesModel.ts?raw';
import resourceDetailDrawerTrueNASModelSource from '@/components/Infrastructure/resourceDetailDrawerTrueNASModel.ts?raw';
import aiSettingsDialogsSource from '@/components/Settings/AISettingsDialogs.tsx?raw';
+import aiProviderConfigurationSectionSource from '@/components/Settings/AIProviderConfigurationSection.tsx?raw';
import agentProfilesPanelSource from '@/components/Settings/AgentProfilesPanel.tsx?raw';
import apiTokenManagerSource from '@/components/Settings/APITokenManager.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';
+import discoverySettingsFormSource from '@/components/Settings/DiscoverySettingsForm.tsx?raw';
import dockerRuntimeSettingsCardSource from '@/components/Settings/DockerRuntimeSettingsCard.tsx?raw';
import dataHandlingPanelSource from '@/components/Settings/DataHandlingPanel.tsx?raw';
import generalSettingsPanelSource from '@/components/Settings/GeneralSettingsPanel.tsx?raw';
import infrastructureInstallerSectionSource from '@/components/Settings/InfrastructureInstallerSection.tsx?raw';
import infrastructureWorkspaceSource from '@/components/Settings/InfrastructureWorkspace.tsx?raw';
+import monitoredSystemImpactPreviewSource from '@/components/Settings/MonitoredSystemImpactPreview.tsx?raw';
import organizationAccessInvitationsSectionSource from '@/components/Settings/OrganizationAccessInvitationsSection.tsx?raw';
import organizationAccessMembersSectionSource from '@/components/Settings/OrganizationAccessMembersSection.tsx?raw';
import organizationIncomingSharesSectionSource from '@/components/Settings/OrganizationIncomingSharesSection.tsx?raw';
@@ -200,6 +203,8 @@ import organizationOverviewMembersSectionSource from '@/components/Settings/Orga
import proLicensePlanSectionSource from '@/components/Settings/ProLicensePlanSection.tsx?raw';
import reportingPanelSource from '@/components/Settings/ReportingPanel.tsx?raw';
import rolesPanelSource from '@/components/Settings/RolesPanel.tsx?raw';
+import securityAuthPanelSource from '@/components/Settings/SecurityAuthPanel.tsx?raw';
+import securityOverviewPanelSource from '@/components/Settings/SecurityOverviewPanel.tsx?raw';
import updatesSettingsPanelSource from '@/components/Settings/UpdatesSettingsPanel.tsx?raw';
import userAssignmentsPanelSource from '@/components/Settings/UserAssignmentsPanel.tsx?raw';
import infrastructureSourcePickerSource from '@/components/Settings/InfrastructureSourcePicker.tsx?raw';
@@ -2439,11 +2444,73 @@ describe('shared primitive guardrails', () => {
});
it('routes settings info callouts through CalloutCard', () => {
+ 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[] }>;
+ }>;
+ };
+ const registeredRule = registry.rules?.find(
+ (rule) => rule.id === 'settings-callout-card-shell',
+ );
+
+ expect(registeredRule?.canonical?.path).toBe('src/components/shared/CalloutCard.tsx');
+ expect(registeredRule?.canonical?.export).toBe('CalloutCard');
+ expect(registeredRule?.requiredConsumers?.map((consumer) => consumer.path)).toEqual([
+ 'src/components/Settings/AIProviderConfigurationSection.tsx',
+ 'src/components/Settings/ConnectionEditor/CredentialSlots/VMwareCredentialSlot.tsx',
+ 'src/components/Settings/DiagnosticsResultsPanel.tsx',
+ 'src/components/Settings/DiscoverySettingsForm.tsx',
+ 'src/components/Settings/MonitoredSystemImpactPreview.tsx',
+ 'src/components/Settings/ReportingPanel.tsx',
+ 'src/components/Settings/SecurityAuthPanel.tsx',
+ 'src/components/Settings/SecurityOverviewPanel.tsx',
+ ]);
+ expect(registeredRule?.forbiddenPatterns).toEqual(
+ expect.arrayContaining([
+ expect.objectContaining({
+ path: 'src/components/Settings/AIProviderConfigurationSection.tsx',
+ patterns: expect.arrayContaining(['rounded border border-red-200']),
+ }),
+ expect.objectContaining({
+ path: 'src/components/Settings/DiagnosticsResultsPanel.tsx',
+ patterns: expect.arrayContaining(['rounded-md border border-amber-200 bg-amber-50']),
+ }),
+ expect.objectContaining({
+ path: 'src/components/Settings/DiscoverySettingsForm.tsx',
+ patterns: expect.arrayContaining([
+ 'rounded-md border border-amber-200 bg-amber-50/80',
+ ]),
+ }),
+ ]),
+ );
expect(calloutCardSource).toContain(
"type CalloutTone = 'danger' | 'info' | 'success' | 'warning'",
);
+ expect(calloutCardSource).toContain("type CalloutScale = 'default' | 'compact'");
expect(reportingPanelSource).toContain('CalloutCard');
expect(reportingPanelSource).not.toContain('rounded-md border border-blue-200 bg-blue-50 p-6');
+ for (const source of [
+ aiProviderConfigurationSectionSource,
+ diagnosticsResultsPanelSource,
+ discoverySettingsFormSource,
+ monitoredSystemImpactPreviewSource,
+ reportingPanelSource,
+ securityAuthPanelSource,
+ securityOverviewPanelSource,
+ vmwareCredentialSlotSource,
+ ]) {
+ expect(source).toContain('CalloutCard');
+ }
+ expect(aiProviderConfigurationSectionSource).not.toContain('rounded border border-red-200');
+ expect(diagnosticsResultsPanelSource).not.toContain(
+ 'rounded-md border border-amber-200 bg-amber-50',
+ );
+ expect(discoverySettingsFormSource).not.toContain(
+ 'rounded-md border border-amber-200 bg-amber-50/80',
+ );
});
it('keeps TLS verification warnings in the shared primitive boundary', () => {