mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-30 01:32:00 +01:00
Keep unrated backup targets visible on phones (#4364)
**Keep unrated backup targets visible on phones** Backup health hid checking and not-evaluated counts below the small breakpoint while retaining the protected ratio. Keep those existing counts in the header on every viewport, allowing each distinct count to wrap without widening the card. Preserve rated totals, exception filters, datastore controls and policy disclosure. Registered tests cover separate unrated states, transitions, excluded orphaned rows and unchanged actions. Contract-Neutral: Presents existing backup health counts without changing assessment states, rated membership, percentages, policy, endpoints, authentication, data collection or recovery behavior. **Record comparable Backup health browser verification** Verify the unchanged consuming backup table against its assigned-base header using matching synthetic responses at desktop and phone widths in light and dark themes. All 129 browser assertions pass and all 24 retained captures were inspected with the native image tool. Existing counts, rows and controls remain available; only the intended phone qualifications become visible. The receipt is bound to its own parent and exact runtime bytes. No runtime, test or dependency source changes. --- Fleet candidate `20261114T005552Z-web-product` from the `web-product` lane. Reviewed tip `118acd2c83a6c611e8d034f11ae86159ba8a4d5e` on `main`. [How Pulse handles triage](https://github.com/rcourtman/Pulse/blob/main/docs/AI_TRANSPARENCY.md)
This commit is contained in:
47
frontend-modern/browser-verification/2809042047e81b57.json
Normal file
47
frontend-modern/browser-verification/2809042047e81b57.json
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"version": 1,
|
||||
"base_sha": "6afaa3ae0a23322c6959e87aad7fe38e8214573b",
|
||||
"verified_at": "2026-11-14T01:51:07Z",
|
||||
"result": "passed",
|
||||
"changed_paths": [
|
||||
"frontend-modern/src/features/proxmox/ProxmoxBackupsCoverageStrip.tsx"
|
||||
],
|
||||
"content_sha256": {
|
||||
"frontend-modern/src/features/proxmox/ProxmoxBackupsCoverageStrip.tsx": "e1c36c6b3d1696480abc186b78ff465b1a1aa6d5d23b0861b77bf609807fcc54"
|
||||
},
|
||||
"routes": [
|
||||
"/proxmox/backups/coverage"
|
||||
],
|
||||
"viewports": [
|
||||
{
|
||||
"width": 1440,
|
||||
"height": 900
|
||||
},
|
||||
{
|
||||
"width": 1024,
|
||||
"height": 900
|
||||
},
|
||||
{
|
||||
"width": 390,
|
||||
"height": 844
|
||||
}
|
||||
],
|
||||
"states": [
|
||||
"Actual ProxmoxBackupsTable and real stylesheet, compiled twice with the frozen assigned-base header and final committed header; identical synthetic API data, viewport, theme, collapsed policy and scroll0 for 12 pairs / 24 captures.",
|
||||
"Chromium 1440/light and 1024/dark, WebKit 390/light and 390/dark: pending four assessments plus two unevaluated host backups; settled two of four rated guests protected plus two unevaluated hosts; all four rated guests protected with no unrated targets.",
|
||||
"Author opened every retained before/after PNG with native view_image. Phone mixed state gains 2 not evaluated without changing155 px card height; pending gains 4 checking and 2 not evaluated with 20 px extra height, retaining all six rows and existing controls in 844 px view; healthy phone and all desktop card heights unchanged.",
|
||||
"129 browser assertions pass, no page errors or horizontal overflow. Playwright1.56.1 matches integration lock; observed Chromium and WebKit versions are in the retained program record. Safe fixtures establish frontend presentation, not actual estate protection or published delivery."
|
||||
],
|
||||
"interactions": [
|
||||
"On every before/after profile, focus What the counts mean and press Space to open/close the existing disclosure; verify the seven-day policy text.",
|
||||
"Click No successful backup; verify selected aria-pressed state and the home-assistant workload; click again to clear the exception filter.",
|
||||
"Hold and then release the posture response; check transition from Checking backups to2/4 protected without changing the source-owned rated denominator. All API fixture requests are GET.",
|
||||
"Every capture is at scroll0; retain and inspect comparable pairs. Browser close and server close are recorded by the completed program."
|
||||
],
|
||||
"evidence": {
|
||||
"record": "browser-paired.json",
|
||||
"captures": "CAPTURES.json",
|
||||
"observations": "PIXEL-OBSERVATIONS.md",
|
||||
"scope": "Full consuming-table fixture, not the complete authenticated App, hosted backend or original clients."
|
||||
}
|
||||
}
|
||||
@@ -146,8 +146,8 @@ export const ProxmoxBackupsCoverageStrip: Component<CoverageStripProps> = (props
|
||||
<TableCard data-coverage-strip>
|
||||
<TableCardHeader
|
||||
title={
|
||||
<span class="inline-flex items-center gap-2 whitespace-nowrap">
|
||||
{props.title}
|
||||
<span class="inline-flex max-w-full flex-wrap items-center gap-x-2 gap-y-1">
|
||||
<span class="whitespace-nowrap">{props.title}</span>
|
||||
<span
|
||||
class="inline-flex items-center gap-1.5 normal-case tracking-normal"
|
||||
data-backup-verdict={props.verdict.tone}
|
||||
@@ -172,12 +172,16 @@ export const ProxmoxBackupsCoverageStrip: Component<CoverageStripProps> = (props
|
||||
<span class="font-medium">protected</span>
|
||||
</span>
|
||||
</Show>
|
||||
<Show when={asides().length > 0}>
|
||||
<span class="hidden font-medium text-muted sm:inline">
|
||||
· {asides().join(' · ')}
|
||||
</span>
|
||||
</Show>
|
||||
</span>
|
||||
{/* These targets are outside the protected ratio. Keep their
|
||||
counts visible on phones too, without widening the card. */}
|
||||
<For each={asides()}>
|
||||
{(aside) => (
|
||||
<span class="whitespace-nowrap font-medium normal-case tracking-normal text-muted">
|
||||
· {aside}
|
||||
</span>
|
||||
)}
|
||||
</For>
|
||||
</span>
|
||||
}
|
||||
actions={
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';
|
||||
import { createSignal } from 'solid-js';
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
import { protectionPolicy, protectionPosture } from '@/utils/__fixtures__/protectionPosture';
|
||||
import type { WorkloadCoverageRow, WorkloadRecoveryPosture } from '../proxmoxBackupRecoveryModel';
|
||||
import { buildBackupVerdict } from '../proxmoxBackupVerdict';
|
||||
import { ProxmoxBackupsCoverageStrip } from '../ProxmoxBackupsCoverageStrip';
|
||||
|
||||
const row = (label: string, posture: WorkloadRecoveryPosture): WorkloadCoverageRow => ({
|
||||
key: `resource:${label}`,
|
||||
workload: {
|
||||
key: `resource:${label}`,
|
||||
resourceId: `vm:${label}`,
|
||||
type: 'vm',
|
||||
typeLabel: 'VM',
|
||||
vmid: '100',
|
||||
label,
|
||||
name: label,
|
||||
},
|
||||
artifacts: [],
|
||||
pbsCount: 0,
|
||||
archiveCount: 0,
|
||||
snapshotCount: 0,
|
||||
posture,
|
||||
postureRank: 0,
|
||||
protectionPosture:
|
||||
posture === 'checking' || posture === 'not-evaluated'
|
||||
? undefined
|
||||
: {
|
||||
...protectionPosture(`vm:${label}`),
|
||||
state: posture,
|
||||
reason: posture === 'unprotected' ? 'no-backup' : 'recent-verified',
|
||||
},
|
||||
isOrphaned: false,
|
||||
});
|
||||
|
||||
const verdict = (...rows: WorkloadCoverageRow[]) => buildBackupVerdict(rows, protectionPolicy);
|
||||
|
||||
afterEach(cleanup);
|
||||
|
||||
describe('Backup health unrated counts', () => {
|
||||
it('does not hide checking or unevaluated targets behind a protected ratio', () => {
|
||||
const view = render(() => (
|
||||
<ProxmoxBackupsCoverageStrip
|
||||
title="Backup health"
|
||||
verdict={verdict(
|
||||
row('protected', 'protected'),
|
||||
row('reading', 'checking'),
|
||||
row('host', 'not-evaluated'),
|
||||
{ ...row('orphan', 'not-evaluated'), isOrphaned: true },
|
||||
)}
|
||||
/>
|
||||
));
|
||||
|
||||
expect(view.container.querySelector('[data-backup-verdict]')).toHaveTextContent('1 / 1');
|
||||
for (const label of [/1 checking/, /1 not evaluated/]) {
|
||||
const count = screen.getByText(label);
|
||||
expect(count).toBeVisible();
|
||||
// JSDOM does not apply Tailwind's responsive CSS. Reject base hiding
|
||||
// here; source-bound desktop/phone browser proof must check real layout.
|
||||
expect(count.closest('[hidden], .hidden, .invisible')).toBeNull();
|
||||
}
|
||||
expect(screen.queryByText(/2 not evaluated/)).not.toBeInTheDocument();
|
||||
expect(view.container.querySelector('[data-backup-protected-row]')).toHaveTextContent('100%');
|
||||
});
|
||||
|
||||
it('shows the unassessed count when no target can be rated yet', () => {
|
||||
render(() => (
|
||||
<ProxmoxBackupsCoverageStrip
|
||||
title="Backup health"
|
||||
verdict={verdict(row('first', 'checking'), row('second', 'checking'))}
|
||||
/>
|
||||
));
|
||||
expect(screen.getByText(/2 checking/)).toBeVisible();
|
||||
expect(screen.queryByText(/not evaluated/)).not.toBeInTheDocument();
|
||||
expect(screen.getAllByText('Checking backups…')).toHaveLength(2);
|
||||
});
|
||||
|
||||
it('keeps unevaluated distinct from checking and from unknown assessments', () => {
|
||||
const view = render(() => (
|
||||
<ProxmoxBackupsCoverageStrip
|
||||
title="Backup health"
|
||||
verdict={verdict(row('host', 'not-evaluated'), row('unknown', 'unknown'))}
|
||||
/>
|
||||
));
|
||||
expect(screen.getByText(/1 not evaluated/)).toBeVisible();
|
||||
expect(screen.queryByText(/checking/)).not.toBeInTheDocument();
|
||||
expect(screen.getByText('Status unknown')).toBeVisible();
|
||||
expect(view.container.querySelector('[data-backup-verdict]')).toHaveTextContent('0 / 1');
|
||||
});
|
||||
|
||||
it('retires the counts when assessment completes without keeping phantom separators', () => {
|
||||
const [current, setCurrent] = createSignal(verdict(row('vm', 'checking')));
|
||||
const view = render(() => (
|
||||
<ProxmoxBackupsCoverageStrip title="Backup health" verdict={current()} />
|
||||
));
|
||||
expect(screen.getByText(/1 checking/)).toBeVisible();
|
||||
setCurrent(verdict(row('vm', 'protected')));
|
||||
expect(screen.queryByText(/checking|not evaluated/)).not.toBeInTheDocument();
|
||||
expect(view.container.querySelector('[data-backup-verdict]')).toHaveTextContent('1 / 1');
|
||||
expect(view.container.textContent).not.toContain('·');
|
||||
setCurrent(verdict());
|
||||
expect(screen.getAllByText('Nothing to rate yet')).toHaveLength(2);
|
||||
expect(view.container.querySelector('[data-backup-protected-row]')).toBeNull();
|
||||
});
|
||||
|
||||
it('preserves exception selection, rules and datastore controls beside the counts', () => {
|
||||
const onSelectGroup = vi.fn();
|
||||
const onSelectDatastoreProblem = vi.fn();
|
||||
render(() => (
|
||||
<ProxmoxBackupsCoverageStrip
|
||||
title="Backup health"
|
||||
verdict={verdict(row('vm', 'unprotected'), row('host', 'not-evaluated'))}
|
||||
rule="Restore points older than 7 days need attention."
|
||||
onSelectGroup={onSelectGroup}
|
||||
isGroupPressed={() => true}
|
||||
datastoreProblems={[
|
||||
{ family: 'verify', label: 'Verification failed', datastores: ['main'] },
|
||||
]}
|
||||
onSelectDatastoreProblem={onSelectDatastoreProblem}
|
||||
/>
|
||||
));
|
||||
expect(screen.getByText(/1 not evaluated/)).toBeVisible();
|
||||
const exception = screen.getByRole('button', { name: '1 no successful backup' });
|
||||
expect(exception).toHaveAttribute('aria-pressed', 'true');
|
||||
fireEvent.click(exception);
|
||||
expect(onSelectGroup).toHaveBeenCalledExactlyOnceWith('no-backup');
|
||||
fireEvent.click(
|
||||
screen.getByRole('button', { name: 'Verification failed on 1 datastore: main' }),
|
||||
);
|
||||
expect(onSelectDatastoreProblem).toHaveBeenCalledOnce();
|
||||
expect(screen.getByText('What the counts mean')).toBeVisible();
|
||||
expect(
|
||||
screen.getByText('Restore points older than 7 days need attention.'),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user