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 table card shell governance

rcourtman527514fd853c
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 2f0d4f90a4..1eb0ebd57c 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -2443,6 +2443,12 @@ Grouped/list table-mode controls are registry-backed as well.
`Grouped` / `List` labels, tooltip titles, and icons for table mode switching.
Resource surfaces must compose that primitive instead of copying grouped/list
segmented-control labels locally.
+Product table cards are registry-backed too. `TableCard` owns the shared
+bordered, no-padding, card-tone table frame, while `TableCardHeader` owns the
+title/action/clear chrome, clear button copy, aria label, and propagation
+containment for table-card headers. Product table surfaces must compose those
+primitives instead of recreating local overflow-hidden bordered wrappers or
+retired summary-table header aliases.
Inline detail table rows are also registry-backed. `InlineDetailTableRow`
owns the row/cell/content shell and row-click containment for platform,
workload, and infrastructure inline drawers; callers may pass row-specific
diff --git a/frontend-modern/scripts/shared-template-registry.json b/frontend-modern/scripts/shared-template-registry.json
index ef0b06bc84..f22ec10fbe 100644
--- a/frontend-modern/scripts/shared-template-registry.json
+++ b/frontend-modern/scripts/shared-template-registry.json
@@ -114,6 +114,47 @@
"scripts/shared-template-audit.mjs"
]
},
+ {
+ "id": "table-card-frame-shell",
+ "category": "table-card",
+ "summary": "Product table surfaces must compose TableCard for the shared card frame instead of recreating local overflow-hidden bordered table wrappers.",
+ "canonical": {
+ "path": "src/components/shared/TableCard.tsx",
+ "export": "TableCard"
+ },
+ "requiredConsumers": [
+ { "path": "src/components/Infrastructure/UnifiedResourceHostTableCard.tsx" },
+ { "path": "src/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsx" },
+ { "path": "src/components/Storage/StorageContentCard.tsx" },
+ { "path": "src/components/Workloads/WorkloadsSurface.tsx" },
+ { "path": "src/components/Workloads/WorkloadsTable.tsx" },
+ { "path": "src/features/alerts/AlertHistoryTableSection.tsx" },
+ { "path": "src/features/platformPage/sharedPlatformPage.tsx" }
+ ],
+ "proof": [
+ "src/components/shared/SharedPrimitives.guardrails.test.ts",
+ "scripts/shared-template-audit.mjs"
+ ]
+ },
+ {
+ "id": "table-card-header-shell",
+ "category": "table-card",
+ "summary": "Table-card headers must compose TableCardHeader for title/action/clear chrome instead of recreating local summary-table header aliases.",
+ "canonical": {
+ "path": "src/components/shared/TableCardHeader.tsx",
+ "export": "TableCardHeader"
+ },
+ "requiredConsumers": [
+ { "path": "src/components/Infrastructure/UnifiedResourceHostTableCard.tsx" },
+ { "path": "src/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsx" },
+ { "path": "src/components/Storage/StorageContentCard.tsx" },
+ { "path": "src/features/platformPage/sharedPlatformPage.tsx" }
+ ],
+ "proof": [
+ "src/components/shared/SharedPrimitives.guardrails.test.ts",
+ "scripts/shared-template-audit.mjs"
+ ]
+ },
{
"id": "platform-table-loading-state",
"category": "platform-table-loading-state",
@@ -373,6 +414,44 @@
"scripts/shared-template-audit.mjs"
]
},
+ {
+ "id": "table-card-frame-local-wrapper",
+ "category": "table-card",
+ "summary": "Product table surfaces must not copy the retired local bordered overflow-hidden table wrapper owned by TableCard.",
+ "canonical": {
+ "path": "src/components/shared/TableCard.tsx",
+ "export": "TableCard"
+ },
+ "scopes": ["src/components", "src/features", "src/pages"],
+ "extensions": [".tsx"],
+ "allPatterns": ["overflow-hidden border-border-subtle bg-surface"],
+ "legacyReason": "Retired migration debt. Product table frames must use TableCard; local bordered overflow-hidden table wrappers are not allowed.",
+ "allowedPaths": [],
+ "ignoredPaths": ["src/components/shared/SharedPrimitives.guardrails.test.ts"],
+ "proof": [
+ "src/components/shared/SharedPrimitives.guardrails.test.ts",
+ "scripts/shared-template-audit.mjs"
+ ]
+ },
+ {
+ "id": "table-card-header-local-summary-header",
+ "category": "table-card",
+ "summary": "Product table surfaces must not reintroduce the retired SummaryTableCardHeader local alias.",
+ "canonical": {
+ "path": "src/components/shared/TableCardHeader.tsx",
+ "export": "TableCardHeader"
+ },
+ "scopes": ["src/components", "src/features", "src/pages"],
+ "extensions": [".tsx"],
+ "allPatterns": ["SummaryTableCardHeader"],
+ "legacyReason": "Retired migration debt. Table-card title/action/clear chrome must use TableCardHeader; no local header aliases are allowed.",
+ "allowedPaths": [],
+ "ignoredPaths": ["src/components/shared/SharedPrimitives.guardrails.test.ts"],
+ "proof": [
+ "src/components/shared/SharedPrimitives.guardrails.test.ts",
+ "scripts/shared-template-audit.mjs"
+ ]
+ },
{
"id": "platform-table-loading-state-local-status-row",
"category": "platform-table-loading-state",
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 2d72f0f55f..4aff77fc6a 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -104,6 +104,7 @@ import truenasProtectionTableSource from '@/features/truenas/TrueNASProtectionTa
import vmwarePageSurfaceSource from '@/features/vmware/VmwarePageSurface.tsx?raw';
import upgradeNavigationSource from '@/utils/upgradeNavigation.ts?raw';
import guestRowSource from '@/components/Workloads/GuestRow.tsx?raw';
+import workloadsSurfaceSource from '@/components/Workloads/WorkloadsSurface.tsx?raw';
import workloadsTableSource from '@/components/Workloads/WorkloadsTable.tsx?raw';
import workloadPanelSource from '@/components/Workloads/WorkloadPanel.tsx?raw';
import guestRowStateSource from '@/components/Workloads/useGuestRowState.ts?raw';
@@ -461,6 +462,51 @@ describe('shared primitive guardrails', () => {
});
it('keeps shared table card chrome on one canonical header owner', () => {
+ 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 === 'table-card-header-shell',
+ );
+ const registeredGuard = registry.patternGuards?.find(
+ (guard) => guard.id === 'table-card-header-local-summary-header',
+ );
+
+ expect(registeredRule?.canonical?.path).toBe(
+ 'src/components/shared/TableCardHeader.tsx',
+ );
+ expect(registeredRule?.canonical?.export).toBe('TableCardHeader');
+ expect(registeredRule?.requiredConsumers?.map((consumer) => consumer.path)).toEqual([
+ 'src/components/Infrastructure/UnifiedResourceHostTableCard.tsx',
+ 'src/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsx',
+ 'src/components/Storage/StorageContentCard.tsx',
+ 'src/features/platformPage/sharedPlatformPage.tsx',
+ ]);
+ expect(registeredGuard?.canonical?.path).toBe(
+ 'src/components/shared/TableCardHeader.tsx',
+ );
+ expect(registeredGuard?.canonical?.export).toBe('TableCardHeader');
+ expect(registeredGuard?.allPatterns).toEqual(['SummaryTableCardHeader']);
+ expect(registeredGuard?.allowedPaths ?? []).toHaveLength(0);
+ expect(registeredGuard?.ignoredPaths).toEqual([
+ 'src/components/shared/SharedPrimitives.guardrails.test.ts',
+ ]);
+ expect(registeredGuard?.scopes).toEqual(
+ expect.arrayContaining(['src/components', 'src/features', 'src/pages']),
+ );
+
expect(tableCardHeaderSource).toContain('Clear selection');
expect(tableCardHeaderSource).toContain("props.clearLabel ?? 'Clear'");
expect(tableCardHeaderSource).toContain('props.clearAriaLabel ??');
@@ -480,6 +526,54 @@ describe('shared primitive guardrails', () => {
});
it('keeps framed product table surfaces on the shared TableCard owner', () => {
+ 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 === 'table-card-frame-shell',
+ );
+ const registeredGuard = registry.patternGuards?.find(
+ (guard) => guard.id === 'table-card-frame-local-wrapper',
+ );
+
+ expect(registeredRule?.canonical?.path).toBe(
+ 'src/components/shared/TableCard.tsx',
+ );
+ expect(registeredRule?.canonical?.export).toBe('TableCard');
+ expect(registeredRule?.requiredConsumers?.map((consumer) => consumer.path)).toEqual([
+ 'src/components/Infrastructure/UnifiedResourceHostTableCard.tsx',
+ 'src/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsx',
+ 'src/components/Storage/StorageContentCard.tsx',
+ 'src/components/Workloads/WorkloadsSurface.tsx',
+ 'src/components/Workloads/WorkloadsTable.tsx',
+ 'src/features/alerts/AlertHistoryTableSection.tsx',
+ 'src/features/platformPage/sharedPlatformPage.tsx',
+ ]);
+ expect(registeredGuard?.canonical?.path).toBe('src/components/shared/TableCard.tsx');
+ expect(registeredGuard?.canonical?.export).toBe('TableCard');
+ expect(registeredGuard?.allPatterns).toEqual([
+ 'overflow-hidden border-border-subtle bg-surface',
+ ]);
+ expect(registeredGuard?.allowedPaths ?? []).toHaveLength(0);
+ expect(registeredGuard?.ignoredPaths).toEqual([
+ 'src/components/shared/SharedPrimitives.guardrails.test.ts',
+ ]);
+ expect(registeredGuard?.scopes).toEqual(
+ expect.arrayContaining(['src/components', 'src/features', 'src/pages']),
+ );
+
expect(tableCardSource).toContain("export const TABLE_CARD_FRAME_CLASS = 'overflow-hidden'");
expect(tableCardSource).toContain("Omit<CardProps, 'border' | 'padding' | 'tone'>");
expect(tableCardSource).toContain('border={true}');
@@ -489,6 +583,9 @@ describe('shared primitive guardrails', () => {
for (const source of [
workloadsTableSource,
+ workloadsSurfaceSource,
+ alertHistoryTableSectionSource,
+ sharedPlatformPageSource,
unifiedResourceHostTableCardSource,
unifiedResourceServiceInfrastructureCardSource,
storageContentCardSource,