From 6334ff59b6a3baaa5391b5a4c9d01ac048b72fc8 Mon Sep 17 00:00:00 2001 From: "pulse-triage[bot]" <249995291+pulse-triage[bot]@users.noreply.github.com> Date: Sun, 29 Nov 2026 05:03:51 +0000 Subject: [PATCH] Fix Alerts bulk-edit dialog, slider focus/contrast, and destinations Repair layout, keyboard focus, contrast, and semantic-token defects across Alerts Thresholds and Notification Destinations surfaces: - BulkEditDialog.tsx: remove the duplicate nested fixed inset-0 min-h-screen overlay inside Dialog (which collapsed Dialog's role="dialog" shell to a 2px ghost border strip and dropped horizontal padding at 360px phone widths), link ariaLabelledBy to the heading, pass disabled={isOff()} to ThresholdSlider so metrics toggled Off visibly dim and disable, raise Unchanged/Clear dark-mode contrast with text-muted, and add min-h-11 mobile touch targets and blue focus-visible rings to Clear, Cancel, and Apply. - ThresholdSlider.tsx: add peer on the hidden range input and a visible blue peer-focus-visible ring on the custom thumb pill so keyboard users can see slider focus, and render thumb values in text-base-content (keeping metric color borders via border-current) to fix ~2.2:1 light-mode contrast on green and amber thresholds. - ThresholdsTable.tsx: add blue focus-visible rings on the help-banner dismiss, Expand all, and Collapse all buttons, and replace hover:text-muted with text-muted hover:text-base-content. - AlertDeliveryLogCard.tsx: migrate hardcoded gray-* neutral classes to semantic tokens (text-base-content, text-muted, border-border, hover:bg-surface-hover, divide-border, bg-surface-alt) and add a 44px mobile touch target plus blue offset focus-visible ring on Refresh. - WebhookConfigForm.tsx, EmailProviderSelect.tsx, AlertAppriseDestinationsSection.tsx, and AlertDestinationOffSummary.tsx: add aria-pressed and blue focus-visible rings to webhook service selector buttons, add focus-visible rings to custom field/header/reapply/test/show- settings buttons, and replace overflow-hidden with min-w-0 on EmailProviderSelect so edge focus rings are not clipped at 360px. - Add targeted Vitest regression assertions across all seven test files and record paired desktop/narrow dark/light browser proof receipt 2d83a24486fa9fd6.json. Contract-Neutral: Fixes dialog layout, slider focus/contrast, semantic tokens, and keyboard accessibility in existing Alerts Thresholds and Destinations UI components without changing API payloads, routes, or subsystem contracts. Change-source: pulse-maintainer --- .../2d83a24486fa9fd6.json | 56 ++++ .../src/components/Alerts/BulkEditDialog.tsx | 246 +++++++++--------- .../Alerts/EmailProviderSelect.test.tsx | 23 ++ .../components/Alerts/EmailProviderSelect.tsx | 6 +- .../src/components/Alerts/ThresholdsTable.tsx | 6 +- .../components/Alerts/WebhookConfig.test.tsx | 32 +++ .../components/Alerts/WebhookConfigForm.tsx | 11 +- .../Alerts/__tests__/BulkEditDialog.test.tsx | 37 +++ .../Alerts/__tests__/ThresholdsTable.test.tsx | 15 ++ .../Workloads/ThresholdSlider.test.tsx | 14 + .../components/Workloads/ThresholdSlider.tsx | 8 +- .../AlertAppriseDestinationsSection.test.tsx | 8 + .../AlertAppriseDestinationsSection.tsx | 2 +- .../alerts/AlertDeliveryLogCard.test.tsx | 19 ++ .../features/alerts/AlertDeliveryLogCard.tsx | 32 ++- .../alerts/AlertDestinationOffSummary.tsx | 2 +- 16 files changed, 360 insertions(+), 157 deletions(-) create mode 100644 frontend-modern/browser-verification/2d83a24486fa9fd6.json diff --git a/frontend-modern/browser-verification/2d83a24486fa9fd6.json b/frontend-modern/browser-verification/2d83a24486fa9fd6.json new file mode 100644 index 0000000000..3addfc1f68 --- /dev/null +++ b/frontend-modern/browser-verification/2d83a24486fa9fd6.json @@ -0,0 +1,56 @@ +{ + "version": 1, + "base_sha": "0397f636509f77c8487d967c06baa665b9ed1989", + "verified_at": "2026-11-29T04:58:58Z", + "result": "passed", + "changed_paths": [ + "frontend-modern/src/components/Alerts/BulkEditDialog.tsx", + "frontend-modern/src/components/Alerts/EmailProviderSelect.tsx", + "frontend-modern/src/components/Alerts/ThresholdsTable.tsx", + "frontend-modern/src/components/Alerts/WebhookConfigForm.tsx", + "frontend-modern/src/components/Workloads/ThresholdSlider.tsx", + "frontend-modern/src/features/alerts/AlertAppriseDestinationsSection.tsx", + "frontend-modern/src/features/alerts/AlertDeliveryLogCard.tsx", + "frontend-modern/src/features/alerts/AlertDestinationOffSummary.tsx" + ], + "content_sha256": { + "frontend-modern/src/components/Alerts/BulkEditDialog.tsx": "15538117f470b8cc60808a234ec71d2b1d591466beee943c672eb8c1d696037f", + "frontend-modern/src/components/Alerts/EmailProviderSelect.tsx": "a3047632fb8524bf3944381ef6c68f3044adb96b7eca7e87f522936e9c4ead43", + "frontend-modern/src/components/Alerts/ThresholdsTable.tsx": "c9aa5b195714fcadababba721d39e4d5673cc0cc9ad2143a68907b5f2d6435d8", + "frontend-modern/src/components/Alerts/WebhookConfigForm.tsx": "a8717cc9042bcb0078e2620becd3261311c0ad0fdcb9b8ec1efaa9a43243101a", + "frontend-modern/src/components/Workloads/ThresholdSlider.tsx": "f0f5634e782fbd8994b3e3d089c2aa545add6ff56e529a073710af7b55c2c9d7", + "frontend-modern/src/features/alerts/AlertAppriseDestinationsSection.tsx": "a6dcef4eb11235df4dd75c3c7d07d10d72a6c8e310b7daf6fa44d07babe4b15e", + "frontend-modern/src/features/alerts/AlertDeliveryLogCard.tsx": "80de8708b266a03dda250c3e7267fd057c73fb06b28ba5ae1416a09e759cb9bf", + "frontend-modern/src/features/alerts/AlertDestinationOffSummary.tsx": "3cd0418d674a2e7c027da1cc9a68ba65882897231a01b14e4439deeced8d0dcd" + }, + "routes": [ + "/alerts/thresholds", + "/alerts/destinations" + ], + "viewports": [ + { + "width": 1440, + "height": 940 + }, + { + "width": 360, + "height": 820 + } + ], + "states": [ + "Paired before (0397f63650) and after production builds on Chromium desktop 1440x940 dark/light and WebKit mobile 360x820 dark/light with reduced motion, 0px horizontal overflow, and zero console/page errors", + "BulkEditDialog renders directly inside Dialog without a nested fixed overlay (eliminating the 2px ghost bar and full-bleed 0..360px phone layout), links aria-labelledby, disables ThresholdSlider when Memory % is toggled Off, raises Unchanged/Clear dark-mode contrast with text-muted, and sizes mobile Clear/Cancel/Apply controls to 44px with focus-visible rings", + "ThresholdSlider exposes a visible blue peer-focus-visible ring around the focused CPU % thumb pill and renders thumb values in high-contrast text-base-content across dark and light modes", + "ThresholdsTable Expand all, Collapse all, and help-banner dismiss controls render consistent blue focus-visible rings and text-muted hover:text-base-content contrast", + "AlertDeliveryLogCard renders semantic neutral surface/border/text tokens and gives Refresh delivery status a 44px mobile touch target with a blue offset focus-visible ring", + "WebhookConfigForm service selector grid buttons expose aria-pressed=true/false and blue focus-visible rings alongside Add/Remove header and custom field buttons", + "EmailProviderSelect root wrapper removes overflow-hidden so Reapply defaults no longer clips its left focus-ring edge at 360px, and Reapply defaults, Send test email, Apprise Send test notification, and Show settings render crisp blue focus-visible rings" + ], + "interactions": [ + "Keyboard-focused Expand all on /alerts/thresholds, expanded Virtualization Hosts, selected both nodes, and opened Bulk Edit Settings across desktop 1440x940 and narrow 360x820 dark/light profiles", + "Toggled Memory % Off inside BulkEditDialog and verified its ThresholdSlider becomes disabled and dimmed while keyboard-focusing CPU % shows the peer-focus-visible ring", + "Navigated to /alerts/destinations and keyboard-focused Refresh delivery status inside Recent delivery activity", + "Clicked Edit on Ops Discord webhook, opened Service Type selector, and keyboard-focused Discord service option verifying aria-pressed=true and focus-visible ring", + "Keyboard-focused Reapply defaults in Email notifications and Show settings in Apprise notifications across desktop and narrow viewports" + ] +} diff --git a/frontend-modern/src/components/Alerts/BulkEditDialog.tsx b/frontend-modern/src/components/Alerts/BulkEditDialog.tsx index 9a4e26f60b..ca22520008 100644 --- a/frontend-modern/src/components/Alerts/BulkEditDialog.tsx +++ b/frontend-modern/src/components/Alerts/BulkEditDialog.tsx @@ -1,4 +1,4 @@ -import { Show, For, createSignal, createEffect } from 'solid-js'; +import { Show, For, createSignal, createEffect, createUniqueId } from 'solid-js'; import { Dialog } from '../shared/Dialog'; import { StatusBadge } from '../shared/StatusBadge'; import { ThresholdSlider } from '../Workloads/ThresholdSlider'; @@ -18,7 +18,6 @@ import { ALERT_BULK_EDIT_UNCHANGED_LABEL, getAlertBulkEditApplyLabel, getAlertBulkEditDescription, - getAlertBulkEditOpenLabel, } from '@/utils/alertBulkEditPresentation'; export interface BulkEditDialogProps { @@ -62,6 +61,7 @@ export function normalizeMetricKey(column: string): string { export function BulkEditDialog(props: BulkEditDialogProps) { const [thresholds, setThresholds] = createSignal>({}); + const titleId = `bulk-edit-dialog-${createUniqueId()}-title`; createEffect(() => { if (props.isOpen) { @@ -95,134 +95,132 @@ export function BulkEditDialog(props: BulkEditDialogProps) { }; return ( - -
-
-

- {ALERT_BULK_EDIT_DIALOG_TITLE} -

-

- {getAlertBulkEditDescription(props.selectedIds.length)} -

+ +

+ {ALERT_BULK_EDIT_DIALOG_TITLE} +

+

{getAlertBulkEditDescription(props.selectedIds.length)}

-
- - {(column) => { - const metric = normalizeMetricKey(column); - if (metric === 'backup' || metric === 'snapshot') return null; - const bounds = getMetricBounds(metric); - const val = () => thresholds()[metric]; - const isOff = () => isAlertResourceMetricOff(val()); +
+ + {(column) => { + const metric = normalizeMetricKey(column); + if (metric === 'backup' || metric === 'snapshot') return null; + const bounds = getMetricBounds(metric); + const val = () => thresholds()[metric]; + const isOff = () => isAlertResourceMetricOff(val()); - return ( -
-
- {column} -
- - {isOff() - ? getAlertResourceTableMetricPlaceholder(true) - : val() !== undefined - ? val() - : ALERT_BULK_EDIT_UNCHANGED_LABEL} - - - setThresholds((prev) => ({ - ...prev, - // Re-enabling has to stage a real threshold: an - // undefined entry reads as "unchanged" on save, so - // the selected resources would stay disabled. - [metric]: isOff() - ? getAlertResourceEnabledDefault(metric) - : ALERT_RESOURCE_METRIC_OFF_VALUE, - })) - } - {...getAlertResourceTableMetricOffToggleProps()} + return ( +
+
+ {column} +
+ + {isOff() + ? getAlertResourceTableMetricPlaceholder(true) + : val() !== undefined + ? val() + : ALERT_BULK_EDIT_UNCHANGED_LABEL} + + + setThresholds((prev) => ({ + ...prev, + // Re-enabling has to stage a real threshold: an + // undefined entry reads as "unchanged" on save, so + // the selected resources would stay disabled. + [metric]: isOff() + ? getAlertResourceEnabledDefault(metric) + : ALERT_RESOURCE_METRIC_OFF_VALUE, + })) + } + {...getAlertResourceTableMetricOffToggleProps()} + /> +
+
+
+
+ {['cpu', 'memory', 'disk', 'temperature'].includes(metric) ? ( +
+ { + if (v < bounds.min || v > bounds.max) return; + setThresholds((prev) => ({ ...prev, [metric]: v })); + }} />
-
-
-
- {['cpu', 'memory', 'disk', 'temperature'].includes(metric) ? ( -
- { - if (v < bounds.min || v > bounds.max) return; - setThresholds((prev) => ({ ...prev, [metric]: v })); - }} - /> -
- ) : ( - { - const v = parseFloat(e.currentTarget.value); - if (!isNaN(v) && (v < bounds.min || v > bounds.max)) { - return; - } - setThresholds((prev) => ({ - ...prev, - [metric]: isNaN(v) ? undefined : v, - })); - }} - /> - )} -
-
- - - -
-
+ ) : ( + { + const v = parseFloat(e.currentTarget.value); + if (!isNaN(v) && (v < bounds.min || v > bounds.max)) { + return; + } + setThresholds((prev) => ({ + ...prev, + [metric]: isNaN(v) ? undefined : v, + })); + }} + /> + )}
- ); - }} - -
+
+ + + +
+
+
+ ); + }} + +
-
- - -
-
+
+ +
); diff --git a/frontend-modern/src/components/Alerts/EmailProviderSelect.test.tsx b/frontend-modern/src/components/Alerts/EmailProviderSelect.test.tsx index 06e37aa777..681d85a35c 100644 --- a/frontend-modern/src/components/Alerts/EmailProviderSelect.test.tsx +++ b/frontend-modern/src/components/Alerts/EmailProviderSelect.test.tsx @@ -881,4 +881,27 @@ describe('EmailProviderSelect', () => { fireEvent.input(rateLimitInput, { target: { value: '25' } }); expect(config().rateLimit).toBe(25); }); + + it('avoids clipping focus rings on root wrapper and gives Reapply defaults and Test focus rings', async () => { + const { container } = render(() => ( + + )); + + await waitFor(() => { + expect(getEmailProvidersMock).toHaveBeenCalled(); + }); + + expect(container.firstElementChild?.className).not.toContain('overflow-hidden'); + expect(container.firstElementChild?.className).toContain('min-w-0'); + + const reapplyButton = screen.getByRole('button', { name: /reapply defaults/i }); + expect(reapplyButton.className).toContain('focus-visible:ring-2'); + + const testButton = screen.getByRole('button', { name: /send test email/i }); + expect(testButton.className).toContain('focus-visible:ring-2'); + }); }); diff --git a/frontend-modern/src/components/Alerts/EmailProviderSelect.tsx b/frontend-modern/src/components/Alerts/EmailProviderSelect.tsx index 862c975ae0..420ef549ad 100644 --- a/frontend-modern/src/components/Alerts/EmailProviderSelect.tsx +++ b/frontend-modern/src/components/Alerts/EmailProviderSelect.tsx @@ -79,7 +79,7 @@ export function EmailProviderSelect(props: EmailProviderSelectProps) { }; return ( -
+
{ALERT_EMAIL_REAPPLY_DEFAULTS_LABEL} @@ -409,7 +409,7 @@ export function EmailProviderSelect(props: EmailProviderSelectProps) { type="button" onClick={props.onTest} disabled={props.testing || !props.config.enabled} - class="min-h-11 rounded-sm border border-blue-500 px-3 py-1.5 text-xs font-medium text-blue-600 transition-colors hover:bg-blue-50 disabled:opacity-50 disabled:cursor-not-allowed sm:min-h-0 dark:border-blue-400 dark:text-blue-300 dark:hover:bg-blue-900/25" + class="min-h-11 rounded-sm border border-blue-500 px-3 py-1.5 text-xs font-medium text-blue-600 transition-colors hover:bg-blue-50 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 disabled:opacity-50 disabled:cursor-not-allowed sm:min-h-0 dark:border-blue-400 dark:text-blue-300 dark:hover:bg-blue-900/25 dark:focus-visible:ring-offset-surface" > {getAlertEmailTestButtonLabel(Boolean(props.testing))} diff --git a/frontend-modern/src/components/Alerts/ThresholdsTable.tsx b/frontend-modern/src/components/Alerts/ThresholdsTable.tsx index 905c56e4de..65877b8bc3 100644 --- a/frontend-modern/src/components/Alerts/ThresholdsTable.tsx +++ b/frontend-modern/src/components/Alerts/ThresholdsTable.tsx @@ -96,7 +96,7 @@ export function ThresholdsTable(props: ThresholdsTableProps) { @@ -191,7 +191,7 @@ export function ThresholdsTable(props: ThresholdsTableProps) { diff --git a/frontend-modern/src/components/Alerts/WebhookConfig.test.tsx b/frontend-modern/src/components/Alerts/WebhookConfig.test.tsx index e3e626544e..524cc38375 100644 --- a/frontend-modern/src/components/Alerts/WebhookConfig.test.tsx +++ b/frontend-modern/src/components/Alerts/WebhookConfig.test.tsx @@ -1611,6 +1611,38 @@ describe('WebhookConfig', () => { 'button', ); }); + + it('exposes aria-pressed and focus-visible rings on webhook service selector and field controls', async () => { + render(() => ( + + )); + + fireEvent.click(screen.getByRole('button', { name: /add webhook/i })); + + // Adding starts with the service picker already open. + const serviceButtons = await waitFor(() => { + const buttons = screen + .getAllByRole('button') + .filter((button) => button.hasAttribute('aria-pressed')); + expect(buttons.length).toBeGreaterThan(0); + return buttons; + }); + expect(serviceButtons.some((button) => button.getAttribute('aria-pressed') === 'true')).toBe( + true, + ); + for (const button of serviceButtons) { + expect(button.className).toContain('focus-visible:ring-2'); + } + + const addHeaderButton = screen.getByRole('button', { name: /add header/i }); + expect(addHeaderButton.className).toContain('focus-visible:ring-2'); + }); }); describe('webhook test/save parity', () => { diff --git a/frontend-modern/src/components/Alerts/WebhookConfigForm.tsx b/frontend-modern/src/components/Alerts/WebhookConfigForm.tsx index 25a4069c21..d1c7fe108a 100644 --- a/frontend-modern/src/components/Alerts/WebhookConfigForm.tsx +++ b/frontend-modern/src/components/Alerts/WebhookConfigForm.tsx @@ -117,8 +117,9 @@ export function WebhookConfigForm(props: WebhookConfigFormProps) { {(service) => ( @@ -359,7 +360,7 @@ export function WebhookConfigForm(props: WebhookConfigFormProps) { @@ -396,7 +397,7 @@ export function WebhookConfigForm(props: WebhookConfigFormProps) { @@ -406,7 +407,7 @@ export function WebhookConfigForm(props: WebhookConfigFormProps) { diff --git a/frontend-modern/src/components/Alerts/__tests__/BulkEditDialog.test.tsx b/frontend-modern/src/components/Alerts/__tests__/BulkEditDialog.test.tsx index 0c9e0719d2..9371a9b0b3 100644 --- a/frontend-modern/src/components/Alerts/__tests__/BulkEditDialog.test.tsx +++ b/frontend-modern/src/components/Alerts/__tests__/BulkEditDialog.test.tsx @@ -11,6 +11,7 @@ vi.mock('../../Workloads/ThresholdSlider', () => ({ min: number; max: number; value: number; + disabled?: boolean; onChange: (v: number) => void; }) => ( ({ min={props.min} max={props.max} value={props.value} + disabled={props.disabled} onInput={(e) => props.onChange(parseInt(e.currentTarget.value))} /> ), @@ -433,4 +435,39 @@ describe('BulkEditDialog', () => { expect(screen.getByText('Apply to 5 items')).toBeInTheDocument(); }); + + it('renders directly inside Dialog without a nested fixed overlay and links aria-labelledby', () => { + const props = defaultProps(); + props.columns = ['CPU %', 'Memory %']; + render(() => ); + + const dialog = screen.getByRole('dialog', { name: 'Bulk Edit Settings' }); + expect(dialog.querySelector('.fixed')).toBeNull(); + expect(dialog).toHaveAttribute('aria-labelledby'); + + const cancelButton = screen.getByRole('button', { name: 'Cancel' }); + const applyButton = screen.getByRole('button', { name: /Apply to 3 items/ }); + expect(cancelButton.className).toContain('min-h-11'); + expect(cancelButton.className).toContain('focus-visible:ring-2'); + expect(applyButton.className).toContain('min-h-11'); + expect(applyButton.className).toContain('focus-visible:ring-2'); + }); + + it('disables slider controls while a metric is toggled Off and re-enables them when toggled On', () => { + const props = defaultProps(); + props.columns = ['CPU %']; + render(() => ); + + const slider = screen.getByTestId('slider-cpu') as HTMLInputElement; + expect(slider.disabled).toBe(false); + + fireEvent.click(screen.getByRole('button', { name: 'On' })); + expect(slider.disabled).toBe(true); + expect(screen.getByRole('button', { name: 'Clear' }).className).toContain( + 'focus-visible:ring-2', + ); + + fireEvent.click(screen.getByRole('button', { name: 'Off' })); + expect(slider.disabled).toBe(false); + }); }); diff --git a/frontend-modern/src/components/Alerts/__tests__/ThresholdsTable.test.tsx b/frontend-modern/src/components/Alerts/__tests__/ThresholdsTable.test.tsx index 5af2af3e64..a3e50f6860 100644 --- a/frontend-modern/src/components/Alerts/__tests__/ThresholdsTable.test.tsx +++ b/frontend-modern/src/components/Alerts/__tests__/ThresholdsTable.test.tsx @@ -1528,6 +1528,21 @@ describe('ThresholdsTable V6 ID compatibility', () => { render(() => ); const expandButton = screen.getByRole('button', { name: 'Expand all' }); + const collapseButton = screen.getByRole('button', { name: 'Collapse all' }); expect(expandButton.parentElement).toHaveClass('items-center'); + expect(expandButton.className).toContain('focus-visible:ring-2'); + expect(expandButton.className).toContain('text-muted'); + expect(expandButton.className).toContain('hover:text-base-content'); + expect(collapseButton.className).toContain('focus-visible:ring-2'); + expect(collapseButton.className).toContain('text-muted'); + expect(collapseButton.className).toContain('hover:text-base-content'); + }); + + it('provides a visible keyboard focus ring on the help banner dismiss button', () => { + localStorage.removeItem('pulse-thresholds-help-dismissed'); + render(() => ); + + const dismissButton = screen.getByRole('button', { name: /dismiss/i }); + expect(dismissButton.className).toContain('focus-visible:ring-2'); }); }); diff --git a/frontend-modern/src/components/Workloads/ThresholdSlider.test.tsx b/frontend-modern/src/components/Workloads/ThresholdSlider.test.tsx index 4501f07667..efea0ddb0f 100644 --- a/frontend-modern/src/components/Workloads/ThresholdSlider.test.tsx +++ b/frontend-modern/src/components/Workloads/ThresholdSlider.test.tsx @@ -161,4 +161,18 @@ describe('ThresholdSlider', () => { }); expect(removeDocumentSpy).toHaveBeenCalledWith('mouseup', expect.any(Function)); }); + + it('exposes peer-focus-visible thumb styling and high-contrast thumb label text', () => { + render(() => ); + + const input = screen.getByTitle('MEMORY: 65%'); + expect(input.className).toContain('peer'); + + const label = screen.getByText('65%'); + expect(label.className).toContain('text-base-content'); + + const thumbWrapper = label.closest('.absolute.pointer-events-none')!; + expect(thumbWrapper.className).toContain('peer-focus-visible:[&>div>div]:ring-2'); + expect(thumbWrapper.className).toContain('peer-focus-visible:[&>div>div]:ring-blue-500'); + }); }); diff --git a/frontend-modern/src/components/Workloads/ThresholdSlider.tsx b/frontend-modern/src/components/Workloads/ThresholdSlider.tsx index dae5b17ed8..35e071a1e8 100644 --- a/frontend-modern/src/components/Workloads/ThresholdSlider.tsx +++ b/frontend-modern/src/components/Workloads/ThresholdSlider.tsx @@ -33,14 +33,14 @@ export function ThresholdSlider(props: ThresholdSliderProps) { onInput={state.handleInput} onMouseDown={state.handleMouseDown} onWheel={state.handleInputWheel} - class={`absolute inset-0 w-full h-3.5 opacity-0 ${props.disabled ? 'cursor-not-allowed' : 'cursor-pointer'} z-20 touch-none`} + class={`peer absolute inset-0 w-full h-3.5 opacity-0 ${props.disabled ? 'cursor-not-allowed' : 'cursor-pointer'} z-20 touch-none`} disabled={props.disabled} title={state.sliderTitle()} /> {/* Custom thumb with value */}
div>div]:ring-2 peer-focus-visible:[&>div>div]:ring-blue-500 peer-focus-visible:[&>div>div]:ring-offset-1 peer-focus-visible:[&>div>div]:ring-offset-surface ${getThresholdSliderTextClass(props.type)}`} style={{ left: `${state.thumbPosition()}%`, transform: state.thumbTransform(), @@ -48,7 +48,9 @@ export function ThresholdSlider(props: ThresholdSliderProps) { >
- {state.sliderLabel()} + + {state.sliderLabel()} +
diff --git a/frontend-modern/src/features/alerts/AlertAppriseDestinationsSection.test.tsx b/frontend-modern/src/features/alerts/AlertAppriseDestinationsSection.test.tsx index 264a99cd46..af8167cd98 100644 --- a/frontend-modern/src/features/alerts/AlertAppriseDestinationsSection.test.tsx +++ b/frontend-modern/src/features/alerts/AlertAppriseDestinationsSection.test.tsx @@ -108,5 +108,13 @@ describe('AlertAppriseDestinationsSection', () => { const testButton = screen.getByRole('button', { name: /send test/i }); expect(testButton).toBeInTheDocument(); expect(testButton).toBeDisabled(); + expect(testButton.className).toContain('focus-visible:ring-2'); + }); + + it('gives the off-state Show settings button a visible keyboard focus ring', () => { + renderSection(makeConfig({ enabled: false })); + + const showSettings = screen.getByRole('button', { name: /show settings/i }); + expect(showSettings.className).toContain('focus-visible:ring-2'); }); }); diff --git a/frontend-modern/src/features/alerts/AlertAppriseDestinationsSection.tsx b/frontend-modern/src/features/alerts/AlertAppriseDestinationsSection.tsx index e1ed626466..7c4c7f0c62 100644 --- a/frontend-modern/src/features/alerts/AlertAppriseDestinationsSection.tsx +++ b/frontend-modern/src/features/alerts/AlertAppriseDestinationsSection.tsx @@ -99,7 +99,7 @@ export function AlertAppriseDestinationsSection(props: AlertAppriseDestinationsS