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): separate workspace tabs from data cards

rcourtman49acc693af48
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 536e01aac6..1ae10cd925 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -714,6 +714,9 @@ That same orientation-first rule also applies at the page-shell boundary:
recovery should hand straight from the summary strip into the active workspace
card without an extra page-local spacer band that makes the shell feel softer
than storage or workloads.
+That same storage-style page rhythm also applies to the workspace tabs:
+`Protected items` / `Recovery events` should live as a standalone subtab row
+above the active section, not inside the data card itself.
That same card-level scan rule should prefer one dominant metric per card with
short supporting readouts, the same quick-scan rhythm operators already get on
infrastructure and workloads, instead of nested sub-cards that turn recovery
diff --git a/frontend-modern/src/components/Recovery/Recovery.tsx b/frontend-modern/src/components/Recovery/Recovery.tsx
index c43d466786..384368dc00 100644
--- a/frontend-modern/src/components/Recovery/Recovery.tsx
+++ b/frontend-modern/src/components/Recovery/Recovery.tsx
@@ -554,7 +554,9 @@ const Recovery: Component = () => {
timeRange={summaryRange}
/>
- <div ref={historySectionRef} class="flex flex-col">
+ {workspaceControls()}
+
+ <div ref={historySectionRef} class="flex flex-col gap-2">
{(() => {
return (
<>
@@ -582,14 +584,12 @@ const Recovery: Component = () => {
setPlatformFilter={setPlatformFilter}
setQueryFilter={setQueryFilter}
setVerificationFilter={setVerificationFilter}
- workspaceControls={workspaceControls()}
/>
</Show>
<Show when={workspaceView() === 'events'}>
<Show when={!recoveryPoints.response.loading && recoveryPoints.response.error}>
<Card padding="none" tone="card" class="overflow-hidden border-border-subtle bg-surface">
- {workspaceControls()}
<div class="border-b border-border-subtle">{eventsActivity()}</div>
<div class="p-6">
<EmptyState
@@ -650,7 +650,6 @@ const Recovery: Component = () => {
tableMinWidth={tableMinWidth}
totalPages={totalPages}
verificationFilter={verificationFilter}
- workspaceControls={workspaceControls()}
workspaceIntro={eventsActivity()}
/>
</Show>
diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
index d8e7c043e3..bcd7d7cb47 100644
--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
@@ -204,7 +204,9 @@ describe('Recovery', () => {
expect(screen.getByTestId('recovery-page').className).toContain('gap-2');
expect(screen.getByTestId('recovery-page').className).not.toContain('gap-3');
- expect(await screen.findByTestId('recovery-summary')).toBeInTheDocument();
+ const recoveryPage = screen.getByTestId('recovery-page');
+ const summaryPanel = await screen.findByTestId('recovery-summary');
+ expect(summaryPanel).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' })).toBeInTheDocument();
@@ -241,12 +243,14 @@ describe('Recovery', () => {
expect(screen.getAllByRole('table')).toHaveLength(1);
});
const inventoryTable = screen.getAllByRole('table')[0];
- const inventoryWorkspaceCard = workspaceTablist.closest('.overflow-hidden');
const inventoryBody = inventoryTable.querySelector('tbody');
- expect(inventoryWorkspaceCard).not.toBeNull();
- expect(inventoryWorkspaceCard).toContainElement(workspaceTablist);
- expect(inventoryWorkspaceCard).toContainElement(inventoryControls);
- expect(inventoryWorkspaceCard).toContainElement(inventoryTable);
+ expect(recoveryPage).toContainElement(summaryPanel);
+ expect(recoveryPage).toContainElement(workspaceTablist);
+ expect(recoveryPage).toContainElement(inventoryControls);
+ expect(recoveryPage).toContainElement(inventoryTable);
+ expect(
+ summaryPanel.compareDocumentPosition(workspaceTablist) & Node.DOCUMENT_POSITION_FOLLOWING,
+ ).not.toBe(0);
expect(
workspaceTablist.compareDocumentPosition(inventoryControls) & Node.DOCUMENT_POSITION_FOLLOWING,
).not.toBe(0);
@@ -297,9 +301,9 @@ describe('Recovery', () => {
const historyControls = screen.getByRole('group', { name: /recovery events controls/i });
const historyTablist = screen.getByRole('tablist', { name: /recovery data view/i });
const activityBars = screen.getByTestId('recovery-activity-bars');
- const eventsWorkspaceCard = historyTablist.closest('.overflow-hidden');
- expect(eventsWorkspaceCard).not.toBeNull();
- expect(eventsWorkspaceCard).toContainElement(historyTablist);
+ expect(recoveryPage).toContainElement(historyTablist);
+ expect(recoveryPage).toContainElement(historyControls);
+ expect(recoveryPage).toContainElement(historyTable);
expect(
historyTablist.compareDocumentPosition(historyControls) & Node.DOCUMENT_POSITION_FOLLOWING,
).not.toBe(0);
@@ -310,9 +314,7 @@ describe('Recovery', () => {
).not.toBeInTheDocument();
expect(screen.queryByText(/^Range$/)).not.toBeInTheDocument();
expect(screen.queryByText(/\/ day/i)).not.toBeInTheDocument();
- expect(eventsWorkspaceCard).toContainElement(activityHeading);
- expect(eventsWorkspaceCard).toContainElement(historyControls);
- expect(eventsWorkspaceCard).toContainElement(historyTable);
+ expect(recoveryPage).toContainElement(activityHeading);
expect(
activityHeading.compareDocumentPosition(historyControls) & Node.DOCUMENT_POSITION_FOLLOWING,
).not.toBe(0);