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.

Fix discovery scan scope keyboard navigation

pulse-triage[bot]23b3893ae88b
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index 05555e9fc5..18f17f0119 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,33 +1,31 @@
{
"version": 1,
- "base_sha": "d7a4dcf8e7c59fc35348236d8aeb3f25dc6062fe",
- "verified_at": "2026-09-02T05:33:34Z",
+ "base_sha": "77bf2a27c6551ce58c31569df607c5ce4ae11825",
+ "verified_at": "2026-09-02T06:10:16Z",
"result": "passed",
- "changed_paths": ["frontend-modern/src/components/shared/Subtabs.tsx"],
+ "changed_paths": ["frontend-modern/src/components/Settings/DiscoverySettingsForm.tsx"],
"content_sha256": {
- "frontend-modern/src/components/shared/Subtabs.tsx": "b7cb9398a8c39d56cf7db32202c1b99ad6cef7ca3f98ce527ae457ac6d86bd77"
+ "frontend-modern/src/components/Settings/DiscoverySettingsForm.tsx": "a9f3c0dc82e639d9e6fa283cd3ef9b071d322b43bcefb2e760d8ce7e43eeb3bb"
},
- "routes": ["/actions"],
+ "routes": ["/settings/infrastructure"],
"viewports": [
{
"width": 1280,
- "height": 800
+ "height": 720
},
{
- "width": 390,
- "height": 844
+ "width": 393,
+ "height": 851
}
],
"states": [
- "Open selected while the unselected History tab has keyboard focus at desktop and narrow widths",
- "History selected after explicit Enter activation at desktop and narrow widths",
- "Actions empty state after Open and History selection with reduced motion enabled"
+ "Discovery settings dialog open with Automatic scan selected at desktop and phone widths",
+ "Discovery settings dialog open with Custom subnets selected and keyboard focus retained on that radio at desktop and phone widths"
],
"interactions": [
- "focused Open and used ArrowRight to move focus to History without changing selection or requesting settled actions",
- "activated focused History with Enter and verified selection and content changed only after activation",
- "exercised ArrowLeft and ArrowRight wrapping plus Home and End focus movement",
- "inspected full-page desktop and narrow screenshots for focus visibility, placement, clipping, scrolling, and responsive layout",
- "verified the document had no horizontal overflow at desktop or narrow width"
+ "opened Discovery settings from the authenticated Infrastructure discovery band at desktop and phone widths",
+ "focused Automatic scan and pressed ArrowDown to select Custom subnets",
+ "verified focus stayed on Custom subnets after production subnet-field autofocus ran",
+ "verified aria-checked and the single roving tab stop moved from Automatic scan to Custom subnets"
]
}
diff --git a/frontend-modern/src/components/Settings/DiscoverySettingsForm.tsx b/frontend-modern/src/components/Settings/DiscoverySettingsForm.tsx
index 3ca6b84529..9bc9b57f16 100644
--- a/frontend-modern/src/components/Settings/DiscoverySettingsForm.tsx
+++ b/frontend-modern/src/components/Settings/DiscoverySettingsForm.tsx
@@ -46,6 +46,28 @@ export const DiscoverySettingsForm: Component<DiscoverySettingsFormProps> = (pro
}
void props.handleDiscoveryModeChange(mode);
};
+ const handleScanScopeKeyDown = (
+ event: KeyboardEvent & { currentTarget: HTMLButtonElement },
+ currentMode: 'auto' | 'custom',
+ ) => {
+ const direction =
+ event.key === 'ArrowRight' || event.key === 'ArrowDown'
+ ? 1
+ : event.key === 'ArrowLeft' || event.key === 'ArrowUp'
+ ? -1
+ : 0;
+ if (direction === 0) return;
+
+ event.preventDefault();
+ const modes = ['auto', 'custom'] as const;
+ const currentIndex = modes.indexOf(currentMode);
+ const targetMode = modes[(currentIndex + direction + modes.length) % modes.length];
+ const target = event.currentTarget
+ .closest('[role="radiogroup"]')
+ ?.querySelector<HTMLButtonElement>(`[role="radio"][data-scan-scope="${targetMode}"]`);
+ selectDiscoveryMode(targetMode);
+ queueMicrotask(() => target?.focus());
+ };
return (
<div class="space-y-5">
@@ -111,8 +133,11 @@ export const DiscoverySettingsForm: Component<DiscoverySettingsFormProps> = (pro
type="button"
role="radio"
aria-checked={props.discoveryMode() === 'auto'}
+ data-scan-scope="auto"
+ tabIndex={props.discoveryMode() === 'auto' ? 0 : -1}
disabled={scanScopeLocked()}
onClick={() => selectDiscoveryMode('auto')}
+ onKeyDown={(event) => handleScanScopeKeyDown(event, 'auto')}
class={scanScopeOptionClass('auto')}
>
<span class={scanScopeIndicatorClass('auto')} aria-hidden="true">
@@ -132,8 +157,11 @@ export const DiscoverySettingsForm: Component<DiscoverySettingsFormProps> = (pro
type="button"
role="radio"
aria-checked={props.discoveryMode() === 'custom'}
+ data-scan-scope="custom"
+ tabIndex={props.discoveryMode() === 'custom' ? 0 : -1}
disabled={scanScopeLocked()}
onClick={() => selectDiscoveryMode('custom')}
+ onKeyDown={(event) => handleScanScopeKeyDown(event, 'custom')}
class={scanScopeOptionClass('custom')}
>
<span class={scanScopeIndicatorClass('custom')} aria-hidden="true">
diff --git a/frontend-modern/src/components/Settings/__tests__/DiscoverySettingsForm.test.tsx b/frontend-modern/src/components/Settings/__tests__/DiscoverySettingsForm.test.tsx
index b944853198..043b2daa53 100644
--- a/frontend-modern/src/components/Settings/__tests__/DiscoverySettingsForm.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/DiscoverySettingsForm.test.tsx
@@ -91,6 +91,31 @@ describe('DiscoverySettingsForm', () => {
expect(screen.getByRole('button', { name: '192.168.1.0/24' })).toBeInTheDocument();
});
+ it('uses one tab stop and arrow keys to move and select within the scan scope group', async () => {
+ const { discoveryMode, handleDiscoveryModeChange } = renderDiscoverySettingsForm();
+
+ const autoScope = screen.getByRole('radio', { name: /Automatic scan \(full network scope\)/i });
+ const customScope = screen.getByRole('radio', { name: /Custom subnets \(targeted\)/i });
+
+ expect(autoScope).toHaveAttribute('tabindex', '0');
+ expect(customScope).toHaveAttribute('tabindex', '-1');
+
+ autoScope.focus();
+ fireEvent.keyDown(autoScope, { key: 'ArrowDown' });
+
+ await waitFor(() => expect(discoveryMode()).toBe('custom'));
+ expect(customScope).toHaveFocus();
+ expect(handleDiscoveryModeChange).toHaveBeenLastCalledWith('custom');
+ expect(autoScope).toHaveAttribute('tabindex', '-1');
+ expect(customScope).toHaveAttribute('tabindex', '0');
+
+ fireEvent.keyDown(customScope, { key: 'ArrowRight' });
+
+ await waitFor(() => expect(discoveryMode()).toBe('auto'));
+ expect(autoScope).toHaveFocus();
+ expect(handleDiscoveryModeChange).toHaveBeenLastCalledWith('auto');
+ });
+
it('commits a common custom subnet chip from the scan scope control', async () => {
const { commitDiscoverySubnet, discoverySubnetDraft } = renderDiscoverySettingsForm({
initialMode: 'custom',
diff --git a/tests/integration/tests/68-infrastructure-onboarding.spec.ts b/tests/integration/tests/68-infrastructure-onboarding.spec.ts
index 4b0b4bca52..d47b5d78cd 100644
--- a/tests/integration/tests/68-infrastructure-onboarding.spec.ts
+++ b/tests/integration/tests/68-infrastructure-onboarding.spec.ts
@@ -258,6 +258,56 @@ test.describe("Infrastructure onboarding", () => {
await expect(page).toHaveURL(/\/settings\/infrastructure(?:\?.*)?$/);
});
+ test("discovery scan scope uses radio-group keyboard navigation", async ({
+ page,
+ }) => {
+ await prepareOnboardingPage(page);
+ await page.route("**/api/system/settings", async (route) => {
+ if (route.request().method() !== "GET") {
+ await route.continue();
+ return;
+ }
+ const response = await route.fetch();
+ const body = await response.json();
+ body.discoveryEnabled = true;
+ body.discoverySubnet = "auto";
+ await route.fulfill({ response, json: body });
+ });
+
+ await page.goto("/settings/infrastructure", {
+ waitUntil: "domcontentloaded",
+ });
+ await page.waitForURL(/\/settings\/infrastructure(?:\?.*)?$/, {
+ timeout: 15_000,
+ });
+
+ const discoveryBand = page.getByRole("region", {
+ name: "Discover Proxmox systems",
+ });
+ await discoveryBand
+ .getByRole("button", { name: "Settings", exact: true })
+ .click();
+
+ const dialog = page.getByRole("dialog", { name: "Discovery settings" });
+ const automaticScope = dialog.getByRole("radio", {
+ name: /Automatic scan \(full network scope\)/i,
+ });
+ const customScope = dialog.getByRole("radio", {
+ name: /Custom subnets \(targeted\)/i,
+ });
+
+ await expect(automaticScope).toHaveAttribute("tabindex", "0");
+ await expect(customScope).toHaveAttribute("tabindex", "-1");
+
+ await automaticScope.focus();
+ await automaticScope.press("ArrowDown");
+
+ await expect(customScope).toBeFocused();
+ await expect(customScope).toHaveAttribute("aria-checked", "true");
+ await expect(customScope).toHaveAttribute("tabindex", "0");
+ await expect(automaticScope).toHaveAttribute("tabindex", "-1");
+ });
+
test("desktop picker add opens the matching modal", async ({
page,
}, testInfo) => {