mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-30 01:32:00 +01:00
Compose SearchField in AlertDeliveryLogCard to satisfy template audit
Replace the raw native <input type="search"> in AlertDeliveryLogCard with the canonical SearchField primitive so Recent delivery activity passes scripts/shared-template-audit.mjs (search-control-native-search-input) and SharedPrimitives.guardrails.test.ts while preserving role="searchbox", accessible labeling, Escape-to-clear, and adding canonical search chrome and 44px phone Clear search controls. Contract-Neutral: UI-only SearchField adoption in AlertDeliveryLogCard with no API, backend, schema, or subsystem contract delta. Change-source: pulse-maintainer
This commit is contained in:
35
frontend-modern/browser-verification/fddc8da7b21a84b3.json
Normal file
35
frontend-modern/browser-verification/fddc8da7b21a84b3.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"version": 1,
|
||||
"base_sha": "322b91e17cf6ba91f72e4c783c048094fdc88fbc",
|
||||
"verified_at": "2026-11-28T11:56:24Z",
|
||||
"result": "passed",
|
||||
"changed_paths": [
|
||||
"frontend-modern/src/features/alerts/AlertDeliveryLogCard.tsx"
|
||||
],
|
||||
"content_sha256": {
|
||||
"frontend-modern/src/features/alerts/AlertDeliveryLogCard.tsx": "e518312a266ce4dcfe57ba23fb9a5b00f285a865ab1ae0111eb4a5fe606bf393"
|
||||
},
|
||||
"routes": [
|
||||
"/alerts/notifications"
|
||||
],
|
||||
"viewports": [
|
||||
{
|
||||
"width": 1440,
|
||||
"height": 940
|
||||
},
|
||||
{
|
||||
"width": 360,
|
||||
"height": 820
|
||||
}
|
||||
],
|
||||
"states": [
|
||||
"Paired production Vite builds of untouched main (939b7976ad) and patched HEAD served locally via pulse-worker-browser over identical synthetic notification health, delivery-log, and held-event payloads in desktop Chromium (1440x940 light theme, en-GB, UTC) and touch phone WebKit (360x820 dark theme, en-GB, UTC).",
|
||||
"/alerts/notifications Recent delivery activity unfiltered view: renders inline outcome filter chips with counts (All (8), Failures (2), Retrying (1), Held (2), Delivered (3)), canonical SearchField (0 native type=search inputs, 40px desktop height, 44px phone height, unclipped placeholder), visible held/deferred explanation paragraphs, visible attempt counts (4 attempts, 3 attempts, 2 attempts), and semantic theme tokens.",
|
||||
"/alerts/notifications Recent delivery activity filtered view: clicking Failures (2) sets aria-pressed=true and isolates both failure rows (Ops Discord dead_letter and Email failed); searching 'quiet hours' narrows to pve2-db (memory) and reveals the canonical Clear search button (24x24 desktop, 44x44 phone) which restores all 8 rows; searching 'flapping' and pressing Escape restores all 8 rows; non-matching search shows 'No matching delivery activity.' with a working 'Clear filters' reset.",
|
||||
"Zero console errors, zero page errors, zero HTTP >= 400 responses, and 0px horizontal overflow across all captured desktop and phone states; all 6 paired before/after worker-owned PNG captures were visually inspected."
|
||||
],
|
||||
"interactions": [
|
||||
"Loaded /alerts/notifications on desktop Chromium (1440x940 light) and touch phone WebKit (360x820 dark), confirmed all 8 interleaved rows, canonical SearchField chrome with zero native type=search inputs, visible held explanation copy, and attempt counts.",
|
||||
"Clicked Failures (2) chip and verified aria-pressed=true and 2 filtered rows, returned to All (8), searched 'quiet hours' and clicked SearchField's Clear search button, searched 'flapping' and pressed Escape, searched 'no-such-destination' and clicked Clear filters to restore all 8 rows."
|
||||
]
|
||||
}
|
||||
@@ -721,6 +721,13 @@ describe('AlertDeliveryLogCard', () => {
|
||||
expect(screen.getAllByRole('listitem')).toHaveLength(1);
|
||||
expect(screen.getByText('nas-main (disk)')).toBeInTheDocument();
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Clear search' }));
|
||||
expect(search).toHaveValue('');
|
||||
expect(screen.getAllByRole('listitem')).toHaveLength(3);
|
||||
|
||||
fireEvent.input(search, { target: { value: '4 state changes' } });
|
||||
expect(screen.getAllByRole('listitem')).toHaveLength(1);
|
||||
|
||||
fireEvent.keyDown(search, { key: 'Escape' });
|
||||
expect(search).toHaveValue('');
|
||||
expect(screen.getAllByRole('listitem')).toHaveLength(3);
|
||||
|
||||
@@ -7,6 +7,7 @@ import type {
|
||||
Webhook,
|
||||
} from '@/api/notifications';
|
||||
import { Card } from '@/components/shared/Card';
|
||||
import { SearchField } from '@/components/shared/SearchField';
|
||||
import type { AlertEvent } from '@/types/api';
|
||||
import {
|
||||
getAlertDeliveryLogFailureClassLabel,
|
||||
@@ -359,20 +360,13 @@ export function AlertDeliveryLogCard(props: AlertDeliveryLogCardProps) {
|
||||
</div>
|
||||
</Show>
|
||||
<Show when={showSearch()}>
|
||||
<div class="w-full sm:ml-auto sm:w-64">
|
||||
<input
|
||||
type="search"
|
||||
<div class="w-full sm:ml-auto sm:w-72">
|
||||
<SearchField
|
||||
value={searchQuery()}
|
||||
onInput={(event) => setSearchQuery(event.currentTarget.value)}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === 'Escape' && searchQuery()) {
|
||||
event.preventDefault();
|
||||
setSearchQuery('');
|
||||
}
|
||||
}}
|
||||
onChange={setSearchQuery}
|
||||
placeholder="Filter destination, alert, or error"
|
||||
aria-label="Filter delivery activity"
|
||||
class="w-full rounded-md border border-border bg-surface px-2.5 py-1.5 text-xs text-base-content placeholder:text-muted focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-blue-500"
|
||||
title="Filter delivery activity"
|
||||
role="searchbox"
|
||||
/>
|
||||
</div>
|
||||
</Show>
|
||||
|
||||
Reference in New Issue
Block a user