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.

Retain inspection focus when a restore point changes date group

pulse-triage[bot]bc98e7041762
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 9bd4ad6e59..30b8205154 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -11012,3 +11012,19 @@ must exercise the actual By date consumer at desktop and narrow widths and
inspect wrapping, uncertainty, keyboard/touch disclosure and live replacement.
No parser, association, ordering, count, filter, posture, API, permission or
provider-operation contract changes. This is inspection, not guest recovery.
+
+
+Polling can move an existing By date point between calendar groups, including
+into Unknown date. Before the keyed list changes, the table captures only focus
+it owns. After the move it restores that same connected control only if focus
+fell to the document body; it never steals focus moved elsewhere or resurrects
+a removed point. The open record, strict dates and existing withdrawal fallback
+remain unchanged. Direct normal-suite tests cover owned/external/removed focus;
+the parsed Backups consumer covers an open point moving into Unknown date.
+Actual Chromium and WebKit browser proof must cover that day-group move.
+
+The Proxmox gzip baseline increases by 256 bytes (80339 to 80595, 0.32%) for
+literal date evidence and the browser-reproduced focus repair. The 15% threshold,
+all other per-chunk baselines, total JS/CSS and preload/SRI checks stay unchanged.
+This is a narrowly declared intentional UI/accessibility cost, not suppression
+of the retained failed budget runs or permission to omit browser verification.
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index cf1db1a1c1..7c143b31be 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -8926,3 +8926,19 @@ must exercise the actual By date consumer at desktop and narrow widths and
inspect wrapping, uncertainty, keyboard/touch disclosure and live replacement.
No parser, association, ordering, count, filter, posture, API, permission or
provider-operation contract changes. This is inspection, not guest recovery.
+
+
+Polling can move an existing By date point between calendar groups, including
+into Unknown date. Before the keyed list changes, the table captures only focus
+it owns. After the move it restores that same connected control only if focus
+fell to the document body; it never steals focus moved elsewhere or resurrects
+a removed point. The open record, strict dates and existing withdrawal fallback
+remain unchanged. Direct normal-suite tests cover owned/external/removed focus;
+the parsed Backups consumer covers an open point moving into Unknown date.
+Actual Chromium and WebKit browser proof must cover that day-group move.
+
+The Proxmox gzip baseline increases by 256 bytes (80339 to 80595, 0.32%) for
+literal date evidence and the browser-reproduced focus repair. The 15% threshold,
+all other per-chunk baselines, total JS/CSS and preload/SRI checks stay unchanged.
+This is a narrowly declared intentional UI/accessibility cost, not suppression
+of the retained failed budget runs or permission to omit browser verification.
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 7aef2ca6cc..f15d09c217 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -9433,3 +9433,19 @@ must exercise the actual By date consumer at desktop and narrow widths and
inspect wrapping, uncertainty, keyboard/touch disclosure and live replacement.
No parser, association, ordering, count, filter, posture, API, permission or
provider-operation contract changes. This is inspection, not guest recovery.
+
+
+Polling can move an existing By date point between calendar groups, including
+into Unknown date. Before the keyed list changes, the table captures only focus
+it owns. After the move it restores that same connected control only if focus
+fell to the document body; it never steals focus moved elsewhere or resurrects
+a removed point. The open record, strict dates and existing withdrawal fallback
+remain unchanged. Direct normal-suite tests cover owned/external/removed focus;
+the parsed Backups consumer covers an open point moving into Unknown date.
+Actual Chromium and WebKit browser proof must cover that day-group move.
+
+The Proxmox gzip baseline increases by 256 bytes (80339 to 80595, 0.32%) for
+literal date evidence and the browser-reproduced focus repair. The 15% threshold,
+all other per-chunk baselines, total JS/CSS and preload/SRI checks stay unchanged.
+This is a narrowly declared intentional UI/accessibility cost, not suppression
+of the retained failed budget runs or permission to omit browser verification.
diff --git a/frontend-modern/.bundlesize.json b/frontend-modern/.bundlesize.json
index 050455c8e1..8faa7ac45f 100644
--- a/frontend-modern/.bundlesize.json
+++ b/frontend-modern/.bundlesize.json
@@ -20,7 +20,7 @@
"baselineGzip": 92219
},
"Proxmox": {
- "baselineGzip": 80339
+ "baselineGzip": 80595
},
"AIIntelligence": {
"baselineGzip": 73662
diff --git a/frontend-modern/src/features/proxmox/ProxmoxRecoverableTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxRecoverableTable.tsx
index 6372bbf0b8..5f5301c8a5 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxRecoverableTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxRecoverableTable.tsx
@@ -92,22 +92,16 @@ function groupByDay(artifacts: readonly RecoverableArtifact[]): DayGroup[] {
}
// The drawer dot repeats the row's State badge: the same states, the same colours.
-const artifactStateIndicator = (artifact: RecoverableArtifact): StatusIndicator => ({
- variant: artifact.running
- ? 'info'
- : artifact.failed
- ? 'danger'
- : artifact.sourceKind === 'snapshot'
- ? 'info'
- : artifact.verified === true
- ? 'success'
- : artifact.verified === false
- ? 'warning'
- : artifact.protected
- ? 'info'
- : 'muted',
- label: artifactStateLabel(artifact),
-});
+const artifactStateIndicator = (artifact: RecoverableArtifact): StatusIndicator => {
+ const label = artifactStateLabel(artifact);
+ if (artifact.running) return { variant: 'info', label };
+ if (artifact.failed) return { variant: 'danger', label };
+ if (artifact.sourceKind === 'snapshot') return { variant: 'info', label };
+ if (artifact.verified === true) return { variant: 'success', label };
+ if (artifact.verified === false) return { variant: 'warning', label };
+ if (artifact.protected) return { variant: 'info', label };
+ return { variant: 'muted', label };
+};
const artifactVerificationText = (artifact: RecoverableArtifact): string => {
if (artifact.verified === true) return 'Verified';
@@ -275,6 +269,7 @@ export function ProxmoxRecoverableTable(props: {
/** Register focus retention with each row/detail's own cleanup owner. */
retainInspectionFocus?: (content: HTMLElement) => void;
}) {
+ let table: HTMLDivElement | undefined;
const observedWidth = useObservedElementWidth();
const layoutMode = createMemo(() => {
const width = props.layoutWidth?.() ?? observedWidth.width();
@@ -288,6 +283,15 @@ export function ProxmoxRecoverableTable(props: {
visibleColumns().some((candidate) => candidate.id === column);
const showDayGroups = () => props.groupByDay && props.sortKey() === 'created';
const tableItems = createMemo<RecoverableTableItem[]>(() => {
+ // Moving a retained keyed row between date groups can blur its control in
+ // real browsers. Restore only owned, still-mounted focus lost by this move.
+ const active = document.activeElement;
+ if (active instanceof HTMLElement && table?.contains(active)) {
+ queueMicrotask(() => {
+ if (active.isConnected && document.activeElement === document.body)
+ active.focus({ preventScroll: true });
+ });
+ }
if (!showDayGroups()) {
return props.artifacts.map((item) => ({
kind: 'artifact',
@@ -465,7 +469,10 @@ export function ProxmoxRecoverableTable(props: {
}
>
<div
- ref={observedWidth.setElement}
+ ref={(element) => {
+ table = element;
+ observedWidth.setElement(element);
+ }}
data-proxmox-backups-table="recoverable"
data-proxmox-backups-layout={layoutMode()}
>
diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx
index 213a2dec7b..aff77ce193 100644
--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx
+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx
@@ -1733,6 +1733,26 @@ describe('backup-date-evidence connected inventory', () => {
<ProxmoxBackupsTable emptyIcon={<span />} workloads={[workloadResource]} />
));
+ it('[regression] keeps focus when a reported date moves the open point to another day group', async () => {
+ window.history.replaceState({}, '', '/?view=date');
+ supply('2026-10-04T11:59:00Z', true);
+ mount();
+ const toggle = await screen.findByRole('button', { name: /Expand details.*PBS snapshot/ });
+ await fireEvent.click(toggle);
+ toggle.focus();
+ const panel = screen.getByTestId('proxmox-recoverable-detail');
+ supply('not-a-date', true);
+ eventBus.emit('org_switched', 'reported-date-group-move');
+ await waitFor(() =>
+ expect(within(panel).getByText('Reported date').closest('tr')).toHaveTextContent(
+ 'not-a-date',
+ ),
+ );
+ expect(within(panel).getByText('Created').closest('tr')).toHaveTextContent('Unknown');
+ expect(screen.getByTestId('proxmox-recoverable-detail')).toBe(panel);
+ expect(toggle).toHaveFocus();
+ });
+
it.each(['not-a-date', '0001-01-01T00:00:00Z', '2026-10-04T12:00:01Z'])(
'[regression] By date exposes the reported %s without granting it an age',
async (date) => {
diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxRecoverableTable.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxRecoverableTable.test.tsx
index 57d851277c..41382a3e83 100644
--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxRecoverableTable.test.tsx
+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxRecoverableTable.test.tsx
@@ -1,7 +1,7 @@
import { cleanup, fireEvent, render, screen, within } from '@solidjs/testing-library';
import { Route, Router } from '@solidjs/router';
import { afterEach, describe, expect, it } from 'vitest';
-import type { Accessor, JSX } from 'solid-js';
+import { createSignal, type Accessor, type JSX } from 'solid-js';
import { ProxmoxRecoverableTable } from '../ProxmoxRecoverableTable';
import type { RecoverableArtifact } from '../proxmoxBackupRecoveryModel';
@@ -290,3 +290,60 @@ describe('restore-point disclosure identity', () => {
expect(toggle).toHaveFocus();
});
});
+
+describe('live date-group focus ownership', () => {
+ it.each(['owned', 'moved elsewhere', 'removed'] as const)(
+ 'restores only retained focus after a row move: %s',
+ async (focus) => {
+ const second = {
+ ...artifact,
+ id: 'second',
+ nativeId: 'second',
+ createdMs: artifact.createdMs! - 86400000,
+ };
+ const unknown = {
+ ...artifact,
+ id: 'unknown',
+ nativeId: 'unknown',
+ createdAt: '',
+ createdMs: undefined,
+ };
+ const [points, setPoints] = createSignal([artifact, second, unknown]);
+ renderInRouter(() => (
+ <>
+ <button type="button">Outside inspection</button>
+ <ProxmoxRecoverableTable
+ artifacts={points()}
+ hasAnyArtifacts
+ emptyIcon={<span />}
+ emptyTitle=""
+ emptyDescription=""
+ sortKey={() => 'created'}
+ sortDirection={() => 'desc'}
+ onSort={() => {}}
+ sizeMaxBytes={0}
+ groupByDay
+ layoutWidth={() => 1200}
+ />
+ </>
+ ));
+ const toggle = screen.getByRole('button', { name: /Identifier: vm\/100\// });
+ await fireEvent.click(toggle);
+ toggle.focus();
+ setPoints(
+ focus === 'removed'
+ ? [second, unknown]
+ : [second, unknown, { ...artifact, createdAt: '', createdMs: undefined }],
+ );
+ const outside = screen.getByRole('button', { name: 'Outside inspection' });
+ if (focus === 'moved elsewhere') outside.focus();
+ await Promise.resolve();
+ if (focus === 'owned') expect(toggle).toHaveFocus();
+ else if (focus === 'moved elsewhere') expect(outside).toHaveFocus();
+ else {
+ expect(toggle).not.toBeInTheDocument();
+ expect(toggle).not.toHaveFocus();
+ }
+ },
+ );
+});