From 9c67cc5d46f8afdeffd6ba2546362316af0c696b Mon Sep 17 00:00:00 2001 From: "pulse-triage[bot]" <249995291+pulse-triage[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2026 13:10:32 +0000 Subject: [PATCH 1/4] Qualify stale protection readings above the TrueNAS Protection table Show a filter-aware warning banner above the TrueNAS Protection table whenever any displayed ZFS snapshot or replication event belongs to a stale TrueNAS system, so operators on desktop and phones see immediately that affected outcomes reflect the last successful TrueNAS poll and newer runs or failures may be missing without opening an individual row drawer. The banner hides when active status or search filters narrow to current-only events, when zero rows match, on all-current views, or when live reporting recovers, and coexists cleanly with refresh-failure alerts while preserving all existing columns, row cues, filter chips, and drawer notices. Includes unit tests covering status filtering, search narrowing, zero-match filtering, live recovery, all-current views, and coexistence with refresh errors, plus the paired desktop-light (1440x900) and phone-dark (390x900) browser verification receipt. Contract-Neutral: Uses the existing TrueNAS protection staleness map, TrueNASTableFrame notice slot, and shared InlineNotice primitive without changing recovery API fields, access rules, classification, or table contracts. Change-source: pulse-maintainer --- .../aa085cb277cce7bc.json | 39 ++++ .../truenas/TrueNASProtectionTable.tsx | 56 ++++-- .../TrueNASProtectionTable.freshness.test.tsx | 183 ++++++++++++++++++ 3 files changed, 258 insertions(+), 20 deletions(-) create mode 100644 frontend-modern/browser-verification/aa085cb277cce7bc.json diff --git a/frontend-modern/browser-verification/aa085cb277cce7bc.json b/frontend-modern/browser-verification/aa085cb277cce7bc.json new file mode 100644 index 0000000000..af8c85cc2a --- /dev/null +++ b/frontend-modern/browser-verification/aa085cb277cce7bc.json @@ -0,0 +1,39 @@ +{ + "version": 1, + "base_sha": "efbfd69780b17dc682c229aa5f6e7c5c2bfdc86b", + "verified_at": "2026-12-02T13:07:12Z", + "result": "passed", + "changed_paths": [ + "frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx" + ], + "content_sha256": { + "frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx": "6fd3c77482a4a2b10ae92f42669ca77bdbe14e29fbd8857e8d24f9fc27986104" + }, + "routes": [ + "/truenas/protection" + ], + "viewports": [ + { + "width": 1440, + "height": 900, + "theme": "light" + }, + { + "width": 390, + "height": 900, + "theme": "dark" + } + ], + "states": [ + "Paired All view with stale TrueNAS system (nas-east: tank/archive Failed, tank/billing Healthy->Stale data, tank/media Running) and current system (nas-west: vault/docs Healthy)", + "Paired Healthy filter narrowing to current-only vault/docs hides stale banner", + "Paired Stale filter showing stale nas-east events keeps stale banner visible", + "Paired live recovery when nas-east returns online clears stale banner and Stale filter chip", + "Paired all-current control view with zero stale systems renders no banner" + ], + "interactions": [ + "Clicked Healthy, Stale, and All filters on desktop light (1440x900); opened Filters disclosure and clicked OK/Healthy, Stale, and All on phone dark (390x900); triggered live system recovery; verified 0 console/page/request errors and 0px horizontal overflow", + "All 20 paired before/after PNGs visually inspected natively with read_file" + ], + "browser": "Playwright / Chromium via pulse-worker-browser" +} diff --git a/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx b/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx index e933b4f511..d83bd8f165 100644 --- a/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx +++ b/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx @@ -383,6 +383,9 @@ export const TrueNASProtectionTable: Component<{ getTrueNASProtectionSortValue(point, key, staleNoticeByPointId().get(point.id)), ), ); + const hasStaleDisplayedRows = createMemo(() => + sortedRows().some((point) => staleNoticeByPointId().has(point.id)), + ); return ( - -

Could not refresh TrueNAS protection.

-

- Showing previously loaded events. Outcomes and counts may be out of date. Newer - activity may be missing. -

- - - -
-
+ <> + + +

Could not refresh TrueNAS protection.

+

+ Showing previously loaded events. Outcomes and counts may be out of date. Newer + activity may be missing. +

+ + + +
+
+ + + Some TrueNAS protection readings are stale. Affected snapshot and + replication outcomes reflect the last successful TrueNAS poll; newer runs or + failures may be missing. + + + } title="Snapshots & Replication" actions={ diff --git a/frontend-modern/src/features/truenas/__tests__/TrueNASProtectionTable.freshness.test.tsx b/frontend-modern/src/features/truenas/__tests__/TrueNASProtectionTable.freshness.test.tsx index a537fd2afe..64e1cb348a 100644 --- a/frontend-modern/src/features/truenas/__tests__/TrueNASProtectionTable.freshness.test.tsx +++ b/frontend-modern/src/features/truenas/__tests__/TrueNASProtectionTable.freshness.test.tsx @@ -446,4 +446,187 @@ describe('TrueNASProtectionTable stale-reading UI', () => { .closest('tr'), ).toHaveTextContent('Healthy'); }); + + it('shows a filter-aware stale banner above the table and clears it on filter narrowing or live recovery', async () => { + const staleNas = makeSystem({ + id: 'truenas:agent:system:conn-east', + name: 'nas-east', + displayName: 'nas-east', + agent: { agentId: 'conn-east', hostname: 'nas-east' }, + truenas: { hostname: 'nas-east' }, + sourceStatus: { truenas: { status: 'stale', error: 'API connection refused' } }, + health: { + verdict: 'stale', + reasons: [{ code: 'telemetry_stale', detail: '14m' }], + }, + }); + const freshNas = makeSystem({ + id: 'truenas:agent:system:conn-west', + name: 'nas-west', + displayName: 'nas-west', + agent: { agentId: 'conn-west', hostname: 'nas-west' }, + truenas: { hostname: 'nas-west' }, + sourceStatus: { truenas: { status: 'online' } }, + }); + + const points: RecoveryPoint[] = [ + makePoint({ + id: 'snap-east-ok', + kind: 'snapshot', + mode: 'snapshot', + outcome: 'success', + display: { itemLabel: 'tank/billing', nodeHostLabel: 'nas-east' }, + details: { + connectionId: 'conn-east', + hostname: 'nas-east', + dataset: 'tank/billing', + snapshot: 'auto-20261127-1200', + }, + }), + makePoint({ + id: 'rep-east-failed', + kind: 'backup', + mode: 'remote', + outcome: 'failed', + display: { itemLabel: 'tank/archive', nodeHostLabel: 'nas-east' }, + details: { + connectionId: 'conn-east', + hostname: 'nas-east', + taskName: 'replicate-archive', + lastState: 'FAILED', + }, + }), + makePoint({ + id: 'snap-west-ok', + kind: 'snapshot', + mode: 'snapshot', + outcome: 'success', + display: { itemLabel: 'vault/docs', nodeHostLabel: 'nas-west' }, + details: { + connectionId: 'conn-west', + hostname: 'nas-west', + dataset: 'vault/docs', + snapshot: 'auto-20261127-1205', + }, + }), + ]; + + const [systems, setSystems] = createSignal([staleNas, freshNas]); + + renderInRouter(() => ( + } + emptyTitle="No protection" + emptyDescription="No protection" + /> + )); + + // All view includes stale rows -> banner is visible with role="status" + const banner = screen.getByTestId('truenas-protection-stale-banner'); + expect(banner).toHaveAttribute('role', 'status'); + expect(banner).toHaveTextContent('Some TrueNAS protection readings are stale.'); + expect(banner).toHaveTextContent( + 'Affected snapshot and replication outcomes reflect the last successful TrueNAS poll; newer runs or failures may be missing.', + ); + + // Narrowing to Healthy (current-only) hides the banner + await fireEvent.click(screen.getByRole('button', { name: 'Healthy, 1' })); + expect(screen.queryByTestId('truenas-protection-stale-banner')).toBeNull(); + + // Switching to Stale or Failed restores the banner + await fireEvent.click(screen.getByRole('button', { name: 'Stale, 2' })); + expect(screen.getByTestId('truenas-protection-stale-banner')).toBeInTheDocument(); + + await fireEvent.click(screen.getByRole('button', { name: 'Failed, 1' })); + expect(screen.getByTestId('truenas-protection-stale-banner')).toBeInTheDocument(); + + // Returning to All and narrowing search to the fresh system hides the banner + await fireEvent.click(screen.getByRole('button', { name: 'All, 3' })); + expect(screen.getByTestId('truenas-protection-stale-banner')).toBeInTheDocument(); + + const searchInput = screen.getByPlaceholderText('Search snapshots or replication'); + await fireEvent.input(searchInput, { target: { value: 'vault/docs' } }); + expect(screen.queryByTestId('truenas-protection-stale-banner')).toBeNull(); + + // Searching with no matches also hides the banner + await fireEvent.input(searchInput, { target: { value: 'nonexistent-dataset' } }); + expect(screen.queryByTestId('truenas-protection-stale-banner')).toBeNull(); + + // Clearing search restores the banner; live recovery clears it without reload + await fireEvent.input(searchInput, { target: { value: '' } }); + expect(screen.getByTestId('truenas-protection-stale-banner')).toBeInTheDocument(); + + setSystems([ + makeSystem({ + ...staleNas, + sourceStatus: { truenas: { status: 'online' } }, + health: { verdict: 'ok', reasons: [] }, + }), + freshNas, + ]); + expect(screen.queryByTestId('truenas-protection-stale-banner')).toBeNull(); + }); + + it('omits the table stale banner when all systems are current and preserves refresh error coexistence', () => { + const freshNas = makeSystem({ + id: 'truenas:agent:system:conn-west', + name: 'nas-west', + displayName: 'nas-west', + agent: { agentId: 'conn-west', hostname: 'nas-west' }, + truenas: { hostname: 'nas-west' }, + sourceStatus: { truenas: { status: 'online' } }, + }); + const staleNas = makeSystem({ + id: 'truenas:agent:system:conn-east', + name: 'nas-east', + displayName: 'nas-east', + agent: { agentId: 'conn-east', hostname: 'nas-east' }, + truenas: { hostname: 'nas-east' }, + sourceStatus: { truenas: { status: 'stale' } }, + }); + + const points: RecoveryPoint[] = [ + makePoint({ + id: 'snap-west-ok', + outcome: 'success', + display: { itemLabel: 'vault/docs', nodeHostLabel: 'nas-west' }, + details: { connectionId: 'conn-west', hostname: 'nas-west', dataset: 'vault/docs' }, + }), + makePoint({ + id: 'snap-east-ok', + outcome: 'success', + display: { itemLabel: 'tank/billing', nodeHostLabel: 'nas-east' }, + details: { connectionId: 'conn-east', hostname: 'nas-east', dataset: 'tank/billing' }, + }), + ]; + + const [systems, setSystems] = createSignal([ + freshNas, + makeSystem({ ...staleNas, sourceStatus: { truenas: { status: 'online' } } }), + ]); + const [error, setError] = createSignal(undefined); + + renderInRouter(() => ( + } + emptyTitle="No protection" + emptyDescription="No protection" + /> + )); + + expect(screen.queryByTestId('truenas-protection-stale-banner')).toBeNull(); + expect(screen.queryByRole('alert', { name: 'Protection refresh failed' })).toBeNull(); + + // Both refresh failure and stale TrueNAS source render together without suppressing either + setSystems([freshNas, staleNas]); + setError(new Error('503 Service Unavailable')); + + expect(screen.getByRole('alert', { name: 'Protection refresh failed' })).toBeInTheDocument(); + expect(screen.getByTestId('truenas-protection-stale-banner')).toBeInTheDocument(); + }); }); From 0ead002d51fd1ae1c7e3abbf3fbafb16e0bbdbb0 Mon Sep 17 00:00:00 2001 From: "pulse-triage[bot]" <249995291+pulse-triage[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2026 13:21:35 +0000 Subject: [PATCH 2/4] Supply required kind and mode fields in TrueNAS Protection banner test Pass required kind and mode properties to makePoint in the all-current and refresh-error coexistence test inside TrueNASProtectionTable.freshness.test.tsx so tsc --noEmit passes cleanly. Contract-Neutral: Test-only TypeScript fixture property fix in TrueNASProtectionTable.freshness.test.tsx with no runtime, API, schema, or contract changes. Change-source: pulse-maintainer --- .../__tests__/TrueNASProtectionTable.freshness.test.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend-modern/src/features/truenas/__tests__/TrueNASProtectionTable.freshness.test.tsx b/frontend-modern/src/features/truenas/__tests__/TrueNASProtectionTable.freshness.test.tsx index 64e1cb348a..5ba784d7c1 100644 --- a/frontend-modern/src/features/truenas/__tests__/TrueNASProtectionTable.freshness.test.tsx +++ b/frontend-modern/src/features/truenas/__tests__/TrueNASProtectionTable.freshness.test.tsx @@ -590,12 +590,16 @@ describe('TrueNASProtectionTable stale-reading UI', () => { const points: RecoveryPoint[] = [ makePoint({ id: 'snap-west-ok', + kind: 'snapshot', + mode: 'snapshot', outcome: 'success', display: { itemLabel: 'vault/docs', nodeHostLabel: 'nas-west' }, details: { connectionId: 'conn-west', hostname: 'nas-west', dataset: 'vault/docs' }, }), makePoint({ id: 'snap-east-ok', + kind: 'snapshot', + mode: 'snapshot', outcome: 'success', display: { itemLabel: 'tank/billing', nodeHostLabel: 'nas-east' }, details: { connectionId: 'conn-east', hostname: 'nas-east', dataset: 'tank/billing' }, From 899fd2f1fffdcdfebd095d756f0a0a35157e1b1e Mon Sep 17 00:00:00 2001 From: "pulse-triage[bot]" <249995291+pulse-triage[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2026 16:08:03 +0000 Subject: [PATCH 3/4] Replace semicolon in TrueNAS Protection stale-readings banner copy Split the stale-readings banner sentence in TrueNASProtectionTable.tsx at the period instead of using a semicolon so frontend copy-style lint (npm run lint:copy) passes, update the matching unit test assertion, and refresh the paired browser verification receipt. Contract-Neutral: Copy punctuation fix in TrueNASProtectionTable.tsx and its unit test with no API, schema, routing, or behavioral contract changes. Change-source: pulse-maintainer --- frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx | 2 +- .../truenas/__tests__/TrueNASProtectionTable.freshness.test.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx b/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx index d83bd8f165..e515c42acc 100644 --- a/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx +++ b/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx @@ -446,7 +446,7 @@ export const TrueNASProtectionTable: Component<{ data-testid="truenas-protection-stale-banner" > Some TrueNAS protection readings are stale. Affected snapshot and - replication outcomes reflect the last successful TrueNAS poll; newer runs or + replication outcomes reflect the last successful TrueNAS poll. Newer runs or failures may be missing. diff --git a/frontend-modern/src/features/truenas/__tests__/TrueNASProtectionTable.freshness.test.tsx b/frontend-modern/src/features/truenas/__tests__/TrueNASProtectionTable.freshness.test.tsx index 5ba784d7c1..c43af955de 100644 --- a/frontend-modern/src/features/truenas/__tests__/TrueNASProtectionTable.freshness.test.tsx +++ b/frontend-modern/src/features/truenas/__tests__/TrueNASProtectionTable.freshness.test.tsx @@ -528,7 +528,7 @@ describe('TrueNASProtectionTable stale-reading UI', () => { expect(banner).toHaveAttribute('role', 'status'); expect(banner).toHaveTextContent('Some TrueNAS protection readings are stale.'); expect(banner).toHaveTextContent( - 'Affected snapshot and replication outcomes reflect the last successful TrueNAS poll; newer runs or failures may be missing.', + 'Affected snapshot and replication outcomes reflect the last successful TrueNAS poll. Newer runs or failures may be missing.', ); // Narrowing to Healthy (current-only) hides the banner From 8a3bc26c0d42dd8b852cff16d701fd1c293e6dfb Mon Sep 17 00:00:00 2001 From: "pulse-triage[bot]" <249995291+pulse-triage[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2026 16:21:54 +0000 Subject: [PATCH 4/4] Record browser receipt for TrueNAS Protection banner copy fix Bind fresh paired desktop-light (1440x900) and phone-dark (390x900) Chromium verification receipt (839bb77464d7d781.json) to parent 899fd2f1ff and the final content of TrueNASProtectionTable.tsx. Contract-Neutral: Browser verification receipt only with no runtime, API, schema, or contract changes. Change-source: pulse-maintainer --- .../839bb77464d7d781.json | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 frontend-modern/browser-verification/839bb77464d7d781.json diff --git a/frontend-modern/browser-verification/839bb77464d7d781.json b/frontend-modern/browser-verification/839bb77464d7d781.json new file mode 100644 index 0000000000..e1c3c397a3 --- /dev/null +++ b/frontend-modern/browser-verification/839bb77464d7d781.json @@ -0,0 +1,39 @@ +{ + "version": 1, + "base_sha": "899fd2f1fffdcdfebd095d756f0a0a35157e1b1e", + "verified_at": "2026-12-02T16:17:10Z", + "result": "passed", + "changed_paths": [ + "frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx" + ], + "content_sha256": { + "frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx": "4cc78f60157710b8ee53d0e4f7f3534da3898cfe3f872c670130758dbd0afee9" + }, + "routes": [ + "/truenas/protection" + ], + "viewports": [ + { + "width": 1440, + "height": 900, + "theme": "light" + }, + { + "width": 390, + "height": 900, + "theme": "dark" + } + ], + "states": [ + "Paired All view with stale TrueNAS system (nas-east: tank/archive Failed, tank/media Running, tank/billing Stale data) and current system (nas-west: vault/docs Healthy) showing updated two-sentence stale-readings banner", + "Paired Healthy/OK filter narrowing to current-only vault/docs hides stale banner", + "Paired Stale filter showing stale nas-east events keeps stale banner visible", + "Paired live WebSocket recovery when nas-east returns online clears stale banner and Stale filter chip", + "Paired all-current control view with zero stale systems renders no banner" + ], + "interactions": [ + "Clicked Healthy, Stale, and All filters on desktop light (1440x900); opened Filters disclosure and clicked OK, Stale, and All on phone dark (390x900); pushed live WebSocket recovery; verified 0 console/page/HTTP errors and 0px horizontal overflow", + "All 20 paired before (5a8b55bc23) / after (4cc78f6015) PNGs visually inspected natively with read_file" + ], + "browser": "Playwright / Chromium via pulse-worker-browser" +}