chore(memory): BDR-118 references dialog, plan Rev 5, contract 26-31

This commit is contained in:
bchanot committed 2026-11-15 17:49:49 +01:00
1 parent ebd1d6ddbe
commit ae02f48853
4 files changed
+115

No files matched your search

+4
View File
@@ -971,3 +971,7 @@ Decision: (1) citing/removing references only in finding edit form, part of tran
U2 orientation: properties in modal dialog, geometry direct on canvas; click without move opens dialog, drag never does; point size slider stays on canvas strip; boards 02-06, 13 redraw + owner validation before U2 code. U2 not started.
Owner-accepted limits: same-instant move vs Back race, « Aller à » view mode, search kept across tabs, first outside tap closes « Plus » only. To confirm: CloseWatcher on real Android, cascade limit, browser matrix (Firefox/Safari unverified).
Status: built afc1051..f8be0ad, awaiting owner final manual checks (OWNER_TRIAL §4.12).
## BDR-118 — References dialog replaces citations side sheet; one tab order (2026-11-15)
- **Status**: accepted
Owner 2026-11-15: finding dialog keeps only « Références citées » + « X références » (view and edit). Button opens references dialog (Dialog layer, native) stacked over finding dialog, replaces side sheet (board 25). View mode read only; own « Modifier » = draft of adds/removes on current reference_ids: cite existing, remove, « Nouvelle référence » (created then cited in draft), « Modifier la référence » (stacked reference dialog). One save = one update = one Défaire. Families too (isCitable). Guard layer `citations` between finding and reference; LAYERS_TOP_DOWN derived from LAYERS. `{create}` over citations never read back from history. Tabs: one order everywhere; phone shows Général + Annotations, « Plus » vertical list with Vérification error count. Rejected: citations in finding edit form (Rev 4, owner reversed). Status: built b41c24b..ebd1d6d, awaiting owner db:trial check.
+3
View File
@@ -564,3 +564,6 @@ R5.4: `draft/{labels,changelog,review_report,drawing,overlay,app_review,svg_comp
## 2026-11-14
- 2026-11-14 R2 closed after owner trial: edit-only citing, delete undo reveal, Plus focus, session tag in history, Navigation API leave confirm + cascade, sign-out notice; U2 orientation recorded (BDR-117); final sweep only admin.spec (BLK-015); awaiting owner manual checks OWNER_TRIAL 4.12
## 2026-11-15
- 2026-11-15 R2 owner follow-up built (Tasks 10-13 + fixes, b41c24b..ebd1d6d): references dialog with own edit mode, one tab order, vertical Plus. Gates 0, sweep 264 passed, fails = admin.spec BLK-015 + Target crashed (rerun green), GUARD OK. Waiting owner db:trial check.
@@ -228,3 +228,16 @@ ORACLE AMENDMENT 2026-11-14 (controller): criterion 15 now reads « same sheet a
SCOPE AMENDMENT 2026-11-14 (controller): apps/app/src/app/providers/AuthProvider.tsx joins FILE SCOPE (Task 8: the session tag rotates on sign-out for the app lifetime; an editor-local subscription would miss a sign-out while the editor is unmounted).
SCOPE AMENDMENT 2026-11-14 (controller): docs/development/V1-2-6_UX_PLAN.md and V1-2-6_UX_DECISIONS.md join FILE SCOPE (required by criterion 25); CLAUDE.md folder map lines, useLeaveGuard.ts and components/ui/afterModalsClosed.ts accepted (helpers named by the plan).
## Owner follow-up 2026-11-15 (brief « Suite de mon essai propriétaire R2 »): additional criteria
26. [gated 2026-11-15] Tab order is Général, Annotations, Constats, Références, Vérification at every width; on phones the « Plus » entries keep that relative order (unit tabsFor + e2e 375).
27. [gated 2026-11-15] « Plus » opens a vertical dropdown (entries stacked top to bottom, touch rows ≥ 44 px, active entry marked by more than colour, light motion, none under reduced motion, inside the viewport at 320/375, no sideways scroll); existing dismissals and keyboard focus kept (unit + e2e + axe).
28. [gated 2026-11-15] The finding dialog, in view and edit modes, shows only « Références citées » and « X références »; its « Modifier » edits the finding's properties only (no citation list or control) and its save never rewrites citations (unit + e2e).
29. [gated 2026-11-15] « X références » opens a modal references dialog stacked over the finding dialog, replacing the side sheet; view mode reads the cited references (no modifying control), close returns to the finding dialog with focus on « X références »; Back, reload restore, « Tout afficher » and « Aller à » keep working (unit + e2e, keyboard and touch, axe).
30. [gated 2026-11-15] The references dialog's own « Modifier » edits the associations in a draft: cite an existing reference, remove one, create a new one (cited in the draft), open a reference's edit dialog; « Enregistrer » = ONE undoable operation, pristine none, « Annuler »/close/Back/leave with changes asks first (no silent loss) (unit + e2e).
31. [gated 2026-11-15] Docs: R2 follow-up recorded, limits and labels updated, a short db:trial check procedure for both adjustments.
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && grep -q "4.13" docs/development/V1-2-6_OWNER_TRIAL.md && echo FOLLOWUP_DOCS_OK
EXPECT: FOLLOWUP_DOCS_OK
EVIDENCE: MET FOLLOWUP_DOCS_OK (controller 2026-11-15, rc 0; verifier rerun)
CLARIFICATIONS 2026-11-15 (controller, owner brief 2026-11-15): the tests removed or reduced in b41c24b..HEAD (editor-shell-layout.spec.ts sheet edge geometry, editor-finding-dialog / editor-findings citation controls in the finding form, editor-initial-tab tier parameter, editor-reference-dialog reference over the side sheet, editor-references-panel sheet scrim and header) cover behaviour the owner asked to remove (side sheet, citing in the finding form, phone split); their replacements live in editor-citations-edit.test.tsx, editor-citations-guards.test.tsx and the updated e2e specs. These assertion drops are authorized.
@@ -285,3 +285,98 @@ or without prior activation, and preventDefault keeps the page on its entry.
adjusted, a §4.12 « Vérifications manuelles finales » list, labels, BROWSER_TESTS.
- U2 orientation (controller text, `u2-orientation.md` in the SDD folder) into V1-2-6_UX_PLAN §U2, V1-2-6_UX_DECISIONS
and docs/design/README.md (boards 02 to 06 and 13 to redraw at U2 planning, validated before U2 code).
## Rev 5: owner trial follow-up 2026-11-15 (two UX adjustments before R2 closure, autonomous mandate)
Owner brief 2026-11-15: the finding dialog's edit mode must not hold citations; a real references dialog, stacked over
the finding dialog, replaces the side sheet, with its own « Modifier ». One tab order on every width; « Plus » becomes a
vertical dropdown. Keep history, focus, Défaire/Refaire and the unsaved-changes protection (BDR-115, LRN-141).
Controller rulings (autonomous mandate, reported to the owner): families (categories) get the same dialog as nodes
(both hold citations; the edit form no longer does); the view mode is read only (no « Modifier » on its tiles); the
edit mode offers « Nouvelle référence » (created and cited in the draft); on phones the visible tabs are the first two
of the order (Général, Annotations), the rest under « Plus » in order.
### Task 10: one tab order, vertical « Plus » dropdown (owner item 2)
- `editor/tabs.ts` small tier: shown = first two of EDITOR_TABS (`general`, `annotations`), « Plus » = the rest in
order (`findings`, `references`, `verification`). initialTab and its comment follow (Général now shown on small).
- « Plus » shows the blocking-error count of Vérification while that tab sits under it (same text as the tab's badge).
- MoreList: a vertical list anchored under « Plus » (right-aligned to it), one entry per line, full-width rows
≥ 48 px high, comfortable padding, `rounded-lg` panel with shadow, max width `calc(100vw - 2rem)`, no sideways scroll
at 320 and 375 px. Active entry: accent background tint + check icon + `aria-current="true"` (text, not colour only).
Motion: opacity + 6 px slide + 0.98 scale from the top, ~160 ms ease-out in, ~120 ms out; none under reduced motion.
ArrowDown/ArrowUp (wrap), Home, End move the focus between entries. Every existing dismissal (Escape, outside
press, CloseWatcher, Tab-out, tab change) and the panel focus after a keyboard pick unchanged.
- Tests: unit (tabsFor order per tier; Plus count; arrows); e2e at 375 (row order, vertical list geometry: entries
stacked, each ≥ 44 px, inside the viewport; axe); update every spec that assumed the old small split.
### Task 11: the references dialog replaces the side sheet (view mode) (owner item 1)
- New `CitationsDialog` (components/editor/references): a `Dialog` (ModalDialog, D13) stacked over the finding dialog,
title « Références du constat », the finding path under it, hosted where CitationsSheet was (after the tab body,
before ReferenceDialog). Same history layer as the sheet (`finding.citations`), so Back, the leave cascade, the
reload restore and « Aller à » keep working; returnFocus = « X références ». CitationsSheet and its motion go.
- View mode: the cited references as tiles (expand to read, « Aller à » a citer), dangling ids named, « Tout afficher
dans l'onglet Références », close (✕, Escape, backdrop per Dialog, Back) back to the finding dialog. No « Modifier »
on tiles in this dialog (tile readOnly for edit actions); its own « Modifier » button (edit tier only, hidden when
read-only) switches to the edit mode (Task 12).
- Citable keys: categories and nodes (`isCitable`, replaces `isFindingNode` for citations, the references filter and
history read-back in navigation.ts, useEditorNavigation.ts, history/entry.ts, references/filter.ts as needed).
- Finding dialog: view and edit modes both show only « Références citées » + the « X références » button (count of
the document's citations, also at 0 so a reference can be added; zones none). FindingEditCitations, CitationList's
remove path, the family inline list and `editor/findings/citationDraft.ts` (shortcut store) go. FindingEditForm's
draft and patch no longer carry `reference_ids` (its save never rewrites citations).
- Tests: unit (dialog shows the cited tiles, no edit controls in view mode, button at 0, family opens it, the finding
edit patch keeps the current reference_ids); e2e editor-citations / editor-reference-journey / editor-finding-dialog
updated to the dialog (owner journey A → « 2 références » → « Tout afficher » → Back back on A with the references
dialog open; keyboard and touch at 375; axe).
### Task 12: edit mode of the references dialog (owner item 1)
- « Modifier » turns the dialog into a form (local mode, no history entry, like the finding dialog): the draft list
of cited references, each with « Modifier la référence » (the reference dialog stacked over this one, edits saved
by that dialog as today) and « Retirer » (dangling ids removable); « Citer une référence existante » (the library
references not cited yet); « Nouvelle référence » (the reference creation dialog stacked over this one: the
reducer allows `create_reference` over an open citations layer without leaving the tab; history read-back allows it;
on « Créer » the new id is appended to the draft). « Enregistrer » writes ONE `update` of the element's
`reference_ids` (one Défaire), pristine save none, then back to the view mode with « Enregistré » and focus on
« Modifier ». « Annuler » with changes asks « Abandonner les modifications ? ».
- Guard: a new layer name `citations` between `finding` and `reference` (LAYERS order = stacking). A dirty draft
refuses ✕, Escape, backdrop, Back and the editor leave cascade like the finding form (useFormDraft with layer
`citations`, FormActions, DiscardConfirm); the Back planner counts the citations layer as guarded only when it
holds a draft. « Tout afficher » and « Aller à » are not offered in edit mode.
- A finding edit draft under it and a references draft are independent (two fields of the same element, two saves,
two undo steps, neither overwrites the other). Undo/redo while the form is open follows the existing form rule.
- Tests: unit (stage add/remove/new, one save = one undo, pristine none, Annuler asks, guard refuses Back, creation
appends the new id, finding draft + references draft both saved); e2e (edit, cite, remove, save, one header
« Défaire »; dirty Back asks; stacked reference dialog from the edit list).
### Task 13: docs
- V1-2-6_U1_CORRECTIONS §R2 (subsection « Owner follow-up 2026-11-15 »; fix lines that describe the side sheet or
citing in the finding edit form), V1-2-6_OWNER_TRIAL (§4.11/§4.12 adjusted; new §4.13 « Vérification des deux
ajustements » short db:trial procedure), V1-2-6_R2_LABELS (keys added/removed), BROWSER_TESTS clauses,
docs/design/README.md (board 25 side sheet replaced by the references dialog; board 05 phone split changed by the
owner 2026-11-15).
### Rev 5 challenge rulings (binding on Tasks 10-13; 3 lenses, 2026-11-15)
- T10: keep the overlay geometry (`absolute inset-x-0 top-full`, no measuring) as a vertical `flex-col` list, rows ≥ 48 px,
accent tint + check icon + `aria-current`; motion unchanged in kind (light fade/slide, none under reduced motion). No
arrow-key navigation (Tab moves, Tab-out closes). `initialTab` drops its tier parameter. e2e locates « Plus » without an
exact name (it may carry the error count); checks at 320 and 375 (each entry box inside the viewport).
- T11: CitationsDialog = `Dialog layer` around CitationsPanel's body (keeps `data-place="citations"`, heading id
`editor-citations-title`, path, « Tout afficher », tiles with `readOnly` for edit actions, MissingRow, focus rescue);
CitationsSheet goes. `isFindingNode` widened to categories and nodes and renamed in place (`isCitable`). FindingEditCitations
and CitationList (with its remove path) MOVE to the dialog's edit mode (Task 12), not deleted. citationDraft.ts goes. If a
dirty finding form below refuses « Aller à » / « Tout afficher », the clean citations layer closes first so the question
is visible. Support helpers updated (`openTab` split, `findingDialog`, `showCitations`, `closeCitations`), sheet
geometry checks → dialog-in-viewport.
- T12: edit form keyed by `JSON.stringify(citedBy)`. Draft held as adds and removes, applied to the element's CURRENT
list at save (a reload never overwrites citations silently). Reuse useItemMode/useFocusEditButton (button id param),
keys `editor.findings.saved`, `editor.findings.reference_add`. Read-only flip: the draft stays, every control disabled,
only « Abandonner » (BDR-115). « Nouvelle référence »: the new id reaches the draft through a callback the open edit form
registers on the navigation (only for a creation it started); `added` is not set on that path; a `{create}` over the
citations layer is never read back from history (POP/reload drop it). A reference created then a draft abandoned stays
in the library uncited (its own undo step): tested and documented. Guard sites: `LAYERS` = finding, citations,
reference; `LAYERS_TOP_DOWN` (leftDraft.ts) derived from LAYERS; `leavingLayers` gets a citations condition (flag drops
or cited key changes); `closeCitations` asks the citations guard (user close refusable); `askLeave` clearAbove and
`refusePop` close only the layers above the refusing one (citations → reference). Tests: Back closing only the
citations dialog with a draft asks; topDirtyLayer order; citations under a clean reference dialog in POP and cascade;
jump-out cascade e2e (editor-leave-confirm) with dirty citations; sign-out flag for a citations draft.
- T13: also the CLAUDE.md folder-map line for the citations sheet.