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.

Promote tag badges to shared primitive

rcourtman4be8deb6726e
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index b8f515d293..0b198ffbde 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -137,6 +137,11 @@ The subsystem registry now also requires explicit proof-policy coverage for all
shared runtime files, and shared-component guardrails fail if raw table
composition is reintroduced in new shared components outside the canonical
allowlist.
+`frontend-modern/src/components/shared/TagBadges.tsx` is now also the
+canonical tag-badge primitive. Dashboard workload rows and the unified-resource
+detail drawer must import that shared owner instead of keeping a dashboard-local
+tag badge variant or importing a feature-local path into infrastructure
+surfaces.
The system logs operations surface now follows the same shell/runtime split as
the other modernized settings panels: `frontend-modern/src/components/Settings/SystemLogsPanel.tsx`
owns the operations framing and presentation helpers, while
diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
index de4b763a21..00717a9827 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -156,6 +156,11 @@ and the canonical row contract and per-row hot-path derivations live in
identity, column, cell-tooltip, anomaly-correlation, and link-state changes
must extend through those owners instead of rebuilding row-local state inside
the shell.
+That shell now also routes tag-dot rendering through the shared
+`frontend-modern/src/components/shared/TagBadges.tsx` primitive instead of
+keeping a dashboard-local badge helper. Future guest-row tag presentation
+changes must extend through that shared owner rather than reintroducing a
+dashboard-only tag-badge variant.
The dashboard guest drawer now follows that same ownership rule: the shell
stays in `frontend-modern/src/components/Dashboard/GuestDrawer.tsx`, the
overview card surface lives in
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index 9c7d362ec3..6d3607c036 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -2088,6 +2088,7 @@
"frontend-modern/src/components/shared/__tests__/PulseDataGrid.test.tsx",
"frontend-modern/src/components/shared/__tests__/SearchField.test.tsx",
"frontend-modern/src/components/shared/__tests__/SearchInput.test.tsx",
+ "frontend-modern/src/components/shared/__tests__/TagBadges.test.tsx",
"frontend-modern/src/components/shared/__tests__/WhatsNewModal.test.tsx",
"frontend-modern/src/components/shared/ColumnPicker.test.tsx",
"frontend-modern/src/components/shared/FilterToolbar.test.tsx",
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index f97cebe1c9..9a3f25841e 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -196,6 +196,12 @@ The same surfaces now also render recent changes through the shared
`frontend-modern/src/components/Infrastructure/ResourceChangeSummary.tsx`
card, so canonical timeline wording and ordering stay governed by one
frontend feed instead of separate page-local loops.
+The unified-resource detail drawer now also routes resource-tag presentation
+through the shared `frontend-modern/src/components/shared/TagBadges.tsx`
+primitive instead of importing a dashboard-local badge helper into the
+resource surface. Future drawer tag presentation changes must extend through
+that shared primitive boundary rather than recreating tag-dot logic inside the
+drawer or pulling feature-local badge components across subsystem lines.
The same shared agent-resource module now also owns the canonical cluster-name
helpers, so Kubernetes context prefixes, Proxmox cluster labels, and
cluster-name fetch keys stay aligned instead of each surface rebuilding its
diff --git a/frontend-modern/src/components/Dashboard/GuestRow.tsx b/frontend-modern/src/components/Dashboard/GuestRow.tsx
index ec37496a61..8b262b74f6 100644
--- a/frontend-modern/src/components/Dashboard/GuestRow.tsx
+++ b/frontend-modern/src/components/Dashboard/GuestRow.tsx
@@ -3,7 +3,6 @@ import { useNavigate } from '@solidjs/router';
import type { VM } from '@/types/api';
import type { WorkloadGuest } from '@/types/workloads';
import { formatUptime, formatSpeed, getShortImageName } from '@/utils/format';
-import { TagBadges } from './TagBadges';
import { StackedDiskBar } from './StackedDiskBar';
import { StackedMemoryBar } from './StackedMemoryBar';
import {
@@ -15,6 +14,7 @@ import {
} from './GuestRowCells';
import { StatusDot } from '@/components/shared/StatusDot';
+import { TagBadges } from '@/components/shared/TagBadges';
import { resolveWorkloadType } from '@/utils/workloads';
import { EnhancedCPUBar } from '@/components/Dashboard/EnhancedCPUBar';
import { UpdateButton } from '@/components/shared/ContainerUpdateBadge';
diff --git a/frontend-modern/src/components/Dashboard/__tests__/GuestRow.test.tsx b/frontend-modern/src/components/Dashboard/__tests__/GuestRow.test.tsx
index 023114a922..8bde526387 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/GuestRow.test.tsx
+++ b/frontend-modern/src/components/Dashboard/__tests__/GuestRow.test.tsx
@@ -81,7 +81,7 @@ vi.mock('../StackedMemoryBar', () => ({
),
}));
-vi.mock('../TagBadges', () => ({
+vi.mock('@/components/shared/TagBadges', () => ({
TagBadges: (props: { tags: string[] }) => (
<div data-testid="tag-badges" data-count={props.tags.length} />
),
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
index 5559f293dc..9189a2b0cd 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
@@ -9,7 +9,7 @@ import type {
import { formatUptime, formatRelativeTime } from '@/utils/format';
import { StatusDot } from '@/components/shared/StatusDot';
import { Card } from '@/components/shared/Card';
-import { TagBadges } from '@/components/Dashboard/TagBadges';
+import { TagBadges } from '@/components/shared/TagBadges';
import { SystemInfoCard } from '@/components/shared/cards/SystemInfoCard';
import { HardwareCard } from '@/components/shared/cards/HardwareCard';
import { RootDiskCard } from '@/components/shared/cards/RootDiskCard';
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
index f29aa73737..e27ff067e4 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
@@ -3,6 +3,7 @@ import { fireEvent, render, screen, within } from '@solidjs/testing-library';
import discoveryTabSource from '@/components/Discovery/DiscoveryTab.tsx?raw';
import discoveryTabStateSource from '@/components/Discovery/useDiscoveryTabState.ts?raw';
+import resourceDetailDrawerSource from '@/components/Infrastructure/ResourceDetailDrawer.tsx?raw';
import type { Resource } from '@/types/resource';
import { ResourceDetailDrawer } from '@/components/Infrastructure/ResourceDetailDrawer';
@@ -108,6 +109,10 @@ describe('ResourceDetailDrawer change history section', () => {
expect(discoveryTabSource).not.toContain('getConnectedAgents(');
expect(discoveryTabSource).not.toContain('triggerDiscovery(');
expect(discoveryTabSource).not.toContain('updateDiscoveryNotes(');
+ expect(resourceDetailDrawerSource).toContain("from '@/components/shared/TagBadges'");
+ expect(resourceDetailDrawerSource).not.toContain(
+ "from '@/components/Dashboard/TagBadges'",
+ );
});
it('keeps compact timeline summary chips in overview while showing one embedded change history section', async () => {
diff --git a/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts b/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts
index 7e85b19a4c..1e1396d327 100644
--- a/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts
@@ -507,8 +507,8 @@ describe('monitored-system model guardrails', () => {
expect(aiSettingsPresentationSource).toContain('export function getAISettingsLoadingState');
expect(aiSettingsPresentationSource).toContain('export function getAISettingsLoadErrorMessage');
expect(aiSettingsPresentationSource).toContain('export function getAISettingsRetryLabel');
- expect(aiSettingsSource).toContain('SelectionCardGroup');
- expect(aiSettingsSource).toContain('variant="compact"');
+ expect(aiSettingsDialogsSource).toContain('SelectionCardGroup');
+ expect(aiSettingsDialogsSource).toContain('variant="compact"');
expect(updatesSettingsPanelSource).toContain('SelectionCardGroup');
expect(updatesSettingsPanelSource).toContain('variant="detail"');
expect(aiSettingsPresentationSource).toContain('export function getAIChatSessionsLoadingState');
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 07a6813ade..d4f2108ca7 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -3,7 +3,10 @@ import calloutCardSource from '@/components/shared/CalloutCard.tsx?raw';
import filterButtonGroupSource from '@/components/shared/FilterButtonGroup.tsx?raw';
import monitoredSystemLimitWarningBannerSource from '@/components/shared/MonitoredSystemLimitWarningBanner.tsx?raw';
import selectionCardGroupSource from '@/components/shared/SelectionCardGroup.tsx?raw';
-import aiSettingsSource from '@/components/Settings/AISettings.tsx?raw';
+import tagBadgesSource from '@/components/shared/TagBadges.tsx?raw';
+import guestRowSource from '@/components/Dashboard/GuestRow.tsx?raw';
+import resourceDetailDrawerSource from '@/components/Infrastructure/ResourceDetailDrawer.tsx?raw';
+import aiSettingsDialogsSource from '@/components/Settings/AISettingsDialogs.tsx?raw';
import generalSettingsPanelSource from '@/components/Settings/GeneralSettingsPanel.tsx?raw';
import proxmoxSettingsPanelSource from '@/components/Settings/ProxmoxSettingsPanel.tsx?raw';
import reportingPanelSource from '@/components/Settings/ReportingPanel.tsx?raw';
@@ -54,9 +57,9 @@ describe('shared primitive guardrails', () => {
expect(selectionCardGroupSource).toContain(
"type SelectionCardGroupVariant = 'compact' | 'detail'",
);
- expect(aiSettingsSource).toContain('SelectionCardGroup');
- expect(aiSettingsSource).toContain('variant="compact"');
- expect(aiSettingsSource).not.toContain(
+ expect(aiSettingsDialogsSource).toContain('SelectionCardGroup');
+ expect(aiSettingsDialogsSource).toContain('variant="compact"');
+ expect(aiSettingsDialogsSource).not.toContain(
'class={`p-3 rounded-md border-2 transition-all text-center',
);
expect(updatesSettingsPanelSource).toContain('SelectionCardGroup');
@@ -92,4 +95,14 @@ describe('shared primitive guardrails', () => {
'Install v6 Unified Agents',
);
});
+
+ it('keeps shared tag badges in the shared primitive boundary', () => {
+ expect(tagBadgesSource).toContain("from '@/components/shared/Tooltip'");
+ expect(guestRowSource).toContain("from '@/components/shared/TagBadges'");
+ expect(guestRowSource).not.toContain("from './TagBadges'");
+ expect(resourceDetailDrawerSource).toContain("from '@/components/shared/TagBadges'");
+ expect(resourceDetailDrawerSource).not.toContain(
+ "from '@/components/Dashboard/TagBadges'",
+ );
+ });
});
diff --git a/frontend-modern/src/components/Dashboard/TagBadges.tsx b/frontend-modern/src/components/shared/TagBadges.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/TagBadges.tsx
rename to frontend-modern/src/components/shared/TagBadges.tsx
diff --git a/frontend-modern/src/components/Dashboard/__tests__/TagBadges.test.tsx b/frontend-modern/src/components/shared/__tests__/TagBadges.test.tsx
similarity index 100%
rename from frontend-modern/src/components/Dashboard/__tests__/TagBadges.test.tsx
rename to frontend-modern/src/components/shared/__tests__/TagBadges.test.tsx
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index 6344500042..3e5f6d44e5 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -11,6 +11,7 @@ import resourceBadgesSource from '@/components/Infrastructure/resourceBadges.ts?
import infrastructureSummaryTableSource from '@/components/shared/InfrastructureSummaryTable.tsx?raw';
import resourceBadgePresentationSource from '@/utils/resourceBadgePresentation.ts?raw';
import workloadTypeBadgesSource from '@/components/shared/workloadTypeBadges.ts?raw';
+import tagBadgesSource from '@/components/shared/TagBadges.tsx?raw';
import emptyStateSource from '@/components/shared/EmptyState.tsx?raw';
import webInterfaceUrlFieldSource from '@/components/shared/WebInterfaceUrlField.tsx?raw';
import workloadTypePresentationSource from '@/utils/workloadTypePresentation.ts?raw';
@@ -597,6 +598,8 @@ describe('frontend resource type boundaries', () => {
expect(storageSummarySource).not.toContain("getOrgID() || 'default'");
expect(guestRowSource).toContain('useGuestRowState');
expect(guestRowSource).toContain("from './GuestRowCells'");
+ expect(guestRowSource).toContain("from '@/components/shared/TagBadges'");
+ expect(guestRowSource).not.toContain("from './TagBadges'");
expect(guestRowSource).not.toContain('const guestId = createMemo(');
expect(guestRowSource).not.toContain('function NetworkInfoCell(');
expect(guestRowSource).not.toContain('function OSInfoCell(');
@@ -606,6 +609,11 @@ describe('frontend resource type boundaries', () => {
expect(guestRowCellsSource).toContain('function OSInfoCell(');
expect(guestRowCellsSource).toContain('useTooltip');
expect(guestRowSource).not.toContain('buildGuestId');
+ expect(tagBadgesSource).toContain("from '@/components/shared/Tooltip'");
+ expect(resourceDetailDrawerShellSource).toContain("from '@/components/shared/TagBadges'");
+ expect(resourceDetailDrawerShellSource).not.toContain(
+ "from '@/components/Dashboard/TagBadges'",
+ );
expect(guestDrawerSource).toContain('useGuestDrawerState');
expect(guestDrawerSource).toContain('GuestDrawerOverview');
expect(guestDrawerStateSource).toContain('getCanonicalWorkloadId');
diff --git a/scripts/release_control/subsystem_lookup_test.py b/scripts/release_control/subsystem_lookup_test.py
index 21294a7e71..ede41eddd2 100644
--- a/scripts/release_control/subsystem_lookup_test.py
+++ b/scripts/release_control/subsystem_lookup_test.py
@@ -42,6 +42,30 @@ class SubsystemLookupTest(unittest.TestCase):
result = lookup_paths(["README.md"])
self.assertEqual(result["unowned_runtime_files"], ["README.md"])
+ def test_lookup_paths_assigns_shared_tag_badges_to_frontend_primitives(self) -> None:
+ result = lookup_paths(["frontend-modern/src/components/shared/TagBadges.tsx"])
+ self.assertEqual(result["unowned_runtime_files"], [])
+ self.assertEqual(
+ {item["subsystem"] for item in result["impacted_subsystems"]},
+ {"frontend-primitives"},
+ )
+ file_entry = result["files"][0]
+ self.assertEqual(file_entry["classification"], "runtime")
+ self.assertEqual(
+ {match["subsystem"] for match in file_entry["matches"]},
+ {"frontend-primitives"},
+ )
+ match = file_entry["matches"][0]
+ self.assertEqual(
+ match["contract"],
+ "docs/release-control/v6/internal/subsystems/frontend-primitives.md",
+ )
+ self.assertEqual(match["lane_context"]["lane_id"], "L8")
+ self.assertEqual(
+ match["verification_requirement"]["id"],
+ "shared-component-guardrails",
+ )
+
def test_lookup_paths_assigns_organization_billing_panel_to_cloud_paid(self) -> None:
result = lookup_paths(["frontend-modern/src/components/Settings/OrganizationBillingPanel.tsx"])
self.assertEqual(result["unowned_runtime_files"], [])