feat(i18n): reference dialog and filter labels, label rows

This commit is contained in:
bchanot committed 2026-11-13 20:27:00 +01:00
1 parent 8031e0078f
commit 7a64daf251
4 files changed
+46 -12

No files matched your search

+2 -2
View File
@@ -303,9 +303,9 @@ concrete constraint.
| `auth/validation.ts`, `account/validation.ts` (Zod, i18n keys) | form field rules | Zod | portable but React-bound (retained list); the constraints are duplicated in SQL CHECKs and `config.toml` and drift (trim, UTF-16 vs `char_length`, `''` on names) | no | | | one constants module + a PGlite test reading `pg_constraint` and `config.toml` with the counting rule recorded (separate chore, D-R7) | **C** | chore |
| `lib/{dates,id}.ts` | `nowIso`, `todayIso`, `formatDate` (screen), `generateId` | Web APIs | clock and ids injected into the core; screen dates stay `Intl` | no | | | | **C** | n/a |
| `apps/app/src/editor/references/{filter,citations,panel}.ts` | Références tab and citations panel: search match on citation, DOI and URL (`folded`); who cites each reference (`citersOf`); the citations and the path of one finding | TS over the validated document | portable (pure functions), but display lists over the document the core already validated; the one rule nearby, which finding depends on a reference, stays the core's `sheet.dependents` | no | none; read in `useMemo` on the parsed document | none | existing unit suites (`editor-references-view`, `editor-citations`) | **C**: display-only search and listing over validated data, no business rule, no mutation; owner decision BDR-114 (A) 2026-11-12 | n/a |
| `apps/app/src/editor/references/{sort,view,referenceTypes}.ts` | the four display orders of the Références tab (sheet, citation A to Z, count, type), the shown set after search and sort | TS, `Intl.Collator` of the current language | the collation needs the browser's ICU data (a Rust equivalent would ship its own); a pure function of positions that never writes the document, the stored order or the history | no | none | none | `editor-reference-sort.test.ts` (stable, equal keys keep the stored order, inputs untouched), view suites | **C**: display-only ordering, no business rule, no mutation; BDR-114 (A) | n/a |
| `apps/app/src/editor/references/{sort,view,referenceTypes}.ts` | the four display orders of the Références tab (sheet, citation A to Z, count, type), the shown set after the finding filter, the search and the sort (R2F-6: the ids a finding cites narrow the list; no pin under a filter) | TS, `Intl.Collator` of the current language | the collation needs the browser's ICU data (a Rust equivalent would ship its own); a pure function of positions that never writes the document, the stored order or the history | no | none | none | `editor-reference-sort.test.ts` (stable, equal keys keep the stored order, inputs untouched), view suites | **C**: display-only ordering, no business rule, no mutation; BDR-114 (A) | n/a |
| `apps/app/src/editor/references/safeLink.ts` | `http` and `https` link target for a URL, `https://doi.org/` target for a well-formed DOI | TS (`URL`) | portable; it builds a display link, it validates no stored field (the core's reference rules stay authoritative) | no | none | none | `editor-safe-link.test.ts` | **C**: display-only link building over validated data; BDR-114 (A) | n/a |
| `apps/app/src/components/editor/references/useReferenceView.ts` | search text and sort choice (React state), tile order handed to the tab | React hook | holds view state only and calls the pure functions above; it reaches no wasm call and no document write | no | none | none | `editor-references-view.test.tsx` | **C**: React state of a display view; BDR-114 (A) | n/a |
| `apps/app/src/components/editor/references/useReferenceView.ts` | search text and sort choice (React state), the finding filter read from the history view (navigation, not typed text), tile order handed to the tab | React hook | holds view state only and calls the pure functions above; it reaches no wasm call and no document write | no | none | none | `editor-references-view.test.tsx` | **C**: React state of a display view; BDR-114 (A) | n/a |
| `i18n/*` (281 keys ×2, `useT`, `pickLocaleLabel`) | UI strings | TS | UI data and hook; the engine's 25 archived labels move with the engine | no | | | parity test | **C** | n/a |
| `config/env.ts`, `lib/supabase.ts`, providers, guards, routes, components, styles | runtime config, React | TS | glue | no | | | | **C** | n/a |
| `vite/sheet-bundle.ts`, ESLint, Vite, vitest configs | build tooling | Node | Vite plugin API is JavaScript | no | | | | **C** | n/a |
+28
View File
@@ -137,3 +137,31 @@ focus revient sur « n références » et la lecture d'écran le dit.
Comportement modifié : « Tout afficher dans l'onglet Références » vide la recherche et garde le tri (le tri était
remis à « Ordre de la fiche »).
## 6. Finition du 2026-11-13 : dialogue des références, filtre par constat (tâche 3)
Huit clés nouvelles dans `fr.ts` et `en.ts` (une ligne chacune), cinq clés retirées. Les libellés EN sont provisoires.
Le dialogue de référence réutilise `editor.findings.save`, `cancel`, `discard`, `discard_ask`, `keep_typing`,
`draft_dropped`, `flip_narrow` et `flip_blocked` (mêmes mots que le dialogue des constats), `editor.reference.new` pour
le titre d'une création, `editor.reference.add` pour son bouton, `editor.references.edit_title` pour le titre d'une
modification.
| Clé | FR | EN (provisoire) | Où |
|---|---|---|---|
| `editor.references.added` | Référence ajoutée : {citation} | Reference added: {citation} | Onglet Références, ligne d'état après une création ; même texte annoncé une fois les dialogues fermés |
| `editor.references.added_show` | Afficher | Show | Même ligne, bouton qui ouvre et focalise la tuile (efface la recherche ou le filtre qui la cachent) |
| `editor.references.gone` | Cette référence n'existe plus | This reference no longer exists | Annonce quand la référence d'un dialogue disparaît |
| `editor.references.filter_chip` | Références du constat : {name} | References of the finding: {name} | Barre d'outils, pastille du filtre |
| `editor.references.filter_remove` | Retirer le filtre du constat {name} | Remove the filter of the finding {name} | Pastille, nom accessible du bouton « × » |
| `editor.references.filter_back` | Revenir au constat | Back to the finding | Barre d'outils tant que le filtre est posé |
| `editor.references.filter_gone` | Le constat n'existe plus : le filtre est retiré | The finding no longer exists: the filter is removed | Annonce quand le constat du filtre disparaît |
| `editor.reference.url_invalid` | Saisissez une adresse commençant par http:// ou https://. | Enter an address starting with http:// or https://. | Dialogue de référence, refus du champ URL |
Retirées (code supprimé avec l'édition en ligne des tuiles) : `editor.references.draft_dropped` (« Saisie non appliquée »),
`editor.references.done` (« Terminer »), `editor.references.add_help`, `editor.references.add_cancel` (« Annuler l'ajout »),
`editor.reference.required`. Le dialogue dit « Ce champ est obligatoire. » (`editor.field.required`) sur le champ concerné.
Comportement modifié : « Tout afficher dans l'onglet Références » filtre la liste par le constat de la feuille (décision A3
du propriétaire, 2026-11-13) ; le compteur se lit dans le filtre (« n références » sur celles du constat) ; le retour au
constat dépile l'entrée du dessous quand elle montre ce constat, sinon rouvre son dialogue. Après une création, la liste ne
bouge plus : la nouvelle tuile se trouve à la fin, « Afficher » y mène.