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): keep timeline in events workspace

rcourtman14ee0d4e98e7
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 2298f3d05b..b30a619077 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -489,11 +489,13 @@ inside the table shell itself. `RecoveryProtectedInventorySection.tsx` should
expose the current bounded range, page, and sort state near the primary grid,
and the first column should carry enough secondary item metadata to read as a
monitored inventory row rather than a bare export line.
-That same hierarchy rule also applies to the activity panel below the primary
-workspace. `RecoveryActivitySection.tsx` should read as timeline analysis for
-the selected history window, not as a second copy of the page-level posture
-summary, so its framing should emphasize recovery-point cadence and focused
-history context rather than re-announcing the full protected-estate health mix.
+That same hierarchy rule also applies to the activity timeline. The governed
+recovery surface should not append `RecoveryActivitySection.tsx` underneath the
+default protected-items view as if trend telemetry were a second page bolted
+onto inventory. The timeline owns recovery-event day selection, so it belongs
+inside the `Recovery events` workspace and should read as history analysis for
+the selected window rather than as a second copy of the page-level posture
+summary.
The same owned vocabulary applies to recovery events as well:
`frontend-modern/src/utils/recoveryTablePresentation.ts` must keep the
history-table `type` column labeled as `Item Type` within recovery surfaces so
@@ -636,12 +638,13 @@ forcing each UI surface to re-derive protected item classes from raw
provider-native `subjectType` values.
That same recovery product surface keeps the primary workspace visually ahead
of secondary analytics: once the summary frame ends,
-`frontend-modern/src/components/Recovery/Recovery.tsx` must lead into the
-route-backed recovery workspace and its protected-item or recovery-event table
-surface before it drops into `RecoveryActivitySection`, so operators reach the
-main control surface ahead of trend telemetry. The activity timeline remains
-required even when point-history loading fails, but it is secondary to the
-workspace rather than a competing top-of-page peer.
+`frontend-modern/src/components/Recovery/Recovery.tsx` must lead directly into
+the route-backed recovery workspace, with protected-items defaulting straight
+to the primary inventory table and recovery-events owning both the activity
+timeline and the event table together. The activity timeline remains required
+even when point-history loading fails, but it belongs to the events workspace
+rather than hanging below the inventory workspace as a competing page-level
+peer.
That same recovery product surface must also stay stylistically aligned with
established Pulse monitoring surfaces once shared primitives already exist.
`frontend-modern/src/components/Recovery/RecoverySummary.tsx` should compose
diff --git a/frontend-modern/src/components/Recovery/Recovery.tsx b/frontend-modern/src/components/Recovery/Recovery.tsx
index dc4a4a325a..d656411444 100644
--- a/frontend-modern/src/components/Recovery/Recovery.tsx
+++ b/frontend-modern/src/components/Recovery/Recovery.tsx
@@ -537,119 +537,121 @@ const Recovery: Component = () => {
/>
</Show>
- <Show when={workspaceView() === 'events' && !recoveryPoints.response.loading && recoveryPoints.response.error}>
- <Card padding="sm">
- <EmptyState
- title={getRecoveryPointsFailureState().title}
- description={String(
- (recoveryPoints.response.error as Error)?.message || recoveryPoints.response.error,
- )}
- />
- </Card>
- </Show>
-
- <Show when={workspaceView() === 'events' && !recoveryPoints.response.error}>
- <RecoveryHistorySection
- activeAdvancedFilterCount={activeAdvancedFilterCount}
- artifactColumnVisibility={artifactColumnVisibility}
- availableOutcomes={['all', 'success', 'warning', 'failed', 'running']}
- clusterFilter={clusterFilter}
- clusterOptions={clusterOptions}
- currentPage={currentPage}
- groupedByDay={groupedByDay}
- hasActiveArtifactFilters={hasActiveArtifactFilters}
- historyOutcomeFilter={historyOutcomeFilter}
+ <Show when={workspaceView() === 'events'}>
+ <RecoveryActivitySection
+ activitySummary={activitySummary}
+ activeClusterLabel={activeClusterLabel}
+ activeItemTypeLabel={activeItemTypeLabel}
+ activeNamespaceLabel={activeNamespaceLabel}
+ activeNodeLabel={activeNodeLabel}
+ chartRangeDays={chartRangeDays}
+ clearClusterFilter={() => {
+ setClusterFilter('all');
+ setCurrentPage(1);
+ }}
+ clearFocusedRollup={() => setRollupId('')}
+ clearItemTypeFilter={() => {
+ setItemTypeFilter('all');
+ setCurrentPage(1);
+ }}
+ clearNamespaceFilter={() => {
+ setNamespaceFilter('all');
+ setCurrentPage(1);
+ }}
+ clearNodeFilter={() => {
+ setNodeFilter('all');
+ setCurrentPage(1);
+ }}
+ clearSelectedDate={() => {
+ setSelectedDateKey(null);
+ setCurrentPage(1);
+ }}
+ hasFocusedRollup={() => rollupId().trim().length > 0}
isMobile={isMobile()}
- kioskMode={kioskMode()}
- mobileVisibleArtifactColumns={mobileVisibleArtifactColumns}
- modeFilter={modeFilter}
- itemTypeFilter={itemTypeFilter}
- itemTypeOptions={itemTypeOptions}
- namespaceFilter={namespaceFilter}
- namespaceOptions={namespaceOptions}
- nodeFilter={nodeFilter}
- nodeOptions={nodeOptions}
- platformFilter={platformFilter}
- platformOptions={platformOptions}
- queryFilter={queryFilter}
- recoveryPoints={recoveryPoints}
- resetAdvancedArtifactFilters={resetAdvancedArtifactFilters}
- resetAllArtifactFilters={resetAllArtifactFilters}
- resourcesById={resourcesById}
- scopeFilter={scopeFilter}
- setClusterFilter={setClusterFilter}
- setCurrentPage={setCurrentPage}
- setHistoryOutcomeFilter={setHistoryOutcomeFilter}
- setItemTypeFilter={setItemTypeFilter}
- setModeFilter={setModeFilter}
- setNamespaceFilter={setNamespaceFilter}
- setNodeFilter={setNodeFilter}
- setPlatformFilter={setPlatformFilter}
- setQueryFilter={setQueryFilter}
- setScopeFilter={setScopeFilter}
- setVerificationFilter={setVerificationFilter}
- showClusterFilter={showClusterFilter}
- showNamespaceFilter={showNamespaceFilter}
- showNodeFilter={showNodeFilter}
- showVerificationFilter={showVerificationFilter}
- tableColumnCount={tableColumnCount}
- tableMinWidth={tableMinWidth}
- totalPages={totalPages}
- verificationFilter={verificationFilter}
- workspaceControls={workspaceControls}
+ loading={() => recoverySeries.response.loading}
+ overallRollupsSummary={overallRollupsSummary}
+ selectedDateKey={selectedDateKey}
+ selectedDateLabel={selectedDateLabel}
+ selectedHistoryItemLabel={selectedHistoryItemLabel}
+ setChartRangeDays={(range) => {
+ setChartRangeDays(range);
+ setSelectedDateKey(null);
+ setCurrentPage(1);
+ }}
+ timeline={timeline}
+ toggleSelectedDate={(key) => {
+ setWorkspaceView('events');
+ setSelectedDateKey((previous) => (previous === key ? null : key));
+ setCurrentPage(1);
+ }}
/>
+
+ <Show when={!recoveryPoints.response.loading && recoveryPoints.response.error}>
+ <Card padding="sm">
+ <EmptyState
+ title={getRecoveryPointsFailureState().title}
+ description={String(
+ (recoveryPoints.response.error as Error)?.message || recoveryPoints.response.error,
+ )}
+ />
+ </Card>
+ </Show>
+
+ <Show when={!recoveryPoints.response.error}>
+ <RecoveryHistorySection
+ activeAdvancedFilterCount={activeAdvancedFilterCount}
+ artifactColumnVisibility={artifactColumnVisibility}
+ availableOutcomes={['all', 'success', 'warning', 'failed', 'running']}
+ clusterFilter={clusterFilter}
+ clusterOptions={clusterOptions}
+ currentPage={currentPage}
+ groupedByDay={groupedByDay}
+ hasActiveArtifactFilters={hasActiveArtifactFilters}
+ historyOutcomeFilter={historyOutcomeFilter}
+ isMobile={isMobile()}
+ kioskMode={kioskMode()}
+ mobileVisibleArtifactColumns={mobileVisibleArtifactColumns}
+ modeFilter={modeFilter}
+ itemTypeFilter={itemTypeFilter}
+ itemTypeOptions={itemTypeOptions}
+ namespaceFilter={namespaceFilter}
+ namespaceOptions={namespaceOptions}
+ nodeFilter={nodeFilter}
+ nodeOptions={nodeOptions}
+ platformFilter={platformFilter}
+ platformOptions={platformOptions}
+ queryFilter={queryFilter}
+ recoveryPoints={recoveryPoints}
+ resetAdvancedArtifactFilters={resetAdvancedArtifactFilters}
+ resetAllArtifactFilters={resetAllArtifactFilters}
+ resourcesById={resourcesById}
+ scopeFilter={scopeFilter}
+ setClusterFilter={setClusterFilter}
+ setCurrentPage={setCurrentPage}
+ setHistoryOutcomeFilter={setHistoryOutcomeFilter}
+ setItemTypeFilter={setItemTypeFilter}
+ setModeFilter={setModeFilter}
+ setNamespaceFilter={setNamespaceFilter}
+ setNodeFilter={setNodeFilter}
+ setPlatformFilter={setPlatformFilter}
+ setQueryFilter={setQueryFilter}
+ setScopeFilter={setScopeFilter}
+ setVerificationFilter={setVerificationFilter}
+ showClusterFilter={showClusterFilter}
+ showNamespaceFilter={showNamespaceFilter}
+ showNodeFilter={showNodeFilter}
+ showVerificationFilter={showVerificationFilter}
+ tableColumnCount={tableColumnCount}
+ tableMinWidth={tableMinWidth}
+ totalPages={totalPages}
+ verificationFilter={verificationFilter}
+ workspaceControls={workspaceControls}
+ />
+ </Show>
</Show>
</>
);
})()}
-
- <RecoveryActivitySection
- activitySummary={activitySummary}
- activeClusterLabel={activeClusterLabel}
- activeItemTypeLabel={activeItemTypeLabel}
- activeNamespaceLabel={activeNamespaceLabel}
- activeNodeLabel={activeNodeLabel}
- chartRangeDays={chartRangeDays}
- clearClusterFilter={() => {
- setClusterFilter('all');
- setCurrentPage(1);
- }}
- clearFocusedRollup={() => setRollupId('')}
- clearItemTypeFilter={() => {
- setItemTypeFilter('all');
- setCurrentPage(1);
- }}
- clearNamespaceFilter={() => {
- setNamespaceFilter('all');
- setCurrentPage(1);
- }}
- clearNodeFilter={() => {
- setNodeFilter('all');
- setCurrentPage(1);
- }}
- clearSelectedDate={() => {
- setSelectedDateKey(null);
- setCurrentPage(1);
- }}
- hasFocusedRollup={() => rollupId().trim().length > 0}
- isMobile={isMobile()}
- loading={() => recoverySeries.response.loading}
- overallRollupsSummary={overallRollupsSummary}
- selectedDateKey={selectedDateKey}
- selectedDateLabel={selectedDateLabel}
- selectedHistoryItemLabel={selectedHistoryItemLabel}
- setChartRangeDays={(range) => {
- setChartRangeDays(range);
- setSelectedDateKey(null);
- setCurrentPage(1);
- }}
- timeline={timeline}
- toggleSelectedDate={(key) => {
- setWorkspaceView('events');
- setSelectedDateKey((previous) => (previous === key ? null : key));
- setCurrentPage(1);
- }}
- />
</div>
</div>
);
diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.layout-guards.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.layout-guards.test.tsx
index b7995bd12e..21a2e4dd62 100644
--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.layout-guards.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.layout-guards.test.tsx
@@ -146,12 +146,13 @@ describe('Recovery layout guards', () => {
vi.clearAllMocks();
});
- it('keeps the activity chart mounted when recovery events fail', () => {
+ it('mounts the activity chart only in the recovery events workspace and keeps it there when events fail', () => {
render(() => <Recovery />);
expect(screen.getByTestId('protected-inventory')).toBeInTheDocument();
- expect(screen.getByTestId('activity-chart')).toBeInTheDocument();
+ expect(screen.queryByTestId('activity-chart')).not.toBeInTheDocument();
fireEvent.click(screen.getByRole('tab', { name: /recovery events/i }));
+ expect(screen.getByTestId('activity-chart')).toBeInTheDocument();
expect(screen.queryByTestId('protected-inventory')).not.toBeInTheDocument();
expect(screen.queryByTestId('history-section')).not.toBeInTheDocument();
expect(screen.getByText('Failed to load recovery points')).toBeInTheDocument();
diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
index ac839ec044..ae2660b457 100644
--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
@@ -231,6 +231,7 @@ describe('Recovery', () => {
expect(within(vmRow!).getAllByText('PVE').length).toBeGreaterThan(0);
expect(within(vmRow!).getAllByText('VM').length).toBeGreaterThan(0);
expect(screen.queryByText('Backups By Date')).not.toBeInTheDocument();
+ expect(screen.queryByText('Recovery Activity')).not.toBeInTheDocument();
fireEvent.click(await screen.findByText('VM 123'));
@@ -254,6 +255,7 @@ describe('Recovery', () => {
expect(within(historyTable).getByText('Platform')).toBeInTheDocument();
expect(within(historyTable).queryByText('Target')).not.toBeInTheDocument();
expect(within(historyTable).queryByText('Details')).not.toBeInTheDocument();
+ expect(screen.getByText('Recovery Activity')).toBeInTheDocument();
});
it('persists the selected recovery workspace view in the route when explicitly changed', async () => {
@@ -1081,8 +1083,8 @@ describe('Recovery', () => {
.filter((url) => url.includes('/api/recovery/points'));
const initialPointsUrl = initialPointUrls[initialPointUrls.length - 1];
- const timelineButtons = await screen.findAllByRole('button', { name: /recovery points/i });
- fireEvent.click(timelineButtons[0]);
+ fireEvent.click(await screen.findByRole('tab', { name: /recovery events/i }));
+
await waitFor(() => {
expect(screen.getByRole('tab', { name: /recovery events/i })).toHaveAttribute(
'aria-selected',
@@ -1090,6 +1092,9 @@ describe('Recovery', () => {
);
});
+ const timelineButtons = await screen.findAllByRole('button', { name: /recovery points/i });
+ fireEvent.click(timelineButtons[0]);
+
const selectedDay = '2026-02-13';
const selectedStart = parseRecoveryDateKey(selectedDay);
selectedStart.setHours(0, 0, 0, 0);
@@ -1195,12 +1200,21 @@ describe('Recovery', () => {
it('persists the selected timeline range in the recovery URL', async () => {
render(() => <Recovery />);
- await screen.findByRole('tab', { name: /protected items/i });
+ fireEvent.click(await screen.findByRole('tab', { name: /recovery events/i }));
+
+ await waitFor(() => {
+ expect(screen.getByRole('tab', { name: /recovery events/i })).toHaveAttribute(
+ 'aria-selected',
+ 'true',
+ );
+ });
fireEvent.click(await screen.findByRole('button', { name: '7d' }));
await waitFor(() => {
- expect(navigateSpy).toHaveBeenCalledWith('/recovery?range=7', { replace: true });
+ expect(navigateSpy).toHaveBeenCalledWith('/recovery?view=events&range=7', {
+ replace: true,
+ });
});
});
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index 8a4ac1d49f..1748cb152b 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -1127,10 +1127,8 @@ describe('frontend resource type boundaries', () => {
expect(recoverySurfaceStateSource).toContain('useRecoveryPointsFacets');
expect(recoverySurfaceStateSource).toContain('useRecoveryPointsSeries');
expect(recoveryComponentSource.indexOf('<RecoveryActivitySection')).toBeGreaterThan(-1);
- expect(recoveryComponentSource.indexOf('<RecoveryActivitySection')).toBeLessThan(
- recoveryComponentSource.indexOf(
- "<Show when={workspaceView() === 'events' && !recoveryPoints.response.error}>",
- ),
+ expect(recoveryComponentSource.indexOf('<RecoveryActivitySection')).toBeGreaterThan(
+ recoveryComponentSource.indexOf("<Show when={workspaceView() === 'events'}>"),
);
expect(recoverySource).toContain('getRecoveryFilterChipPresentation');
expect(recoverySource).not.toContain('const titleize =');