From 2c63bf7a3ad2cca79e8edc93d10366d73ac2ba05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Wed, 11 Nov 2026 00:12:04 +0100 Subject: [PATCH] chore(labs): tidy the filter rail follow-ups Drop a local-only ignore line, end the search placeholder with the ellipsis character the other placeholders use, and put the UrlFilterSyncOptions interface above the hook's doc comment so that comment documents the hook. --- .gitignore | 4 ---- messages/de.json | 2 +- messages/en.json | 2 +- messages/es.json | 2 +- messages/fr.json | 2 +- messages/it.json | 2 +- messages/ko.json | 2 +- messages/nl.json | 2 +- messages/pl.json | 2 +- messages/pt-BR.json | 2 +- messages/ru.json | 2 +- .../labs/__tests__/lab-filter-rail.test.tsx | 4 ++-- src/hooks/use-url-filter-sync.ts | 14 +++++++------- 13 files changed, 19 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index 620d5f46a..655bb269e 100644 --- a/.gitignore +++ b/.gitignore @@ -101,7 +101,3 @@ next-env.d.ts # Mutation testing (stryker.config.mjs): reports and the sandbox copy. /reports/mutation /.stryker-tmp - -# Local planning and code-review notes (agent output, never part of the -# public docs surface or the shipped tree). -/plans/ diff --git a/messages/de.json b/messages/de.json index 5bcd1478d..cb5657f98 100644 --- a/messages/de.json +++ b/messages/de.json @@ -10701,7 +10701,7 @@ "noneHint": "Für einen Quotienten oder Index wie INR oder Cholesterin/HDL." }, "filter": { - "searchPlaceholder": "Biomarker suchen...", + "searchPlaceholder": "Biomarker suchen…", "searchLabel": "Biomarker suchen", "clearSearch": "Suche leeren", "lastMeasured": "Zuletzt gemessen", diff --git a/messages/en.json b/messages/en.json index 24628423e..cdc7a3e1c 100644 --- a/messages/en.json +++ b/messages/en.json @@ -10701,7 +10701,7 @@ "noneHint": "For a ratio or an index such as INR or cholesterol/HDL." }, "filter": { - "searchPlaceholder": "Search biomarkers...", + "searchPlaceholder": "Search biomarkers…", "searchLabel": "Search biomarkers", "clearSearch": "Clear search", "lastMeasured": "Last measured", diff --git a/messages/es.json b/messages/es.json index b65c1d3e4..f1fe3f6dc 100644 --- a/messages/es.json +++ b/messages/es.json @@ -10701,7 +10701,7 @@ "noneHint": "Para un cociente o un índice como el INR o colesterol/HDL." }, "filter": { - "searchPlaceholder": "Buscar biomarcadores...", + "searchPlaceholder": "Buscar biomarcadores…", "searchLabel": "Buscar biomarcadores", "clearSearch": "Borrar búsqueda", "lastMeasured": "Última medición", diff --git a/messages/fr.json b/messages/fr.json index 9ec5a942e..9d314b68a 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -10701,7 +10701,7 @@ "noneHint": "Pour un rapport ou un indice comme l'INR ou cholestérol/HDL." }, "filter": { - "searchPlaceholder": "Rechercher des biomarqueurs...", + "searchPlaceholder": "Rechercher des biomarqueurs…", "searchLabel": "Rechercher des biomarqueurs", "clearSearch": "Effacer la recherche", "lastMeasured": "Dernière mesure", diff --git a/messages/it.json b/messages/it.json index 48c188d7a..76cd79a7d 100644 --- a/messages/it.json +++ b/messages/it.json @@ -10701,7 +10701,7 @@ "noneHint": "Per un rapporto o un indice come l'INR o colesterolo/HDL." }, "filter": { - "searchPlaceholder": "Cerca biomarcatori...", + "searchPlaceholder": "Cerca biomarcatori…", "searchLabel": "Cerca biomarcatori", "clearSearch": "Cancella ricerca", "lastMeasured": "Ultima misurazione", diff --git a/messages/ko.json b/messages/ko.json index 05130bc50..6d492e6a7 100644 --- a/messages/ko.json +++ b/messages/ko.json @@ -10701,7 +10701,7 @@ "noneHint": "INR이나 콜레스테롤/HDL 같은 비율 또는 지수에 사용해요." }, "filter": { - "searchPlaceholder": "바이오마커 검색...", + "searchPlaceholder": "바이오마커 검색…", "searchLabel": "바이오마커 검색", "clearSearch": "검색어 지우기", "lastMeasured": "마지막 측정", diff --git a/messages/nl.json b/messages/nl.json index 9449729b7..ffbcddc34 100644 --- a/messages/nl.json +++ b/messages/nl.json @@ -10701,7 +10701,7 @@ "noneHint": "Voor een verhouding of index zoals INR of cholesterol/HDL." }, "filter": { - "searchPlaceholder": "Biomarkers zoeken...", + "searchPlaceholder": "Biomarkers zoeken…", "searchLabel": "Biomarkers zoeken", "clearSearch": "Zoekopdracht wissen", "lastMeasured": "Laatst gemeten", diff --git a/messages/pl.json b/messages/pl.json index 62703709b..56015a3d5 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -10701,7 +10701,7 @@ "noneHint": "Dla ilorazu lub wskaźnika, np. INR albo cholesterol/HDL." }, "filter": { - "searchPlaceholder": "Szukaj biomarkerów...", + "searchPlaceholder": "Szukaj biomarkerów…", "searchLabel": "Szukaj biomarkerów", "clearSearch": "Wyczyść wyszukiwanie", "lastMeasured": "Ostatni pomiar", diff --git a/messages/pt-BR.json b/messages/pt-BR.json index 0903e6cc4..5e354a4ef 100644 --- a/messages/pt-BR.json +++ b/messages/pt-BR.json @@ -10701,7 +10701,7 @@ "noneHint": "Para uma razão ou um índice como INR ou colesterol/HDL." }, "filter": { - "searchPlaceholder": "Buscar biomarcadores...", + "searchPlaceholder": "Buscar biomarcadores…", "searchLabel": "Buscar biomarcadores", "clearSearch": "Limpar busca", "lastMeasured": "Última medição", diff --git a/messages/ru.json b/messages/ru.json index 120f1e54d..fd3b9d550 100644 --- a/messages/ru.json +++ b/messages/ru.json @@ -10701,7 +10701,7 @@ "noneHint": "Для коэффициента или индекса, например МНО или холестерин/ЛПВП." }, "filter": { - "searchPlaceholder": "Поиск биомаркеров...", + "searchPlaceholder": "Поиск биомаркеров…", "searchLabel": "Поиск биомаркеров", "clearSearch": "Очистить поиск", "lastMeasured": "Последнее измерение", diff --git a/src/components/labs/__tests__/lab-filter-rail.test.tsx b/src/components/labs/__tests__/lab-filter-rail.test.tsx index 2cb736080..bce3c0791 100644 --- a/src/components/labs/__tests__/lab-filter-rail.test.tsx +++ b/src/components/labs/__tests__/lab-filter-rail.test.tsx @@ -37,12 +37,12 @@ describe("", () => { ); expect(html).toContain('data-slot="lab-filter-rail"'); - expect(html).toContain('placeholder="Search biomarkers..."'); + expect(html).toContain('placeholder="Search biomarkers…"'); expect(html).toContain('aria-keyshortcuts="/"'); expect(html).toMatch(/]*aria-hidden="true"[^>]*>\s*\/\s*<\/kbd>/); // The shared rail keeps search and all filter dimensions in one ordered row. - const searchIdx = html.indexOf('placeholder="Search biomarkers..."'); + const searchIdx = html.indexOf('placeholder="Search biomarkers…"'); const dateRangeIdx = html.indexOf("Last measured"); const statusIdx = html.indexOf("Status"); const categoryIdx = html.indexOf("Category"); diff --git a/src/hooks/use-url-filter-sync.ts b/src/hooks/use-url-filter-sync.ts index d9dcd4317..265dc65d2 100644 --- a/src/hooks/use-url-filter-sync.ts +++ b/src/hooks/use-url-filter-sync.ts @@ -4,6 +4,13 @@ import { useCallback, useMemo, useState } from "react"; import { setAllParams, useUrlSearch, writeUrlState } from "@/lib/url-state"; +export interface UrlFilterSyncOptions { + /** A new history entry (`push`) or the current one rewritten (`replace`). */ + mode?: "push" | "replace"; + /** Wait two painted frames before writing (a write made while mounting). */ + afterPaint?: boolean; +} + /** * URL-owned filter state — the documents-vault pattern * (`src/components/documents/documents-view.tsx`), extracted so the @@ -32,13 +39,6 @@ import { setAllParams, useUrlSearch, writeUrlState } from "@/lib/url-state"; * for a list embedded under a URL that belongs to another surface (the * type-locked insights readings subpage). */ -export interface UrlFilterSyncOptions { - /** A new history entry (`push`) or the current one rewritten (`replace`). */ - mode?: "push" | "replace"; - /** Wait two painted frames before writing (a write made while mounting). */ - afterPaint?: boolean; -} - export function useUrlFilterSync({ parse, serialise,