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.

Register shared status indicator badge governance

rcourtman6e81424a590c
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 70b6adae3f..9597146365 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -487,6 +487,11 @@ boundary. `AgentProfilesPanel.tsx` and `SuggestProfileModal.tsx` may own agent
profile lifecycle behavior and API mutations, but multi-line form controls in
those surfaces must compose `FormTextarea` instead of local raw `<textarea>`
wrappers.
+Agent profile read-only state indicators follow the same presentation split:
+`AgentProfilesPanel.tsx` may own lifecycle status labels and assignment state,
+but badge tone, optional dot wiring, sizing, and shell classes must compose the
+frontend-primitives-owned `StatusIndicatorBadge` instead of calling status tone
+helpers or recreating badge spans inline.
## Extension Points
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 20642fe9d4..6746fe6c71 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -2298,6 +2298,13 @@ gating and click runtime, and
label/title fallback policy, and status-badge class selection. Future status
badge work should extend those owners instead of pushing label/title policy or
disabled click handling back into the shell.
+Read-only health/state badges are a separate shared primitive.
+`frontend-modern/src/components/shared/StatusIndicatorBadge.tsx` owns
+status-to-tone mapping, optional dot wiring, sizing, shape, and label
+presentation for product surfaces that display state rather than toggle it.
+Product components must compose `StatusIndicatorBadge` instead of calling
+`getStatusIndicatorBadgeToneClasses` directly; low-level status utilities may
+still expose the tone mapping for that primitive and utility-level tests.
The shared segmented selector now follows that same owner split.
`frontend-modern/src/components/shared/FilterButtonGroup.tsx` stays the render
shell, `frontend-modern/src/components/shared/useFilterButtonGroupState.ts`
diff --git a/frontend-modern/scripts/shared-template-registry.json b/frontend-modern/scripts/shared-template-registry.json
index 26c75ea662..fc5bc507dd 100644
--- a/frontend-modern/scripts/shared-template-registry.json
+++ b/frontend-modern/scripts/shared-template-registry.json
@@ -164,7 +164,7 @@
"export": "StatusDot"
},
"requiredConsumers": [
- { "path": "src/components/Settings/DiagnosticsResultsPanel.tsx" },
+ { "path": "src/components/shared/StatusIndicatorBadge.tsx" },
{ "path": "src/components/Settings/ResourcePicker.tsx" },
{ "path": "src/components/Storage/StoragePoolDetail.tsx" },
{ "path": "src/components/shared/NodeGroupHeader.tsx" },
@@ -287,6 +287,24 @@
"scripts/shared-template-audit.mjs"
]
},
+ {
+ "id": "status-indicator-badge-shell",
+ "category": "status-indicator",
+ "summary": "Read-only health/state badges must compose StatusIndicatorBadge for shared status-to-tone mapping, sizing, dot wiring, and label presentation instead of recreating local badge spans with getStatusIndicatorBadgeToneClasses.",
+ "canonical": {
+ "path": "src/components/shared/StatusIndicatorBadge.tsx",
+ "export": "StatusIndicatorBadge"
+ },
+ "requiredConsumers": [
+ { "path": "src/components/Settings/AgentProfilesPanel.tsx" },
+ { "path": "src/components/Settings/DiagnosticsResultsPanel.tsx" }
+ ],
+ "proof": [
+ "src/components/shared/SharedPrimitives.guardrails.test.ts",
+ "src/components/shared/StatusIndicatorBadge.test.tsx",
+ "scripts/shared-template-audit.mjs"
+ ]
+ },
{
"id": "platform-table-loading-state",
"category": "platform-table-loading-state",
@@ -812,6 +830,26 @@
"scripts/shared-template-audit.mjs"
]
},
+ {
+ "id": "status-indicator-badge-local-tone-helper",
+ "category": "status-indicator",
+ "summary": "Product components must compose StatusIndicatorBadge instead of calling getStatusIndicatorBadgeToneClasses directly for read-only health/state badges.",
+ "canonical": {
+ "path": "src/components/shared/StatusIndicatorBadge.tsx",
+ "export": "StatusIndicatorBadge"
+ },
+ "scopes": ["src/components", "src/features"],
+ "extensions": [".tsx"],
+ "allPatterns": ["getStatusIndicatorBadgeToneClasses("],
+ "legacyReason": "Retired migration debt. Read-only status badges must route through StatusIndicatorBadge; status utilities may still expose tone classes for the shared primitive and non-component tests.",
+ "allowedPaths": [],
+ "ignoredPaths": ["src/components/shared/SharedPrimitives.guardrails.test.ts"],
+ "proof": [
+ "src/components/shared/SharedPrimitives.guardrails.test.ts",
+ "src/components/shared/StatusIndicatorBadge.test.tsx",
+ "scripts/shared-template-audit.mjs"
+ ]
+ },
{
"id": "form-select-local-guest-history-range-select",
"category": "form-control",
diff --git a/frontend-modern/src/components/Settings/AgentProfilesPanel.tsx b/frontend-modern/src/components/Settings/AgentProfilesPanel.tsx
index f955050b56..2c536e5ad1 100644
--- a/frontend-modern/src/components/Settings/AgentProfilesPanel.tsx
+++ b/frontend-modern/src/components/Settings/AgentProfilesPanel.tsx
@@ -4,6 +4,7 @@ import SettingsPanel from '@/components/shared/SettingsPanel';
import { Dialog } from '@/components/shared/Dialog';
import { FormSelect } from '@/components/shared/FormSelect';
import { FormTextarea } from '@/components/shared/FormTextarea';
+import { StatusIndicatorBadge } from '@/components/shared/StatusIndicatorBadge';
import { UpgradeLink } from '@/components/shared/UpgradeLink';
import { SuggestProfileModal } from './SuggestProfileModal';
import { KNOWN_SETTINGS, type SelectSetting, type StringSetting } from './agentProfileSettings';
@@ -38,7 +39,6 @@ export const AgentProfilesPanel: Component = () => {
getProfileById,
getProfileOptionLabel,
getSettingsCount,
- getStatusIndicatorBadgeToneClasses,
getUpgradeActionDestination,
getUpgradeActionButtonClass,
handleAssign,
@@ -289,11 +289,10 @@ export const AgentProfilesPanel: Component = () => {
render: (agent) => {
const indicator = () => getAgentStatusIndicator({ status: agent.status });
return (
- <span
- class={`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${getStatusIndicatorBadgeToneClasses(indicator().variant)}`}
- >
- {indicator().label}
- </span>
+ <StatusIndicatorBadge
+ variant={indicator().variant}
+ label={indicator().label}
+ />
);
},
},
diff --git a/frontend-modern/src/components/Settings/DiagnosticsResultsPanel.tsx b/frontend-modern/src/components/Settings/DiagnosticsResultsPanel.tsx
index c0a1307279..364b797033 100644
--- a/frontend-modern/src/components/Settings/DiagnosticsResultsPanel.tsx
+++ b/frontend-modern/src/components/Settings/DiagnosticsResultsPanel.tsx
@@ -14,8 +14,7 @@ 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 { StatusDot } from '@/components/shared/StatusDot';
-import { getSimpleStatusIndicator, getStatusIndicatorBadgeToneClasses } from '@/utils/status';
+import { StatusIndicatorBadge } from '@/components/shared/StatusIndicatorBadge';
import { getSemanticTonePresentation } from '@/utils/semanticTonePresentation';
import {
DIAGNOSTICS_EMPTY_PBS_MESSAGE,
@@ -48,27 +47,6 @@ const DiagnosticCard: Component<{
);
};
-const StatusBadge: Component<{
- label?: string;
- status: 'online' | 'offline' | 'warning' | 'unknown';
-}> = (props) => {
- const indicator = () => getSimpleStatusIndicator(props.status);
-
- return (
- <span
- class={`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ${getStatusIndicatorBadgeToneClasses(indicator().variant)}`}
- >
- <StatusDot
- variant={indicator().variant}
- size="xs"
- ariaHidden={true}
- class="translate-y-[0.5px]"
- />
- {props.label || indicator().label}
- </span>
- );
-};
-
const MetricRow: Component<{
label: string;
mono?: boolean;
@@ -149,7 +127,12 @@ export const DiagnosticsResultsPanel: Component<DiagnosticsResultsPanelProps> =
<span class="max-w-[120px] truncate" title={node.host}>
{node.name}
</span>
- <StatusBadge status={node.connected ? 'online' : 'offline'} />
+ <StatusIndicatorBadge
+ status={node.connected ? 'online' : 'offline'}
+ dot
+ uppercase
+ size="xs"
+ />
</div>
)}
</For>
@@ -186,7 +169,12 @@ export const DiagnosticsResultsPanel: Component<DiagnosticsResultsPanelProps> =
<span class="max-w-[120px] truncate" title={pbs.host}>
{pbs.name}
</span>
- <StatusBadge status={pbs.connected ? 'online' : 'offline'} />
+ <StatusIndicatorBadge
+ status={pbs.connected ? 'online' : 'offline'}
+ dot
+ uppercase
+ size="xs"
+ />
</div>
)}
</For>
@@ -238,7 +226,7 @@ export const DiagnosticsResultsPanel: Component<DiagnosticsResultsPanelProps> =
<p class="text-xs text-muted">History persistence health</p>
</div>
<div class="ml-auto">
- <StatusBadge
+ <StatusIndicatorBadge
status={
props.diagnosticsData?.metricsStore?.status === 'healthy'
? 'online'
@@ -249,6 +237,9 @@ export const DiagnosticsResultsPanel: Component<DiagnosticsResultsPanelProps> =
: 'offline'
}
label={props.diagnosticsData?.metricsStore?.status || 'unknown'}
+ dot
+ uppercase
+ size="xs"
/>
</div>
</div>
@@ -317,9 +308,12 @@ export const DiagnosticsResultsPanel: Component<DiagnosticsResultsPanelProps> =
<p class="text-xs text-muted">Authentication status</p>
</div>
<div class="ml-auto">
- <StatusBadge
+ <StatusIndicatorBadge
status={props.diagnosticsData?.apiTokens?.enabled ? 'online' : 'warning'}
label={props.diagnosticsData?.apiTokens?.enabled ? 'Enabled' : 'Disabled'}
+ dot
+ uppercase
+ size="xs"
/>
</div>
</div>
@@ -393,22 +387,24 @@ export const DiagnosticsResultsPanel: Component<DiagnosticsResultsPanelProps> =
</div>
</div>
<div class="flex flex-wrap gap-2">
- <span
- class={`rounded px-2 py-1 text-xs font-medium ${getStatusIndicatorBadgeToneClasses(
- props.diagnosticsData?.alerts?.missingCooldown ? 'warning' : 'success',
- )}`}
- >
- Cooldown:{' '}
- {props.diagnosticsData?.alerts?.missingCooldown ? 'Missing' : 'Configured'}
- </span>
- <span
- class={`rounded px-2 py-1 text-xs font-medium ${getStatusIndicatorBadgeToneClasses(
- props.diagnosticsData?.alerts?.missingGroupingWindow ? 'warning' : 'success',
- )}`}
- >
- Grouping:{' '}
- {props.diagnosticsData?.alerts?.missingGroupingWindow ? 'Disabled' : 'Enabled'}
- </span>
+ <StatusIndicatorBadge
+ variant={props.diagnosticsData?.alerts?.missingCooldown ? 'warning' : 'success'}
+ label={`Cooldown: ${
+ props.diagnosticsData?.alerts?.missingCooldown ? 'Missing' : 'Configured'
+ }`}
+ size="md"
+ shape="rounded"
+ />
+ <StatusIndicatorBadge
+ variant={
+ props.diagnosticsData?.alerts?.missingGroupingWindow ? 'warning' : 'success'
+ }
+ label={`Grouping: ${
+ props.diagnosticsData?.alerts?.missingGroupingWindow ? 'Disabled' : 'Enabled'
+ }`}
+ size="md"
+ shape="rounded"
+ />
</div>
<Show when={(props.diagnosticsData?.alerts?.notes?.length || 0) > 0}>
<ul class="mt-3 list-disc space-y-1 border-t border-border-subtle pt-2 pl-4 text-xs text-muted">
@@ -431,7 +427,7 @@ export const DiagnosticsResultsPanel: Component<DiagnosticsResultsPanelProps> =
<p class="text-xs text-muted">Pulse Assistant Service</p>
</div>
<div class="ml-auto">
- <StatusBadge
+ <StatusIndicatorBadge
status={
props.diagnosticsData?.aiChat?.running
? 'online'
@@ -444,8 +440,11 @@ export const DiagnosticsResultsPanel: Component<DiagnosticsResultsPanelProps> =
? 'Running'
: props.diagnosticsData?.aiChat?.enabled
? 'Stopped'
- : 'Disabled'
+ : 'Disabled'
}
+ dot
+ uppercase
+ size="xs"
/>
</div>
</div>
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index c66f8a018c..3d4d6d139f 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -75,6 +75,7 @@ import infrastructureOnboardingPresentationSource from '../../../utils/infrastru
import selfHostedBillingPresentationSource from '../selfHostedBillingPresentation.ts?raw';
import systemSettingsPresentationSource from '../../../utils/systemSettingsPresentation.ts?raw';
import auditLogPresentationSource from '../../../utils/auditLogPresentation.ts?raw';
+import statusIndicatorBadgeSource from '../../shared/StatusIndicatorBadge.tsx?raw';
const settingsRuntimeSources = import.meta.glob(['../*.tsx', '../ConnectionEditor/**/*.tsx'], {
query: '?raw',
@@ -883,4 +884,17 @@ describe('settings architecture guardrails', () => {
'export interface InfrastructureOnboardingSummary',
);
});
+
+ it('keeps read-only settings status indicators on the shared badge primitive', () => {
+ expect(statusIndicatorBadgeSource).toContain('getSimpleStatusIndicator');
+ expect(statusIndicatorBadgeSource).toContain('getStatusIndicatorBadgeToneClasses');
+ expect(statusIndicatorBadgeSource).toContain('StatusDot');
+
+ expect(agentProfilesPanelSource).toContain('StatusIndicatorBadge');
+ expect(agentProfilesPanelSource).not.toContain('getStatusIndicatorBadgeToneClasses');
+
+ expect(diagnosticsResultsPanelSource).toContain('StatusIndicatorBadge');
+ expect(diagnosticsResultsPanelSource).not.toContain('const StatusBadge');
+ expect(diagnosticsResultsPanelSource).not.toContain('getStatusIndicatorBadgeToneClasses');
+ });
});
diff --git a/frontend-modern/src/components/Settings/useAgentProfilesPanelState.ts b/frontend-modern/src/components/Settings/useAgentProfilesPanelState.ts
index 14468aa8ed..742452e776 100644
--- a/frontend-modern/src/components/Settings/useAgentProfilesPanelState.ts
+++ b/frontend-modern/src/components/Settings/useAgentProfilesPanelState.ts
@@ -40,7 +40,6 @@ import {
} from '@/utils/resourceIdentity';
import {
getAgentStatusIndicator,
- getStatusIndicatorBadgeToneClasses,
isConnectedHealthStatus,
} from '@/utils/status';
@@ -342,7 +341,6 @@ export const useAgentProfilesPanelState = () => {
getProfileById,
getProfileOptionLabel,
getSettingsCount,
- getStatusIndicatorBadgeToneClasses,
getUpgradeActionDestination,
getUpgradeActionButtonClass,
handleAssign,
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 712ca56cb1..16784dfa48 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -42,6 +42,7 @@ import searchInputModelSource from '@/components/shared/searchInputModel.ts?raw'
import statusDotSource from '@/components/shared/StatusDot.tsx?raw';
import statusBadgeSource from '@/components/shared/StatusBadge.tsx?raw';
import statusBadgeModelSource from '@/components/shared/statusBadgeModel.ts?raw';
+import statusIndicatorBadgeSource from '@/components/shared/StatusIndicatorBadge.tsx?raw';
import discoveryReadinessBadgeSource from '@/components/shared/DiscoveryReadinessBadge.tsx?raw';
import subtabsSource from '@/components/shared/Subtabs.tsx?raw';
import toggleSource from '@/components/shared/Toggle.tsx?raw';
@@ -1362,6 +1363,59 @@ describe('shared primitive guardrails', () => {
expect(statusBadgeModelSource).toContain("labelEnabled ?? 'Enabled'");
});
+ it('keeps read-only status indicator badges on the shared shell template', () => {
+ const registry = JSON.parse(sharedTemplateRegistrySource) as {
+ rules?: Array<{
+ id: string;
+ canonical?: { path?: string; export?: string };
+ requiredConsumers?: Array<{ path?: string }>;
+ }>;
+ patternGuards?: Array<{
+ id: string;
+ canonical?: { path?: string; export?: string };
+ allPatterns?: string[];
+ scopes?: string[];
+ allowedPaths?: string[];
+ ignoredPaths?: string[];
+ }>;
+ };
+ const registeredRule = registry.rules?.find(
+ (rule) => rule.id === 'status-indicator-badge-shell',
+ );
+ const registeredGuard = registry.patternGuards?.find(
+ (guard) => guard.id === 'status-indicator-badge-local-tone-helper',
+ );
+
+ expect(registeredRule?.canonical?.path).toBe(
+ 'src/components/shared/StatusIndicatorBadge.tsx',
+ );
+ expect(registeredRule?.canonical?.export).toBe('StatusIndicatorBadge');
+ expect(registeredRule?.requiredConsumers?.map((consumer) => consumer.path)).toEqual([
+ 'src/components/Settings/AgentProfilesPanel.tsx',
+ 'src/components/Settings/DiagnosticsResultsPanel.tsx',
+ ]);
+ expect(registeredGuard?.canonical?.path).toBe(
+ 'src/components/shared/StatusIndicatorBadge.tsx',
+ );
+ expect(registeredGuard?.canonical?.export).toBe('StatusIndicatorBadge');
+ expect(registeredGuard?.allPatterns).toEqual(['getStatusIndicatorBadgeToneClasses(']);
+ expect(registeredGuard?.scopes).toEqual(['src/components', 'src/features']);
+ expect(registeredGuard?.allowedPaths ?? []).toHaveLength(0);
+ expect(registeredGuard?.ignoredPaths).toEqual([
+ 'src/components/shared/SharedPrimitives.guardrails.test.ts',
+ ]);
+
+ expect(statusIndicatorBadgeSource).toContain('getSimpleStatusIndicator');
+ expect(statusIndicatorBadgeSource).toContain('getStatusIndicatorBadgeToneClasses');
+ expect(statusIndicatorBadgeSource).toContain('StatusDot');
+ expect(statusIndicatorBadgeSource).toContain('STATUS_INDICATOR_BADGE_SHAPE_CLASSES');
+ expect(agentProfilesPanelSource).toContain('StatusIndicatorBadge');
+ expect(agentProfilesPanelSource).not.toContain('getStatusIndicatorBadgeToneClasses');
+ expect(diagnosticsResultsPanelSource).toContain('StatusIndicatorBadge');
+ expect(diagnosticsResultsPanelSource).not.toContain('const StatusBadge');
+ expect(diagnosticsResultsPanelSource).not.toContain('getStatusIndicatorBadgeToneClasses');
+ });
+
it('keeps resource status dots on the shared StatusDot primitive', () => {
const registry = JSON.parse(sharedTemplateRegistrySource) as {
rules?: Array<{
@@ -1386,7 +1440,7 @@ describe('shared primitive guardrails', () => {
expect(registeredRule?.canonical?.path).toBe('src/components/shared/StatusDot.tsx');
expect(registeredRule?.canonical?.export).toBe('StatusDot');
expect(registeredRule?.requiredConsumers?.map((consumer) => consumer.path)).toEqual([
- 'src/components/Settings/DiagnosticsResultsPanel.tsx',
+ 'src/components/shared/StatusIndicatorBadge.tsx',
'src/components/Settings/ResourcePicker.tsx',
'src/components/Storage/StoragePoolDetail.tsx',
'src/components/shared/NodeGroupHeader.tsx',
@@ -1414,6 +1468,7 @@ describe('shared primitive guardrails', () => {
expect(statusDotSource).toContain('const VARIANT_CLASSES');
expect(statusDotSource).toContain("warning: 'bg-amber-500 dark:bg-amber-400'");
expect(statusDotSource).toContain('aria-hidden={ariaHidden()}');
+ expect(statusIndicatorBadgeSource).toContain('StatusDot');
expect(storagePoolDetailSource).toContain('StatusDot');
expect(storagePoolDetailSource).toContain('getLinkedDiskHealthDotVariant');
expect(storagePoolDetailSource).not.toContain('getLinkedDiskHealthDotClass');
@@ -1421,7 +1476,7 @@ describe('shared primitive guardrails', () => {
expect(storagePoolDetailSource).not.toContain('h-2 w-2 rounded-full bg-green-500');
for (const source of [
- diagnosticsResultsPanelSource,
+ statusIndicatorBadgeSource,
resourcePickerSource,
storagePoolDetailSource,
nodeGroupHeaderSource,
diff --git a/frontend-modern/src/components/shared/StatusIndicatorBadge.test.tsx b/frontend-modern/src/components/shared/StatusIndicatorBadge.test.tsx
new file mode 100644
index 0000000000..2631810ab2
--- /dev/null
+++ b/frontend-modern/src/components/shared/StatusIndicatorBadge.test.tsx
@@ -0,0 +1,37 @@
+import { afterEach, describe, expect, it } from 'vitest';
+import { cleanup, render, screen } from '@solidjs/testing-library';
+import { StatusIndicatorBadge } from '@/components/shared/StatusIndicatorBadge';
+
+afterEach(cleanup);
+
+describe('StatusIndicatorBadge', () => {
+ it('renders canonical read-only health badge presentation from status text', () => {
+ render(() => <StatusIndicatorBadge status="online" dot uppercase size="xs" />);
+
+ const badge = screen.getByText('Online');
+ expect(badge).toHaveClass('inline-flex');
+ expect(badge).toHaveClass('rounded-full');
+ expect(badge).toHaveClass('text-[10px]');
+ expect(badge).toHaveClass('uppercase');
+ expect(badge).toHaveClass('bg-green-100');
+ expect(badge.querySelector('[aria-hidden="true"]')).toHaveClass('bg-emerald-500');
+ });
+
+ it('renders custom state labels without forcing a dot or uppercase text', () => {
+ render(() => (
+ <StatusIndicatorBadge
+ variant="warning"
+ label="Cooldown: Missing"
+ size="md"
+ shape="rounded"
+ />
+ ));
+
+ const badge = screen.getByText('Cooldown: Missing');
+ expect(badge).toHaveClass('rounded');
+ expect(badge).toHaveClass('py-1');
+ expect(badge).toHaveClass('bg-amber-100');
+ expect(badge.querySelector('[aria-hidden="true"]')).toBeNull();
+ expect(badge).not.toHaveClass('uppercase');
+ });
+});
diff --git a/frontend-modern/src/components/shared/StatusIndicatorBadge.tsx b/frontend-modern/src/components/shared/StatusIndicatorBadge.tsx
new file mode 100644
index 0000000000..97179c12ec
--- /dev/null
+++ b/frontend-modern/src/components/shared/StatusIndicatorBadge.tsx
@@ -0,0 +1,69 @@
+import { createMemo, type JSX } from 'solid-js';
+import { StatusDot } from '@/components/shared/StatusDot';
+import {
+ getSimpleStatusIndicator,
+ getStatusIndicatorBadgeToneClasses,
+ type StatusIndicatorVariant,
+} from '@/utils/status';
+
+type StatusIndicatorBadgeSize = 'xs' | 'sm' | 'md';
+type StatusIndicatorBadgeShape = 'pill' | 'rounded';
+
+interface StatusIndicatorBadgeProps {
+ status?: string | null;
+ variant?: StatusIndicatorVariant;
+ label?: string;
+ size?: StatusIndicatorBadgeSize;
+ shape?: StatusIndicatorBadgeShape;
+ dot?: boolean;
+ uppercase?: boolean;
+ title?: string;
+ class?: string;
+}
+
+const STATUS_INDICATOR_BADGE_BASE_CLASS = 'inline-flex items-center gap-1 font-medium';
+const STATUS_INDICATOR_BADGE_SIZE_CLASSES: Record<StatusIndicatorBadgeSize, string> = {
+ xs: 'px-2 py-0.5 text-[10px]',
+ sm: 'px-2 py-0.5 text-xs',
+ md: 'px-2 py-1 text-xs',
+};
+const STATUS_INDICATOR_BADGE_SHAPE_CLASSES: Record<StatusIndicatorBadgeShape, string> = {
+ pill: 'rounded-full',
+ rounded: 'rounded',
+};
+
+export function StatusIndicatorBadge(props: StatusIndicatorBadgeProps): JSX.Element {
+ const indicator = createMemo(() => getSimpleStatusIndicator(props.status));
+ const variant = () => props.variant ?? indicator().variant;
+ const label = () => props.label ?? indicator().label;
+ const size = () => props.size ?? 'sm';
+ const shape = () => props.shape ?? 'pill';
+ const uppercaseClass = () => (props.uppercase ? 'uppercase tracking-wide' : '');
+ const className = () =>
+ [
+ STATUS_INDICATOR_BADGE_BASE_CLASS,
+ STATUS_INDICATOR_BADGE_SHAPE_CLASSES[shape()],
+ STATUS_INDICATOR_BADGE_SIZE_CLASSES[size()],
+ uppercaseClass(),
+ getStatusIndicatorBadgeToneClasses(variant()),
+ props.class ?? '',
+ ]
+ .filter(Boolean)
+ .join(' ');
+
+ return (
+ <span class={className()} title={props.title}>
+ {props.dot ? (
+ <StatusDot
+ variant={variant()}
+ size="xs"
+ ariaHidden={true}
+ class="translate-y-[0.5px]"
+ />
+ ) : null}
+ {label()}
+ </span>
+ );
+}
+
+export default StatusIndicatorBadge;
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index a32d8ac9b5..2b0aa3b4dc 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -3423,7 +3423,8 @@ describe('frontend resource type boundaries', () => {
expect(diagnosticsPanelSource).not.toContain(
"'bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300'",
);
- expect(diagnosticsResultsPanelSource).toContain('getStatusIndicatorBadgeToneClasses(');
+ expect(diagnosticsResultsPanelSource).toContain('StatusIndicatorBadge');
+ expect(diagnosticsResultsPanelSource).not.toContain('getStatusIndicatorBadgeToneClasses(');
expect(diagnosticsResultsPanelSource).toContain('DIAGNOSTICS_EMPTY_PBS_MESSAGE');
expect(diagnosticsResultsPanelSource).toContain('DIAGNOSTICS_EMPTY_STATE_COPY');
expect(diagnosticsStateSource).toContain('export const useDiagnosticsPanelState =');