diff --git a/components/LiveFeedDateRangeFilter.jsx b/components/LiveFeedDateRangeFilter.jsx index 0b7c2d1..50420b5 100644 --- a/components/LiveFeedDateRangeFilter.jsx +++ b/components/LiveFeedDateRangeFilter.jsx @@ -21,6 +21,7 @@ export default function LiveFeedDateRangeFilter({ onChange, onInteractionChange = () => {}, embedded = false, + triggerClassName = "", }) { const fromMs = value?.from?.getTime?.() ?? null; const toMs = value?.to?.getTime?.() ?? null; @@ -66,7 +67,7 @@ export default function LiveFeedDateRangeFilter({ - )} diff --git a/test/recognition-feed-filter-preference.test.mjs b/test/recognition-feed-filter-preference.test.mjs index 439f430..282b13d 100644 --- a/test/recognition-feed-filter-preference.test.mjs +++ b/test/recognition-feed-filter-preference.test.mjs @@ -178,3 +178,38 @@ test("Recognition Feed restores saved state before querying and keeps explicit l "clearing filters must preserve the independently saved rows-per-page preference" ); }); + +test("Recognition Feed desktop search and filters use one aligned five-column grid", async () => { + const table = await readFile( + new URL("../components/PlateTable.jsx", import.meta.url), + "utf8" + ); + const desktopSearchGrid = table.slice( + table.indexOf("{/* Search bar - Full Width on Mobile */}"), + table.indexOf("{/* Active filters display */}") + ); + + assert.match(table, /className="grid w-full grid-cols-1 gap-2 sm:grid-cols-5"/); + assert.match(desktopSearchGrid, /className="flex w-full items-center sm:col-span-2"/); + assert.match(desktopSearchGrid, /className="hidden w-full sm:block"/); + assert.match(desktopSearchGrid, /className="hidden sm:contents"/); + const labels = [ + 'placeholder="Search plates or speed..."', + 'prefixLabel="Plate matching"', + 'allLabel="All tags"', + 'allLabel="All cameras"', + " previousIndex, `${label} must remain in the requested grid order`); + previousIndex = index; + } + assert.match(desktopSearchGrid, /triggerClassName="w-full justify-start"/); + assert.doesNotMatch(desktopSearchGrid, />\s*Clear Filters\s*