From cc5954ecd963ffa906dff4a74946922cc58de080 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Mon, 23 Mar 2026 11:44:12 +0000 Subject: [PATCH] Simplify drawer host detail summary --- .../internal/subsystems/unified-resources.md | 2 ++ ...urceDetailDrawer.identity-runtime.test.tsx | 4 +--- ...sourceDetailDrawerOperationalModel.test.ts | 2 +- .../resourceDetailDrawerOperationalModel.ts | 22 ++++++++++++++----- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md index 3b35d0da9..ac6311336 100644 --- a/docs/release-control/v6/internal/subsystems/unified-resources.md +++ b/docs/release-control/v6/internal/subsystems/unified-resources.md @@ -498,6 +498,8 @@ read side by side on wider screens instead of as a single full-width stack. Host details uses that same flex-wrap pattern inside the disclosure for the system, hardware, storage, and network cards, so the drawer matches the shared workload-card density instead of stretching those cards one per row. +The collapsed `Host details` summary now names the available categories only, +instead of exposing internal card counts in the disclosure label. When `Service details` is expanded, each service card remains summary-first and pushes heavier breakdowns or update controls behind one more service-local reveal, so the opened state still scans as current state before deeper diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx index 4ad000f24..53de7dbb5 100644 --- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx +++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx @@ -214,9 +214,7 @@ describe('ResourceDetailDrawer runtime and identity cards', () => { )); expect(getByText('Host details')).toBeInTheDocument(); - expect( - getByText('4 detail cards covering system, hardware, network, and disks.'), - ).toBeInTheDocument(); + expect(getByText('System, Hardware, Network, and Disks')).toBeInTheDocument(); expect(queryByText('Hardware')).toBeNull(); expect(queryByText('Network')).toBeNull(); diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts index 9f0b7a7c1..f26690710 100644 --- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts +++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts @@ -116,7 +116,7 @@ describe('resourceDetailDrawerOperationalModel', () => { 'temperatures', ]); expect(buildHostDetailSummary(cards)).toBe( - '8 detail cards covering system, hardware, storage, network, disks, and temperatures.', + 'System, Hardware, Storage, Network, Disks, and Temperatures', ); expect(hasRuntimeOperationalContext([], [])).toBe(false); }); diff --git a/frontend-modern/src/components/Infrastructure/resourceDetailDrawerOperationalModel.ts b/frontend-modern/src/components/Infrastructure/resourceDetailDrawerOperationalModel.ts index 9fbdd7b5d..4e7a8f2ca 100644 --- a/frontend-modern/src/components/Infrastructure/resourceDetailDrawerOperationalModel.ts +++ b/frontend-modern/src/components/Infrastructure/resourceDetailDrawerOperationalModel.ts @@ -155,15 +155,25 @@ export const buildHostDetailCards = (options: { export const buildHostDetailSummary = (hostDetailCards: string[]): string | null => { const labels = Array.from(new Set(hostDetailCards)); if (labels.length === 0) return null; + const presentation: Record = { + system: 'System', + hardware: 'Hardware', + storage: 'Storage', + network: 'Network', + disks: 'Disks', + raid: 'RAID', + temperatures: 'Temperatures', + }; + const displayLabels = labels.map((label) => presentation[label] ?? label); const categories = - labels.length === 1 - ? labels[0] - : labels.length === 2 - ? `${labels[0]} and ${labels[1]}` - : `${labels.slice(0, -1).join(', ')}, and ${labels[labels.length - 1]}`; + displayLabels.length === 1 + ? displayLabels[0] + : displayLabels.length === 2 + ? `${displayLabels[0]} and ${displayLabels[1]}` + : `${displayLabels.slice(0, -1).join(', ')}, and ${displayLabels[displayLabels.length - 1]}`; - return `${hostDetailCards.length} detail card${hostDetailCards.length === 1 ? '' : 's'} covering ${categories}.`; + return categories; }; export const buildRelatedLinks = (