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.

refactor(recovery): remove counts from workspace tabs

rcourtman40a338d01272
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 0c14763671..dbb9c76d04 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -756,10 +756,12 @@ status strip above the control bar. Recovery should use the same handoff shape
as storage: one canonical `Subtabs.tsx` row first, then one shared page-controls
card, then the active data card, instead of burying the workspace switcher
inside the filter row or table-card header.
-That same strip should not repeat the broad stale or never-succeeded posture
-counts once the summary already owns those signals. The protected-items control
-row should stay focused on workspace navigation, drill-in context, and active
-filters instead of echoing page-wide posture pills above the same table.
+That same strip should not repeat page-level counts or posture cues once the
+summary already owns those signals. The recovery workspace tabs should stay on
+plain canonical labels like `Protected items` and `Recovery events` rather than
+embedding per-view totals in the tab text, and the protected-items control row
+should stay focused on navigation, drill-in context, and active filters instead
+of echoing page-wide posture pills above the same table.
That same workspace handoff should stay on shared primitive styling too. When
recovery renders its workspace tabs, the switcher should use the same canonical
shared `Subtabs.tsx` shell, list, and button class pattern already used by
diff --git a/frontend-modern/src/components/Recovery/Recovery.tsx b/frontend-modern/src/components/Recovery/Recovery.tsx
index c2c4db299d..a4d8cdba59 100644
--- a/frontend-modern/src/components/Recovery/Recovery.tsx
+++ b/frontend-modern/src/components/Recovery/Recovery.tsx
@@ -489,18 +489,17 @@ const Recovery: Component = () => {
return (
<>
<Subtabs
- class="w-full"
value={workspaceView()}
onChange={(value) => setWorkspaceView(value as RecoveryWorkspaceView)}
ariaLabel="Recovery data view"
tabs={[
{
value: 'inventory',
- label: `Protected items ${filteredRollups().length}`,
+ label: 'Protected items',
},
{
value: 'events',
- label: `Recovery events ${recoveryPoints.meta().total}`,
+ label: 'Recovery events',
},
]}
/>
diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
index 5631bb0c3a..c9289876c9 100644
--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
@@ -204,8 +204,10 @@ describe('Recovery', () => {
expect(await screen.findByTestId('recovery-summary')).toBeInTheDocument();
expect(screen.getByText('Recovery Posture')).toBeInTheDocument();
const workspaceTablist = await screen.findByRole('tablist', { name: /recovery data view/i });
- expect(within(workspaceTablist).getByRole('tab', { name: /protected items 2/i })).toBeInTheDocument();
- expect(within(workspaceTablist).getByRole('tab', { name: /recovery events 0/i })).toBeInTheDocument();
+ expect(within(workspaceTablist).getByRole('tab', { name: 'Protected items' })).toBeInTheDocument();
+ expect(within(workspaceTablist).getByRole('tab', { name: 'Recovery events' })).toBeInTheDocument();
+ expect(within(workspaceTablist).queryByRole('tab', { name: /protected items \d/i })).not.toBeInTheDocument();
+ expect(within(workspaceTablist).queryByRole('tab', { name: /recovery events \d/i })).not.toBeInTheDocument();
expect(screen.queryByText('Focused drill-in')).not.toBeInTheDocument();
await screen.findByText('VM 123');
const inventoryControls = screen.getByRole('group', { name: /protected items controls/i });
@@ -216,12 +218,12 @@ describe('Recovery', () => {
expect(within(inventoryControls).queryByText(/never succeeded/i)).not.toBeInTheDocument();
expect(
within(workspaceTablist)
- .getByRole('tab', { name: /protected items 2/i })
+ .getByRole('tab', { name: 'Protected items' })
.className,
).toContain('border-b-2');
expect(
within(workspaceTablist)
- .getByRole('tab', { name: /protected items 2/i })
+ .getByRole('tab', { name: 'Protected items' })
.className,
).not.toContain('rounded-md');
expect(screen.queryByText('Protected inventory')).not.toBeInTheDocument();
@@ -291,8 +293,8 @@ describe('Recovery', () => {
const historySearch = within(historyControls).getByPlaceholderText('Search recovery history...');
expect(historySearch).toBeInTheDocument();
expect(historySearch.closest('div.relative')?.className).toContain('w-full');
- expect(within(historyTablist).getByRole('tab', { name: /protected items 2/i })).toBeInTheDocument();
- expect(within(historyTablist).getByRole('tab', { name: /recovery events 1/i })).toBeInTheDocument();
+ expect(within(historyTablist).getByRole('tab', { name: 'Protected items' })).toBeInTheDocument();
+ expect(within(historyTablist).getByRole('tab', { name: 'Recovery events' })).toBeInTheDocument();
expect(within(historyControls).getByText(/^1 day group$/i)).toBeInTheDocument();
expect(screen.getAllByText(/^1 event$/i)).toHaveLength(1);
expect(screen.getAllByText(/^1 day group$/i)).toHaveLength(1);