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

+8 -5
View File
@@ -1237,7 +1237,6 @@ export const en: Dict = {
'editor.references.remove_citation': 'Remove from this finding',
'editor.references.this_finding': 'this finding',
'editor.references.missing': 'Reference not found',
'editor.references.draft_dropped': 'Entry not applied: {field}',
'editor.references.cited_one': 'Cited {count} time',
'editor.references.cited_other': 'Cited {count} times',
'editor.references.uncited': 'Not cited',
@@ -1247,7 +1246,6 @@ export const en: Dict = {
'editor.references.family': 'family',
'editor.references.go_to': 'Go to',
'editor.references.edit': 'Edit',
'editor.references.done': 'Done',
'editor.references.edit_title': 'Edit the reference',
'editor.references.url_label': 'URL',
'editor.references.none_doi': 'None',
@@ -1255,8 +1253,13 @@ export const en: Dict = {
'editor.references.new_tab': '(new tab)',
'editor.references.delete_hint': "To delete this reference, first remove each of its citations: “Go to”, then “Remove” in the finding's or family's detail.",
'editor.references.add': 'Add a reference',
'editor.references.add_help': 'Type and citation required.',
'editor.references.add_cancel': 'Cancel adding',
'editor.references.added': 'Reference added: {citation}',
'editor.references.added_show': 'Show',
'editor.references.gone': 'This reference no longer exists',
'editor.references.filter_chip': 'References of the finding: {name}',
'editor.references.filter_remove': 'Remove the filter of the finding {name}',
'editor.references.filter_back': 'Back to the finding',
'editor.references.filter_gone': 'The finding no longer exists: the filter is removed',
'editor.references.clear_search': 'Clear the search',
'editor.references.sort_by': 'Sort by',
'editor.references.sort.sheet': 'Sheet order',
@@ -1408,8 +1411,8 @@ export const en: Dict = {
'editor.reference.url': 'Web address (URL)',
'editor.reference.doi': 'DOI',
'editor.reference.new': 'New reference',
'editor.reference.url_invalid': 'Enter an address starting with http:// or https://.',
'editor.reference.add': 'Add the reference',
'editor.reference.required': 'Choose a type and fill in the citation.',
'editor.reference.type.book': 'Book',
'editor.reference.type.journal': 'Journal article',
'editor.reference.type.standard': 'Standard',
+8 -5
View File
@@ -1268,7 +1268,6 @@ export const fr: Dict = {
'editor.references.remove_citation': 'Retirer de ce constat',
'editor.references.this_finding': 'ce constat',
'editor.references.missing': 'Référence introuvable',
'editor.references.draft_dropped': 'Saisie non appliquée : {field}',
'editor.references.cited_one': 'Citée {count} fois',
'editor.references.cited_other': 'Citée {count} fois',
'editor.references.uncited': 'Non citée',
@@ -1278,7 +1277,6 @@ export const fr: Dict = {
'editor.references.family': 'famille',
'editor.references.go_to': 'Aller à',
'editor.references.edit': 'Modifier',
'editor.references.done': 'Terminer',
'editor.references.edit_title': 'Modifier la référence',
'editor.references.url_label': 'URL',
'editor.references.none_doi': 'Aucun',
@@ -1286,8 +1284,13 @@ export const fr: Dict = {
'editor.references.new_tab': '(nouvel onglet)',
'editor.references.delete_hint': 'Pour supprimer cette référence, retirez d\'abord chacune de ses citations : « Aller à », puis « Retirer » dans le détail du constat ou de la famille.',
'editor.references.add': 'Ajouter une référence',
'editor.references.add_help': 'Type et citation obligatoires.',
'editor.references.add_cancel': "Annuler l'ajout",
'editor.references.added': 'Référence ajoutée : {citation}',
'editor.references.added_show': 'Afficher',
'editor.references.gone': "Cette référence n'existe plus",
'editor.references.filter_chip': 'Références du constat : {name}',
'editor.references.filter_remove': 'Retirer le filtre du constat {name}',
'editor.references.filter_back': 'Revenir au constat',
'editor.references.filter_gone': "Le constat n'existe plus : le filtre est retiré",
'editor.references.clear_search': 'Effacer la recherche',
'editor.references.sort_by': 'Trier par',
'editor.references.sort.sheet': 'Ordre de la fiche',
@@ -1439,8 +1442,8 @@ export const fr: Dict = {
'editor.reference.url': 'Adresse web (URL)',
'editor.reference.doi': 'DOI',
'editor.reference.new': 'Nouvelle référence',
'editor.reference.url_invalid': 'Saisissez une adresse commençant par http:// ou https://.',
'editor.reference.add': 'Ajouter la référence',
'editor.reference.required': 'Choisissez un type et renseignez la citation.',
'editor.reference.type.book': 'Livre',
'editor.reference.type.journal': 'Article de revue',
'editor.reference.type.standard': 'Norme',
+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.