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.

Canonicalize compact settings buttons

rcourtman480076609ef8
diff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.md
index 9b5f6ff23e..5746ea9e23 100644
--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md
+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md
@@ -571,6 +571,10 @@ or other self-hosted uncapped continuity plans.
before writing hosted org `OwnerUserID` or member `UserID`; owner/member
email fields preserve delivery and display contact metadata only.
13. Add or change hosted billing-admin presentation through `frontend-modern/src/components/Settings/BillingAdminPanel.tsx`, `frontend-modern/src/components/Settings/BillingAdminOrganizationsTable.tsx`, and `frontend-modern/src/components/Settings/useBillingAdminPanelState.ts`
+ Hosted billing-admin refresh semantics, availability gating, and billing
+ table state stay cloud-paid owned, while the refresh button chrome must
+ compose the frontend-primitives `Button` family instead of carrying a
+ hosted-billing-local compact action shell.
14. Add or change shared commercial plan/usage presentation through `frontend-modern/src/components/Settings/CommercialBillingSections.tsx` and `frontend-modern/src/utils/commercialBillingModel.ts`
15. Add or change organization billing and usage presentation through `frontend-modern/src/components/Settings/OrganizationBillingPanel.tsx`, `frontend-modern/src/components/Settings/OrganizationBillingLoadingState.tsx`, and `frontend-modern/src/components/Settings/useOrganizationBillingPanelState.ts`
16. Add or change self-hosted Pro plan, recovery, and entitlement actions through `frontend-modern/src/components/Settings/ProLicensePanel.tsx`, `frontend-modern/src/components/Settings/ProLicensePlanSection.tsx`, `frontend-modern/src/components/Settings/SelfHostedCommercialRecoverySection.tsx`, and `frontend-modern/src/components/Settings/useProLicensePanelState.ts`
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 60e0b1e379..298ed066a7 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -471,7 +471,9 @@ not a replacement status card, CTA band, or page-local nested card.
local `inline-flex ... rounded-md ...` Tailwind shells just because the page
needs a one-off action. The shared `mdCompact` size owns the common
settings/action `px-3 py-2 text-sm` shape, the shared `xs` size owns the
- compact settings row-action `px-2.5 py-1 text-xs` shape, and the shared
+ compact settings row-action `px-2.5 py-1 text-xs` shape, the shared
+ `settingsActionXs` size owns compact settings/privacy `px-3 py-2 text-xs`
+ action controls such as telemetry preview/reset buttons, and the shared
`iconMd` size owns the settings dialog close-button `h-9 w-9` icon shape.
Positive completion or continuation actions such as infrastructure handoff
and reporting exports use the shared `success`, `successOutline`, and
diff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.md
index ae15d1df80..3d93ea426d 100644
--- a/docs/release-control/v6/internal/subsystems/security-privacy.md
+++ b/docs/release-control/v6/internal/subsystems/security-privacy.md
@@ -308,6 +308,10 @@ customer-facing presentation boundary for outbound telemetry controls and
assemble customer-visible props for the shared settings shell. Privacy or telemetry
behavior must not drift into `frontend-modern/src/components/Settings/Settings.tsx`
or the registry hook just because the shell wiring changed.
+Telemetry preview, copy, and install-ID rotation controls keep their
+security/privacy behavior in that surface, but their button chrome must compose
+the frontend-primitives `Button` family instead of carrying privacy-local
+compact action shells.
That shell split now also applies to tab-save coordination: the dedicated
`frontend-modern/src/components/Settings/settingsTabSaveBehavior.ts` owner may
decide which settings tabs participate in shell-level save prompts, but it must
diff --git a/frontend-modern/scripts/shared-template-registry.json b/frontend-modern/scripts/shared-template-registry.json
index 93cd812400..6669c18676 100644
--- a/frontend-modern/scripts/shared-template-registry.json
+++ b/frontend-modern/scripts/shared-template-registry.json
@@ -241,6 +241,7 @@
{ "path": "src/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx" },
{ "path": "src/components/Settings/AgentProfilesPanel.tsx" },
{ "path": "src/components/Settings/AvailabilitySettingsPanel.tsx" },
+ { "path": "src/components/Settings/BillingAdminPanel.tsx" },
{ "path": "src/components/Settings/ConnectionEditor/AddressProbeStep.tsx" },
{ "path": "src/components/Settings/ConnectionEditor/ConnectionEditor.tsx" },
{
@@ -254,6 +255,7 @@
},
{ "path": "src/components/Settings/CopyCommandBlock.tsx" },
{ "path": "src/components/Settings/DataHandlingPanel.tsx" },
+ { "path": "src/components/Settings/GeneralSettingsPanel.tsx" },
{ "path": "src/components/Settings/InfrastructureAgentUpdatesDialog.tsx" },
{ "path": "src/components/Settings/InfrastructureDiscoverySettingsDialog.tsx" },
{ "path": "src/components/Settings/InfrastructureInstallerSection.tsx" },
@@ -265,6 +267,18 @@
{ "path": "src/features/standalone/StandalonePageSurface.tsx" }
],
"forbiddenPatterns": [
+ {
+ "path": "src/components/Settings/GeneralSettingsPanel.tsx",
+ "patterns": [
+ "inline-flex items-center rounded-md border border-border bg-surface px-3 py-2 text-xs font-medium text-base-content transition hover:bg-surface-hover"
+ ]
+ },
+ {
+ "path": "src/components/Settings/BillingAdminPanel.tsx",
+ "patterns": [
+ "w-full sm:w-auto px-3 py-1.5 text-xs font-medium rounded-md border border-border bg-surface hover:bg-surface-hover disabled:opacity-50"
+ ]
+ },
{
"path": "src/components/Settings/ResourcePicker.tsx",
"patterns": [
@@ -1390,6 +1404,28 @@
"scripts/shared-template-audit.mjs"
]
},
+ {
+ "id": "button-compact-settings-action-local-shell",
+ "category": "action-button",
+ "summary": "Settings and hosted-admin surfaces must not copy compact xs action-button shells; use Button with the settingsActionXs or sm size.",
+ "canonical": {
+ "path": "src/components/shared/buttonModel.ts",
+ "export": "getButtonClass"
+ },
+ "scopes": ["src/components/Settings", "src/features", "src/pages"],
+ "extensions": [".tsx"],
+ "allPatterns": [
+ "rounded-md border border-border bg-surface px-3 py-2 text-xs font-medium text-base-content"
+ ],
+ "legacyReason": "Retired migration debt. Compact settings and admin actions belong to the shared Button primitive family.",
+ "allowedPaths": [],
+ "ignoredPaths": ["src/components/shared/Button.test.tsx"],
+ "proof": [
+ "src/components/shared/SharedPrimitives.guardrails.test.ts",
+ "src/components/shared/Button.test.tsx",
+ "scripts/shared-template-audit.mjs"
+ ]
+ },
{
"id": "button-secondary-settings-action-local-shell",
"category": "action-button",
diff --git a/frontend-modern/src/components/Settings/BillingAdminPanel.tsx b/frontend-modern/src/components/Settings/BillingAdminPanel.tsx
index 95816258ce..bcd559d371 100644
--- a/frontend-modern/src/components/Settings/BillingAdminPanel.tsx
+++ b/frontend-modern/src/components/Settings/BillingAdminPanel.tsx
@@ -1,5 +1,6 @@
import { Component, Show } from 'solid-js';
import SettingsPanel from '@/components/shared/SettingsPanel';
+import { Button } from '@/components/shared/Button';
import {
ORGANIZATION_SETTINGS_UNAVAILABLE_CLASS as ORGANIZATION_SETTINGS_PANEL_UNAVAILABLE_CLASS,
ORGANIZATION_SETTINGS_UNAVAILABLE_MESSAGE as ORGANIZATION_SETTINGS_PANEL_UNAVAILABLE_MESSAGE,
@@ -22,16 +23,17 @@ export const BillingAdminPanel: Component = () => {
<SettingsPanel
title="Billing Admin"
action={
- <button
- type="button"
+ <Button
+ variant="secondary"
+ size="sm"
+ class="w-full sm:w-auto"
onClick={() => {
void state.refreshOrganizations();
}}
disabled={state.loadingOrgs()}
- class="w-full sm:w-auto px-3 py-1.5 text-xs font-medium rounded-md border border-border bg-surface hover:bg-surface-hover disabled:opacity-50"
>
Refresh
- </button>
+ </Button>
}
bodyClass="space-y-4"
>
diff --git a/frontend-modern/src/components/Settings/GeneralSettingsPanel.tsx b/frontend-modern/src/components/Settings/GeneralSettingsPanel.tsx
index 05f6d33b10..7fa272502e 100644
--- a/frontend-modern/src/components/Settings/GeneralSettingsPanel.tsx
+++ b/frontend-modern/src/components/Settings/GeneralSettingsPanel.tsx
@@ -1,5 +1,6 @@
import { Component, Show, Accessor, Setter } from 'solid-js';
import SettingsPanel from '@/components/shared/SettingsPanel';
+import { Button } from '@/components/shared/Button';
import { Toggle } from '@/components/shared/Toggle';
import { EnvironmentLockBadge } from '@/components/shared/EnvironmentLockBadge';
import { FilterButtonGroup, type FilterOption } from '@/components/shared/FilterButtonGroup';
@@ -76,20 +77,14 @@ export const GeneralSettingsPanel: Component<GeneralSettingsPanelProps> = (props
if (props.pvePollingEnvLocked()) return;
props.setPVEPollingSelection(value);
- props.setPVEPollingInterval(
- value === 'custom' ? props.pvePollingCustomSeconds() : value,
- );
+ props.setPVEPollingInterval(value === 'custom' ? props.pvePollingCustomSeconds() : value);
props.setHasUnsavedChanges(true);
};
return (
<div class="space-y-6">
{/* Appearance Card */}
- <SettingsPanel
- title="Appearance"
- noPadding
- bodyClass="divide-y divide-border"
- >
+ <SettingsPanel title="Appearance" noPadding bodyClass="divide-y divide-border">
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-4 p-4 sm:p-6">
<div class="flex items-center gap-3 min-w-0">
{/* Animated theme icon */}
@@ -210,30 +205,30 @@ export const GeneralSettingsPanel: Component<GeneralSettingsPanelProps> = (props
</div>
<div class="flex flex-wrap gap-3">
- <button
- type="button"
- class="inline-flex items-center rounded-md border border-border bg-surface px-3 py-2 text-xs font-medium text-base-content transition hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-60"
+ <Button
+ variant="secondary"
+ size="settingsActionXs"
disabled={props.loadingTelemetryPreview()}
onClick={() => void props.handleLoadTelemetryPreview()}
>
{props.telemetryPreview() ? 'Refresh payload' : 'Preview payload'}
- </button>
- <button
- type="button"
- class="inline-flex items-center rounded-md border border-border bg-surface px-3 py-2 text-xs font-medium text-base-content transition hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-60"
+ </Button>
+ <Button
+ variant="secondary"
+ size="settingsActionXs"
disabled={props.resettingTelemetryInstallID()}
onClick={() => void props.handleResetTelemetryInstallID()}
>
Reset ID
- </button>
+ </Button>
<Show when={props.telemetryPreviewPayload()}>
- <button
- type="button"
- class="inline-flex items-center rounded-md border border-border bg-surface px-3 py-2 text-xs font-medium text-base-content transition hover:bg-surface-hover"
+ <Button
+ variant="secondary"
+ size="settingsActionXs"
onClick={() => void props.handleCopyTelemetryPreview()}
>
Copy JSON
- </button>
+ </Button>
</Show>
</div>
@@ -245,8 +240,8 @@ export const GeneralSettingsPanel: Component<GeneralSettingsPanelProps> = (props
</p>
<Show when={!props.telemetryPreviewEnabled()}>
<p class="text-xs text-muted leading-relaxed">
- Telemetry is currently disabled. This preview shows the payload Pulse would
- send if you enable it.
+ Telemetry is currently disabled. This preview shows the payload Pulse would send
+ if you enable it.
</p>
</Show>
</div>
diff --git a/frontend-modern/src/components/Settings/__tests__/BillingAdminPanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/BillingAdminPanel.test.tsx
index 69bf8f726d..385cefaa52 100644
--- a/frontend-modern/src/components/Settings/__tests__/BillingAdminPanel.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/BillingAdminPanel.test.tsx
@@ -79,7 +79,9 @@ describe('BillingAdminPanel', () => {
stripe_customer_id: 'cus_123',
};
getBillingStateMock.mockResolvedValue(stateWithoutPlan);
- putBillingStateMock.mockImplementation(async (_orgID: string, payload: Record<string, unknown>) => payload);
+ putBillingStateMock.mockImplementation(
+ async (_orgID: string, payload: Record<string, unknown>) => payload,
+ );
render(() => <BillingAdminPanel />);
@@ -107,7 +109,9 @@ describe('BillingAdminPanel', () => {
plan_version: 'cloud_power',
};
getBillingStateMock.mockResolvedValue(stateWithPlan);
- putBillingStateMock.mockImplementation(async (_orgID: string, payload: Record<string, unknown>) => payload);
+ putBillingStateMock.mockImplementation(
+ async (_orgID: string, payload: Record<string, unknown>) => payload,
+ );
render(() => <BillingAdminPanel />);
@@ -127,6 +131,12 @@ describe('BillingAdminPanel', () => {
});
it('keeps hosted billing admin split into shell, runtime, and table owners', () => {
+ expect(billingAdminPanelSource).toContain('@/components/shared/Button');
+ expect(billingAdminPanelSource).toContain('variant="secondary"');
+ expect(billingAdminPanelSource).toContain('size="sm"');
+ expect(billingAdminPanelSource).not.toContain(
+ 'w-full sm:w-auto px-3 py-1.5 text-xs font-medium rounded-md border border-border bg-surface hover:bg-surface-hover disabled:opacity-50',
+ );
expect(billingAdminPanelSource).toContain('./useBillingAdminPanelState');
expect(billingAdminPanelSource).toContain('./BillingAdminOrganizationsTable');
expect(billingAdminPanelSource).not.toContain('createSignal(');
diff --git a/frontend-modern/src/components/Settings/__tests__/GeneralSettingsPanel.guardrails.test.ts b/frontend-modern/src/components/Settings/__tests__/GeneralSettingsPanel.guardrails.test.ts
index 76adf8f05a..f418baa5a7 100644
--- a/frontend-modern/src/components/Settings/__tests__/GeneralSettingsPanel.guardrails.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/GeneralSettingsPanel.guardrails.test.ts
@@ -18,6 +18,16 @@ describe('GeneralSettingsPanel guardrails', () => {
expect(generalSettingsPanelSource).toContain('Telemetry payload preview');
});
+ it('routes telemetry command controls through the shared Button primitive', () => {
+ expect(generalSettingsPanelSource).toContain(
+ "import { Button } from '@/components/shared/Button';",
+ );
+ expect(generalSettingsPanelSource).toContain('size="settingsActionXs"');
+ expect(generalSettingsPanelSource).not.toContain(
+ 'inline-flex items-center rounded-md border border-border bg-surface px-3 py-2 text-xs font-medium text-base-content transition hover:bg-surface-hover',
+ );
+ });
+
it('keeps maintainer commercial event controls out of customer settings', () => {
expect(generalSettingsPanelSource).not.toContain('Disable local-only commercial events');
expect(generalSettingsPanelSource).not.toContain('commercial handoff events');
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index ff52d71588..ad3dd88cd4 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -272,6 +272,14 @@ describe('settings architecture guardrails', () => {
});
it('keeps settings command actions on the shared button primitive', () => {
+ expect(generalSettingsPanelSource).toContain(
+ "import { Button } from '@/components/shared/Button';",
+ );
+ expect(generalSettingsPanelSource).toContain('size="settingsActionXs"');
+ expect(generalSettingsPanelSource).not.toContain(
+ 'inline-flex items-center rounded-md border border-border bg-surface px-3 py-2 text-xs font-medium text-base-content transition hover:bg-surface-hover',
+ );
+
expect(reportingPanelSource).toContain("import { Button } from '@/components/shared/Button';");
expect(reportingPanelSource).toContain('<Button');
expect(reportingPanelSource).toContain('variant="primary"');
diff --git a/frontend-modern/src/components/shared/Button.test.tsx b/frontend-modern/src/components/shared/Button.test.tsx
index 90a5872aee..c8f0dec30c 100644
--- a/frontend-modern/src/components/shared/Button.test.tsx
+++ b/frontend-modern/src/components/shared/Button.test.tsx
@@ -37,6 +37,9 @@ describe('Button', () => {
expect(buttonModelSource).toContain("xs: 'px-2.5 py-1 text-xs'");
expect(buttonModelSource).toContain("mdCompact: 'px-3 py-2 text-sm'");
expect(buttonModelSource).toContain("settingsAction: 'min-h-10 px-3 py-2 text-sm sm:min-h-9'");
+ expect(buttonModelSource).toContain(
+ "settingsActionXs: 'min-h-10 px-3 py-2 text-xs sm:min-h-9'",
+ );
expect(buttonModelSource).toContain("chip: 'gap-1 px-1.5 py-0.5 text-[10px]'");
expect(buttonModelSource).toContain("iconMd: 'h-9 w-9 p-0'");
});
@@ -88,6 +91,9 @@ describe('Button', () => {
<Button variant="successGhost" size="settingsAction">
Dismiss
</Button>
+ <Button variant="secondary" size="settingsActionXs">
+ Preview payload
+ </Button>
</>
));
@@ -112,6 +118,11 @@ describe('Button', () => {
const dismissButton = screen.getByRole('button', { name: 'Dismiss' });
expect(dismissButton).toHaveClass('border-transparent');
expect(dismissButton).toHaveClass('text-emerald-900');
+
+ const previewButton = screen.getByRole('button', { name: 'Preview payload' });
+ expect(previewButton).toHaveClass('min-h-10');
+ expect(previewButton).toHaveClass('text-xs');
+ expect(previewButton).toHaveClass('px-3');
});
it('renders command-copy icon buttons through the shared primitive', () => {
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index fc1460bc39..9c0ccbd9b5 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -181,6 +181,7 @@ import resourceDetailDrawerTrueNASModelSource from '@/components/Infrastructure/
import aiSettingsDialogsSource from '@/components/Settings/AISettingsDialogs.tsx?raw';
import agentProfilesPanelSource from '@/components/Settings/AgentProfilesPanel.tsx?raw';
import apiTokenManagerSource from '@/components/Settings/APITokenManager.tsx?raw';
+import billingAdminPanelSource from '@/components/Settings/BillingAdminPanel.tsx?raw';
import diagnosticsResultsPanelSource from '@/components/Settings/DiagnosticsResultsPanel.tsx?raw';
import dockerRuntimeSettingsCardSource from '@/components/Settings/DockerRuntimeSettingsCard.tsx?raw';
import dataHandlingPanelSource from '@/components/Settings/DataHandlingPanel.tsx?raw';
@@ -1554,6 +1555,9 @@ describe('shared primitive guardrails', () => {
const commandCopyGuard = registry.patternGuards?.find(
(guard) => guard.id === 'button-command-copy-local-shell',
);
+ const compactSettingsActionGuard = registry.patternGuards?.find(
+ (guard) => guard.id === 'button-compact-settings-action-local-shell',
+ );
const settingsActionGuard = registry.patternGuards?.find(
(guard) => guard.id === 'button-secondary-settings-action-local-shell',
);
@@ -1611,6 +1615,7 @@ describe('shared primitive guardrails', () => {
'src/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx',
'src/components/Settings/AgentProfilesPanel.tsx',
'src/components/Settings/AvailabilitySettingsPanel.tsx',
+ 'src/components/Settings/BillingAdminPanel.tsx',
'src/components/Settings/ConnectionEditor/AddressProbeStep.tsx',
'src/components/Settings/ConnectionEditor/ConnectionEditor.tsx',
'src/components/Settings/ConnectionEditor/CredentialSlots/AvailabilityTargetSlot.tsx',
@@ -1618,6 +1623,7 @@ describe('shared primitive guardrails', () => {
'src/components/Settings/ConnectionEditor/CredentialSlots/VMwareCredentialSlot.tsx',
'src/components/Settings/CopyCommandBlock.tsx',
'src/components/Settings/DataHandlingPanel.tsx',
+ 'src/components/Settings/GeneralSettingsPanel.tsx',
'src/components/Settings/InfrastructureAgentUpdatesDialog.tsx',
'src/components/Settings/InfrastructureDiscoverySettingsDialog.tsx',
'src/components/Settings/InfrastructureInstallerSection.tsx',
@@ -1630,6 +1636,18 @@ describe('shared primitive guardrails', () => {
]);
expect(registeredRule?.forbiddenPatterns).toEqual(
expect.arrayContaining([
+ expect.objectContaining({
+ path: 'src/components/Settings/GeneralSettingsPanel.tsx',
+ patterns: expect.arrayContaining([
+ 'inline-flex items-center rounded-md border border-border bg-surface px-3 py-2 text-xs font-medium text-base-content transition hover:bg-surface-hover',
+ ]),
+ }),
+ expect.objectContaining({
+ path: 'src/components/Settings/BillingAdminPanel.tsx',
+ patterns: expect.arrayContaining([
+ 'w-full sm:w-auto px-3 py-1.5 text-xs font-medium rounded-md border border-border bg-surface hover:bg-surface-hover disabled:opacity-50',
+ ]),
+ }),
expect.objectContaining({
path: 'src/components/Settings/ResourcePicker.tsx',
patterns: expect.arrayContaining([
@@ -1675,6 +1693,22 @@ describe('shared primitive guardrails', () => {
expect(commandCopyGuard?.scopes).toEqual(['src/components', 'src/features', 'src/pages']);
expect(commandCopyGuard?.allowedPaths ?? []).toHaveLength(0);
expect(commandCopyGuard?.ignoredPaths).toEqual(['src/components/shared/Button.test.tsx']);
+ expect(compactSettingsActionGuard?.canonical?.path).toBe(
+ 'src/components/shared/buttonModel.ts',
+ );
+ expect(compactSettingsActionGuard?.canonical?.export).toBe('getButtonClass');
+ expect(compactSettingsActionGuard?.allPatterns).toEqual([
+ 'rounded-md border border-border bg-surface px-3 py-2 text-xs font-medium text-base-content',
+ ]);
+ expect(compactSettingsActionGuard?.scopes).toEqual([
+ 'src/components/Settings',
+ 'src/features',
+ 'src/pages',
+ ]);
+ expect(compactSettingsActionGuard?.allowedPaths ?? []).toHaveLength(0);
+ expect(compactSettingsActionGuard?.ignoredPaths).toEqual([
+ 'src/components/shared/Button.test.tsx',
+ ]);
expect(settingsActionGuard?.canonical?.path).toBe('src/components/shared/buttonModel.ts');
expect(settingsActionGuard?.canonical?.export).toBe('getButtonClass');
expect(settingsActionGuard?.allPatterns).toEqual([
@@ -1883,6 +1917,7 @@ describe('shared primitive guardrails', () => {
expect(buttonModelSource).toContain('BUTTON_VARIANT_CLASSES');
expect(buttonModelSource).toContain('BUTTON_SIZE_CLASSES');
expect(buttonModelSource).toContain('primaryFlat:');
+ expect(buttonModelSource).toContain('settingsActionXs:');
expect(buttonModelSource).toContain('success:');
expect(buttonModelSource).toContain('successOutline:');
expect(buttonModelSource).toContain('successGhost:');
@@ -1955,6 +1990,16 @@ describe('shared primitive guardrails', () => {
expect(dataHandlingPanelSource).not.toContain(
'rounded-md border border-border bg-surface px-3 py-2 text-sm font-medium text-base-content',
);
+ expect(generalSettingsPanelSource).toContain('@/components/shared/Button');
+ expect(generalSettingsPanelSource).toContain('size="settingsActionXs"');
+ expect(generalSettingsPanelSource).not.toContain(
+ 'inline-flex items-center rounded-md border border-border bg-surface px-3 py-2 text-xs font-medium text-base-content transition hover:bg-surface-hover',
+ );
+ expect(billingAdminPanelSource).toContain('@/components/shared/Button');
+ expect(billingAdminPanelSource).toContain('size="sm"');
+ expect(billingAdminPanelSource).not.toContain(
+ 'w-full sm:w-auto px-3 py-1.5 text-xs font-medium rounded-md border border-border bg-surface hover:bg-surface-hover disabled:opacity-50',
+ );
expect(infrastructureInstallerSectionSource).toContain('@/components/shared/Button');
expect(infrastructureInstallerSectionSource).toContain('CommandCopyButton');
expect(infrastructureInstallerSectionSource).toContain('variant="success"');
diff --git a/frontend-modern/src/components/shared/buttonModel.ts b/frontend-modern/src/components/shared/buttonModel.ts
index c962e4fc39..908af1ca0a 100644
--- a/frontend-modern/src/components/shared/buttonModel.ts
+++ b/frontend-modern/src/components/shared/buttonModel.ts
@@ -14,6 +14,7 @@ export type ButtonSize =
| 'sm'
| 'mdCompact'
| 'settingsAction'
+ | 'settingsActionXs'
| 'md'
| 'lg'
| 'icon'
@@ -43,6 +44,7 @@ export const BUTTON_SIZE_CLASSES: Record<ButtonSize, string> = {
sm: 'px-2.5 py-1.5 text-xs',
mdCompact: 'px-3 py-2 text-sm',
settingsAction: 'min-h-10 px-3 py-2 text-sm sm:min-h-9',
+ settingsActionXs: 'min-h-10 px-3 py-2 text-xs sm:min-h-9',
md: 'px-4 py-2 text-sm',
lg: 'px-6 py-3 text-base',
icon: 'p-2',