Commit Graph
223 Commits
Author SHA1 Message Date
bchanot dfc8965844 fix(editor): Task 4 round 1, swallow release, menu tests 2026-11-13 22:36:23 +01:00
bchanot ca5804a8b7 feat(editor): Plus dropdown overlay with back request, sticky sidebar 2026-11-13 22:32:51 +01:00
bchanot 8a60128311 fix(editor): Task 3 round 2, usePin split, comment wrap 2026-11-13 20:40:52 +01:00
bchanot 3bb3603115 fix(editor): Task 3 round 1, literal journey, pin, limits, notice 2026-11-13 20:38:04 +01:00
bchanot 8b42816270 test(editor): reference dialog, filter and the owner journey, specs follow the dialog 2026-11-13 20:27:01 +01:00
bchanot 7a64daf251 feat(i18n): reference dialog and filter labels, label rows 2026-11-13 20:27:00 +01:00
bchanot 8031e0078f feat(editor): reference dialog, reading tiles and finding filter in the history
R2F-5 and R2F-6: the reference dialog is a view layer above the References tab or the citations sheet (local draft, one command per changed save, creation entry becomes the reference's own). Tiles only read. « Tout afficher » filters the library by the finding, « Revenir au constat » pops or pushes. Inline tile edit, draft tile and their guards removed.
2026-11-13 20:27:00 +01:00
bchanot e2d020bd3d test(editor): fix typecheck of the history entry and dialog helpers 2026-11-13 19:54:06 +01:00
bchanot af300de04c fix(editor): Task 2 round 3, lint, locals, stale comment 2026-11-13 19:51:03 +01:00
bchanot 20905adf72 refactor(editor): Task 2 round 2, locals and line limits 2026-11-13 19:45:50 +01:00
bchanot b703333b20 fix(editor): Task 2 review round 1, trace calls, form hooks, keyboard proof 2026-11-13 19:39:29 +01:00
bchanot c893dec60b feat(editor): « Aller à » opens the finding dialog, spec races fixed
« Aller à » a finding shows its row and opens its dialog in view mode.
E2e helpers wait for the history to settle after a layer or section
pop; the layout walk waits out the write budget. Label rows for the
nine new keys.
2026-11-13 19:23:48 +01:00
bchanot 4731a3376a feat(editor): sheet landings, history and e2e for the finding layers
« Tout afficher » clears the search and keeps the sort. A landing waits
for the dialogs a move closed and for their focus restore. Helpers and
shell specs move to the dialog and sheet flow; new finding dialog spec
(entries, guards, flip, gone rule, Back and Forward over the layers).
2026-11-13 19:03:21 +01:00
bchanot 18085cecf8 feat(editor): finding dialog and citations side sheet in the history
Constats opens each element in one modal dialog (view, edit with a
local draft, creation) driven by the editor view layer of the browser
history. The citations panel becomes a modal side sheet stacked over
it; its geometry, exit machinery and page inertness are removed.
Back and Forward restore the layers, a dirty form asks first.
2026-11-13 18:51:35 +01:00
bchanot 8e4f02620a fix(editor): Task 1 review round 1, section back pops, scroll proof 2026-11-13 18:12:19 +01:00
bchanot 792394d3b2 feat(editor): browser history for tabs, sections and Aller a
EditorView held by the navigation reducer (restore_view), a history
adapter hook mounted in EditorWorkspace (push, replace, back, mount
rule, ownership, write budget, scroll map, refused POP), a guard stack
by layer, an announcer queue joined after open dialogs.
2026-11-13 17:57:52 +01:00
bchanot 69e225ca7a style(tests): format c4-measure annotation (residual 9c) 2026-11-13 17:57:47 +01:00
bchanot 553a0e57b2 feat(ui): harden modal dialogs, add afterModalsClosed
Re-show a natively closed dialog only when its consumer answered
'kept'; returnFocus; ignore a held Escape; Dialog honours reduced
motion; useBeforeUnload extracted; focusRow reports found only when
the row holds focus.
2026-11-13 17:57:47 +01:00
bchanot cb1ad47cb0 fix(editor): announce a draft dropped with its tile
An undo or redo that removes a reference unmounted its tile with the edit view, so the
tile's announce effect never ran. The drop now speaks from onDrop itself; the citations
panel, unmounting after a forced close that already named the fields, stays quiet.
2026-11-13 15:25:22 +01:00
bchanot 346a8fd8f1 test(tests): typed draft before Escape in the add e2e, prettier on C4 spec 2026-11-13 14:49:18 +01:00
bchanot 94f8a8bf27 fix(editor): focus the first refused field with its own error
A user leave with several refused fields focused the first one while
the last refusal owned the single error slot. The leave now focuses
the first refused field, then re-applies it so its message shows (I1).
The add flow no longer re-pins the tile finish() just ended (M3).
2026-11-13 14:49:17 +01:00
bchanot 78fb2d076e test(tests): C4 round 4, deterministic touch proof 2026-11-13 14:42:29 +01:00
bchanot f7f0aa675d test(tests): C4 review round 3, helper locals 2026-11-13 14:18:36 +01:00
bchanot 776692922e test(tests): C4 review round 2, calibration guard 2026-11-13 14:16:30 +01:00
bchanot 817f74ba18 test(tests): C4 review round 1, worst-case touch distance 2026-11-13 14:13:03 +01:00
bchanot 969a5f360f test(tests): prove the citations trigger is reachable by touch at 667 x 375 2026-11-13 14:05:07 +01:00
bchanot b1fd8962ff fix(editor): say when a pinned tile is outside the search
A shown tile the search misses carries « Ne correspond pas à la
recherche » under its header (aria-describedby). The no-result notice
now needs no shown tile at all. Flip test watchers are stopped in
afterEach, so a failing assertion never leaves the setters patched.
2026-11-13 13:49:46 +01:00
bchanot c8109af719 fix(editor): C2 review round 1, i18n format, flip test observer
Restore i18n files from base and add only add_cancel. The flip test counted
announcements with a happy-dom MutationObserver whose callback sits in a
WeakRef (lost on GC); count the DOM setters instead.
2026-11-13 13:09:09 +01:00
bchanot d1779928a9 feat(editor): cancel adding a reference by button or Escape
Draft tile gets « Annuler l'ajout »; Escape cancels from non-text targets and
from a pristine text field, never while composing or already handled. Nothing
reaches the document, history untouched, focus back on the add button.
2026-11-13 12:39:57 +01:00
bchanot 1e19479853 fix(editor): C1 review round 1, note endings tested, tile hook, pin guard
Tests: note ends on another tile's Modifier, on Ajouter une reference, and is
replaced (announced again) by a newer drop; long titles shortened.
Read-only toggle deletes the key from openKeys explicitly. Drop slot and tile
wrappers moved to useTileActions. pinEdited pins nothing for an absent key.
2026-11-13 11:25:50 +01:00
bchanot 3303530717 fix(editor): never drop a refused draft silently on a read-only flip
Drop slot is tile-local state; the edit view cleanup reports every pending
field (FIELDS order) only when some are pending. The tile shows a warning
note and says it once in the live region; it ends on toggle, Terminer or a
newer drop. LeaveGuard returns all refused fields (forced panel close names
them all). Pin follows editingKey through read-only; reset re-pins it.
Read-only toggle ends edit and collapses. Flip focus goes to the tile header.

R-24 mapping:
- view test "keeps its index ... read-only (M3)": renamed, same assertion
- view test "is suspended in read-only ...": rewritten as "stays pinned in
  read-only" (pin kept, tile still shown after a search); toggle test added
- reset test extended: tile in edit stays pinned through the reset
- new editor-references-flip.test.tsx covers (a)-(g); (h) is a stated limit
2026-11-13 11:11:51 +01:00
bchanot 1bf27014b3 fix(editor): one history entry per reference edit, focus kept
Final review fixes. « Terminer » and every panel close re-committed the
edited field against a stale value, adding a second identical history
entry so the first « Défaire » seemed to do nothing: the tile now reads
the latest applied value (tests assert the undo-length delta). A tile
leaving the search on « Terminer » stays pinned until the next view
change and keeps focus; « Ajouter la référence » resets search and sort
and focuses the new tile. Also: refused draft dropped on a read-only
flip is announced; arrow keys respect a refused tab switch; pinned
index kept across read-only; the panel announces « Références citées »;
search text inserted literally; « Aller à » names its citer; the edit
header's name starts with « Terminer. »; undo removing the focused panel
tile moves focus per P20; no-result announced once; docs corrected.

Gates: typecheck, lint, test:run (app 1510), build, e2e:ui 251;
e2e:shell 16 specs (admin and editor-equine excluded): 117 passed / 108
skipped / 1 failed (crossing:211 stuck on the MFA step-up screen before
the editor), rerun alone 11 passed; full-row guard: no pre-existing row
changed in any table.
2026-11-13 01:08:00 +01:00
bchanot 4b7d2542fd test(tests): R2 non-regression sweep fixes
openTab waits for the shown place on every tab again (the former
goToTab waited for the annotations place). editor-equine.spec opens the
citations panel again on a finding of the equine copy, « Suture
sagittale (entre les deux pariétaux) » (unique, cited, reached in five
expansions: openCitations takes an optional expansion budget, default
4); updated for typecheck only, never run (owner rule).

Sweep: e2e:shell all 21 specs except editor-equine on db:sandbox: 219
passed / 116 skipped / 3 failed, the three in admin.spec, « Target
crashed » during axe on admin screens that render every accumulated
grant (not R2); new specs run twice (sweep + 33 passed after these
fixes); full-row guard: no pre-existing row changed in any table.
R-24 audit of 49867ba..HEAD: 58 mapped, 17 justified, 0 lost.
Gates: typecheck, lint, test:run (app 1488), build, e2e:ui 251.
2026-11-12 22:42:20 +01:00
bchanot 8db6f4287f feat(editor): contextual citations panel of a finding (board 25)
The panel opens only from a finding's « {n} références » trigger: 34 rem
at most, never wider than the room, a scrim, slide in 180 ms and out
140 ms (motion/react; none under reduced motion, callbacks still fire).
It lists the finding's references as tiles with « Modifier », « Retirer
de ce constat » (one « Défaire » restores it and the review status) and
« Aller à »; dangling ids read « Référence introuvable »; zero left
reads « Ce constat ne cite plus aucune référence. ». « Tout afficher
dans l'onglet Références » resets search and sort, keeps open tiles and
edits. Every close (✕, Escape outside fields, scrim, tab, « Aller à »,
« Tout afficher », element gone) records one pending move applied
after the exit, page inert until then; focus back to the trigger, else
the active tab button. A refused draft cancels a user close; a forced
close drops it and announces « Saisie non appliquée : {field} ». Places
keeps a permanent dvh min-height; the panel fits the visible viewport
at every scroll position, document size unchanged.

Gates: typecheck, lint, test:run (app 1488), build, e2e:ui 251;
e2e:shell 16 specs on db:sandbox (admin and editor-equine excluded):
117 passed / 107 skipped / 0 failed, rerun after the fix rounds: 118
passed / 108 skipped / 0 failed; layout spec 13 passed after round 2;
full-row guard: no pre-existing row changed in any table. Known limit:
landscape 667 x 375 at scroll 0 leaves ~13 px of panel (the trigger is
below the fold there).

## R-24 (removed or rewritten assertions)

| file | old | new |
|---|---|---|
| editor-references-panel.test.tsx (whole file) | R2.1 interim-panel tests, synchronous closes | rewritten: 39 tests (opening, motion, close matrix in both modes, exit, Retirer, P22'', library + history) |
| same, opening | heading `Références` focused right after the click | heading `Références citées` focused after the enter (`waitFor`), `aria-expanded` only after click |
| same | chip `references-filter-chip` « Citées par « Node A » (2) » | REMOVED (REVUE: path line + count line « 2 références citées par ce constat ») |
| same | `listitem` cards « Citée 2 fois » | tiles (`ul > li`) with the same counts, in the finding's order |
| same | field id `#panel-reference-0-ref-a-citation` present at once | tile opened + « Modifier » first (tiles since R2.2) |
| same | « Tout afficher (3) », sync | « Tout afficher dans l'onglet Références », after exit, heading focus asserted |
| same | Escape / ✕ / scrim / tab / vanish: sync null panel | all `await closed()` + `document.activeElement` checks, `describe.each` normal / reduced motion |
| same | « makes the tab panels inert while open, header usable » | split: inert page + inert panel until the exit ends then lifted; « Défaire / Refaire usable »; the `Enregistrer` enabled check dropped (covered by the focus-moved-off test) |
| same | Ctrl+Z test on an always-open field | open tile + Modifier first |
| same | read-only: no Supprimer, no textbox | open tile: no Modifier, no Retirer, no textbox |
| same | P6 under « Plus »: sync | in the close matrix, awaited |
| editor-escape.test.tsx (2 tests) | `expect(citations()).toBeNull()` right after Escape | `await waitFor(...)`; trigger `aria-expanded` false after exit |
| editor-keep-alive.test.tsx | « Escape in a citations panel field commits the text before the panel closes » | REPLACED by « Escape in a field of a panel tile neither closes nor commits » (A5, P27) |
| same | scrim click closes the panel after committing, sync, id on a closed tile | tile opened in edit first, close awaited, commit asserted before the exit |
| editor-focus-request.test.tsx | `ReferenceLibrary` with `resetSignal`; `ownedBy(ref,'citations')` undefined | `ReferencesTab` (+ `reloadSheet`); the `'citations'` assertion removed with the type |
| editor-references-tab / -view.test.tsx | `ReferenceLibrary`, `resetSignal` | `ReferencesTab`, `libraryReset` (+ `reloadSheet`) |
| e2e support `openCitations` | waited for the panel visible | also waits for the heading focus (slide over) |

New unit coverage: editor-citations-exit.test.tsx (hook, fake timers), editor-findings (aria-expanded per finding),
`useDecisionsOpen` gate, panel file (Retirer + status + one undo, P20 chain, zero state, dangling id, P4 reset, P6 after undo,
P22'' four paths, reduced motion, inert/exit, second close, tab replace, focus-moved-off).

## i18n (FR / EN)

Added: `editor.references.panel_title` Références citées / Cited references; `panel_count_one|other` « {count} référence citée par
ce constat » / « {count} références citées par ce constat » and « {count} reference cited by this finding » / « … references … »;
`panel_show_all` Tout afficher dans l'onglet Références / Show all in the References tab; `panel_empty` Ce constat ne cite plus
aucune référence. / This finding no longer cites any reference.; `remove_citation` Retirer de ce constat / Remove from this finding;
`this_finding` ce constat / this finding; `missing` Référence introuvable / Reference not found; `draft_dropped`
Saisie non appliquée : {field} / Entry not applied: {field}.
Changed: none. Removed: `editor.references.cited_by` (« Citées par « {name} » ({count}) » / « Cited by « {name} » ({count}) »),
`editor.references.show_all` (« Tout afficher ({count}) » / « Show all ({count}) »). R10 grep over src, tests and e2e including
editor-equine: no reader left. `editor-equine` has no panel reference: « updated, not run » (nothing to update). The three
provisional FR labels are exactly as listed in the brief; `…` = the refused field's label.
2026-11-12 22:27:32 +01:00
bchanot 3baac4dbb5 feat(editor): search, sort, count and add in the Références tab
Search (citation, DOI, URL) with « Effacer la recherche » and Escape;
« Trier par » sheet order, citation (locale collator), citation count,
type (business order); every sort stable on stored order, display only:
document, stored order, ids and history unchanged (unit + e2e). Count
« {n} références » / « {n} sur {total} » counts matching references
only. « Monter » / « Descendre » only in sheet order without search
(A1). « Ajouter une référence » resets search and sort and appends a
draft tile in edit; a tile in edit stays pinned while sorted or
searched; tile state pruned of absent ids. Reset path ready for « Tout
afficher » (R2.4).

Gates: typecheck, lint, test:run (app 1452), build, e2e:ui 251;
e2e:shell 16 specs on db:sandbox (editor-equine never listed): 115
passed / 102 skipped / 2 failed: editor-structures (test-side, fixed,
rerun with editor-references 12 passed / 11 skipped) and admin.spec A0
« Target crashed » during axe on the rights screen (not R2: that
screen renders every grant, 1 282 accumulated e2e fixtures; reported as
an open risk); full-row guard: no pre-existing row changed in any table.

## R-24 (removed or rewritten assertions)
| file | old | new |
|---|---|---|
| editor-references-tab.test.tsx | `#tab-reference-new-citation` present on load | null until « Ajouter une référence » |
| same | no match text « Aucune référence ne correspond. » | notice « Aucune référence ne contient « zzz ». » |
| same | add: form always visible, add clears the search, `getByText('Nouvelle source')` | click « Ajouter une référence » first; new tile header open, focused, search empty, 4 tiles |
| same | « a refused add keeps the search » | REMOVED (P24: add resets the search at once); replaced by « draft opens with citation focused, refused add keeps the draft, no write » |
| editor-tabs-lists.test.tsx | add form directly | click « Ajouter une référence » before the form assertions (same assertions after) |
| editor-keep-alive.test.tsx | form survives tab round trip | same, after opening the draft |
| editor-no-loss.test.tsx | reference form keeps typed text | same, after opening the draft |
| e2e editor-shell.spec (2), editor-shell-crossing.spec, editor-structures.spec | fill `#tab-reference-new-*` directly; `getByText(citation)` visible | open the draft first; structures asserts the new header is focused |
| e2e editor-references.spec keyboard walk | focus search, Tab reaches header 0 | focus « Ajouter une référence » (search, sort, add precede the headers) |
Other readers of `editor.reference.add`/new ids: grep of src, tests, e2e incl. editor-equine found none left unlisted. editor-equine is not affected ("updated, not run": nothing to update).

## i18n (fr / en)
Added: `editor.references.add` Ajouter une référence / Add a reference; `add_help` Type et citation obligatoires. / Type and citation required.; `clear_search` Effacer la recherche / Clear the search; `sort_by` Trier par / Sort by; `sort.sheet|citation|count|type` Ordre de la fiche, Citation (A → Z), Nombre de citations, Type / Sheet order, Citation (A → Z), Number of citations, Type; `count_one|other` {count} référence(s) / reference(s); `count_of_one|other` {count} référence(s) sur {total} / {count} reference(s) of {total}; `reorder_hint` Pour réorganiser, affichez l'ordre de la fiche sans recherche. / To reorder, show the sheet order without a search.; `no_result` Aucune référence ne contient « {q} ». / No reference contains “{q}”.; `no_result_scope` La recherche porte sur la citation, le DOI et l'URL. / The search covers the citation, the DOI and the URL. (REVUE sentence split in two keys so the first half is bold).
Changed: none. Removed: none (`editor.references.no_match` kept, the panel's EmptyLine still uses it).
2026-11-12 21:18:56 +01:00
bchanot c21995b3fb feat(editor): collapsible reference tiles in the Références tab
Board 23 / 24 / 27 tiles: closed (citation on two lines, type, « Citée
{n} fois » / « Non citée »), open (Type, DOI, URL as safe links, the
citers with « famille » badge and « Aller à »), edit (« Terminer » with a
leave guard re-committing every changed field; a refusal keeps edit
and focuses the field). A cited reference shows the deletion hint, an
uncited one keeps « Supprimer ». Read-only keeps DOI, URL, « Aller à ».
« Terminer » keeps focus in the field on press, so a refusal message
can no longer move the button under the pointer.

Gates: typecheck, lint, test:run (app 1419), build, e2e:ui 251;
e2e:shell 16 specs on db:sandbox (editor-equine never listed): 111
passed / 99 skipped / 3 failed in the new editor-references.spec (two
test bugs, one app bug), fixed and rerun: 5 passed / 4 skipped; full-row
guard: no pre-existing row changed in any table.

## R-24 (removed or rewritten assertions)
| file | old | new |
|---|---|---|
| editor-citations.test.ts | `citationCounts` counts 2/1/0, memoised, empty | `citersOf`: ordered citers (Cat, Node), family flag, trail from zone, key, memoised, empty |
| editor-references-tab.test.tsx | cards say « citée N fois » (ref-a 1, ref-c 0) | « Citée 2 fois » (fixture gains a node citing ref-a), « Citée 1 fois », « Non citée » |
| same | ids `#tab-reference-ref-a-citation` exist when closed | header id `#tab-reference-0-ref-a-header`; field ids only inside an open edit tile |
| same | ↑/↓ on every card | in open tiles only, absent under a search |
| same | Ctrl+Z on an always-visible field | open tile, Modifier, then same assertion on `#tab-reference-0-ref-a-citation` |
| same | « Aller à » focuses the card (`listitem` count 3, focus key) | tile opened (aria-expanded true), header focused, 3 tiles |
| same | add: `getByText('Nouvelle source')` | tile header named « Nouvelle source » |
| same | read-only: no Supprimer / add | same after opening every tile |
| editor-tabs-lists.test.tsx | edit on blur and arrows on always-open cards | open tile, Modifier, blur applies, Terminer, Monter on opened tile |
| same | cited reference deletion refused in a dialog listing citers | REMOVED: no Supprimer on a cited tile (hint asserted, citer listed); uncited delete kept. The dialog's blocked path stays covered by `DeleteDialog`'s own tests |
| same | read-only: no button at all | read-only: facts shown, no Modifier / Supprimer / Citation textbox (header buttons exist now) |
| editor-keep-alive.test.tsx:~330 | tab-click commit of `#tab-reference-ref-1-citation` | opens tile + Modifier first, id `#tab-reference-0-ref-1-citation` |
| editor-keep-alive.test.tsx:~350,367 | `#panel-reference-ref-1-citation` | `#panel-reference-0-ref-1-citation` |
| editor-references-panel.test.tsx | « citée 2 fois / 1 fois » | « Citée 2 fois / 1 fois » |
| same | `#panel-reference-ref-a-citation`; no `#tab-reference-ref-a-citation` | `#panel-reference-0-ref-a-citation`; no `[id^="tab-reference-"]` while the tab tiles are closed |
| same | ids unique, tab and panel field ids present | tab tile opened in edit first; `tab-reference-0-ref-a-citation` and `panel-reference-0-ref-a-citation` unique |
| e2e editor-structures.spec.ts:~88-110 | citation inputs count 3/1/2, « citée 0 fois » x2, « citée 1 fois », move via row buttons | tile headers count, « Non citée » x2, « Citée 1 fois », tile opened before Monter/Supprimer, `tiles.nth(1)` contains the moved text (saved-list assertion unchanged) |

## i18n (fr / en)
Changed (in place, P18): `editor.references.cited_one|other`: « citée {count} fois » -> « Citée {count} fois »; « cited {count} time(s) » -> « Cited {count} time(s) ».
Added: `editor.references.uncited` Non citée / Not cited; `citers_one|other` « Citée {count} fois, par : » / « Cited {count} time(s), by: »; `no_citers` « Aucun constat ni aucune famille ne cite cette référence. » / « No finding or family cites this reference. »; `family` famille / family; `go_to` Aller à / Go to; `edit` Modifier / Edit; `done` Terminer / Done; `edit_title` Modifier la référence / Edit the reference; `url_label` URL / URL; `none_doi` Aucun / None; `none_url` Aucune / None; `new_tab` (nouvel onglet) / (new tab) (sr-only); `delete_hint` (REVUE wording, fr and en).
Removed: none. R10 grep (src, tests, e2e incl. editor-equine) found no reader of the old lowercase wording left.
2026-11-12 20:50:25 +01:00
bchanot 4499bc740c feat(editor): fifth tab « Références », citations panel from a finding
The reference library moves into a fifth editor tab (Général,
Annotations, Constats, Références, Vérification; under « Plus » below
640 px with Général and Constats). The header « Références » button is
removed. The side panel becomes the citations list of one finding,
opened only from a finding's trigger (owner GO 2026-11-12: never from a
family; the family keeps its inline list with « Retirer »). Selecting a
tab closes it; every close records one pending move applied after the
panel is gone, focus back to the trigger else the active tab button.
Vérification's reference issues land on the tab. e2e seed gains a
reference cited by « Constat A ».

Gates: typecheck, lint, test:run (app 1396), build, e2e:ui 251 passed;
e2e:shell 15 specs on db:sandbox (editor-equine never listed): 107
passed / 95 skipped / 2 failed (test remap dropped its edit), fixed and
rerun: editor-shell.spec 11 passed; full-row data guard: no
pre-existing row changed in any table. editor-equine.spec.ts helper
calls updated, not run.

## R-24 table (removed or rewritten assertions; old = fc3fec7 line, new = current file)

Unit tests:

| file:old line | old | new |
|---|---|---|
| editor-verification.test.tsx:87-96 | `navigate` called with target AND `expect.any(HTMLElement)` | called with the target only (opener dropped) |
| editor-verification.test.tsx:238-241 | `references[0]` path -> `{place:'references', citedBy:null}` | `{place:'tab', tab:'references', section:null}` |
| editor-verification.test.tsx:262-264 | `placeKey(references[9])` = `editor.place.references` | `editor.tab.references` |
| editor-navigation.test.ts:63 | targetOfKey reference -> `{place:'references', key, citedBy:null}` | `{place:'tab', tab:'references', section:null, key}` |
| editor-navigation.test.ts:80 | `referencesMounted` false at start | `citationsOf` null and `libraryReset` 0 |
| editor-navigation.test.ts:95-110 | go_to a reference opens the panel over the place | go_to a reference shows the Références tab with its focus request |
| editor-navigation.test.ts:112-122 | go_to a tab closes the panel (`references` object) | same, via `citationsOf` null |
| editor-navigation.test.ts:124-136 | select_tab keeps the panel | select_tab CLOSES the panel (P21), keeps section, no request |
| editor-navigation.test.ts:138-146 | `clear_cited_by` drops the filter | removed (action gone); replaced by `open_citations` refuses family/zone/view, `show_all_references` (closes, tab, reset bump), plain go_to leaves reset alone |
| editor-navigation.test.ts:160-175 | open/close references keep tab and section | open/close citations, same assertions on `citationsOf` |
| editor-mode.test.ts:100-109 | tabsFor four tabs, small more = general, findings | five tabs, small more = general, findings, references |
| editor-route.test.tsx:46,50 | TABS four, title « four tabs » | five |
| editor-route.test.tsx:139-146 | 640-1023 px four tabs | five tabs, tablist has `flex-wrap` |
| editor-route.test.tsx:149-161 | « Plus » lists Général, Constats | lists Général, Constats, Références |
| editor-route.test.tsx:168-190 | header button opens panel, ✕ returns focus to button | no header button, panel not mounted at start (full panel flow moved to editor-references-panel.test.tsx) |
| editor-route.test.tsx:192-206 | Escape closes, panel content kept for next opening | removed: the panel is no longer kept mounted (design choice 3); Escape/close covered in editor-references-panel + editor-escape |
| editor-route.test.tsx:208-218 | read-only: panel lists references, no edit control | read-only: the Références tab lists them, no textbox, no add button; plus new: tab keeps mounted when left |
| editor-tabs-lists.test.tsx:47,75,114,130 | render `ReferencesPanel` | render `ReferencesTab` |
| editor-tabs-lists.test.tsx:77 | selector `#reference-ref-a-url` | `#tab-reference-ref-a-url` |
| editor-tabs-lists.test.tsx:131-135 | read-only buttons = only « Fermer les références » | no button at all |
| editor-focus-request.test.tsx:166-171,200-202,346 | `ReferencesPanel` with `panel` props and focus | `ReferenceLibrary` with focus (same assertions) |
| editor-focus-request.test.tsx:226 | `ownedBy(ref,'citations')` is the request | `ownedBy(ref,'references')` is the request, `'citations'` undefined |
| editor-focus-request.test.tsx (Probe) | none | new: Vérification « Aller à » reference -> tab + focused row; reference path naming no element -> tab heading |
| editor-keep-alive.test.tsx:71,178-190 | add form survives closing/reopening the panel | survives leaving/returning to the Références tab (`#tab-reference-new-citation`) |
| editor-keep-alive.test.tsx:300-326 | « Aller à » without focus move commits Références text | a tab click without focus move commits it (one undo entry): « Aller à » is not reachable from the Références tab in R2.1 |
| editor-keep-alive.test.tsx:333-347 | Escape in panel reference field commits, panel hides | same, panel opened from a finding node, field `#panel-reference-ref-1-citation` |
| editor-keep-alive.test.tsx:350-363 | header toggle (no focus move) closes after committing | scrim click (no focus move) closes after committing |
| editor-keep-alive.test.tsx:425 | `referencesButton` click in the all-places sweep | `Références` added to the tab loop |
| editor-escape.test.tsx:218-227 | header button toggle, Escape on body closes panel, annotation selection kept | trigger-opened panel (A5), Escape closes it, `aria-expanded` back to false, selection kept after returning to Annotations |
| editor-escape.test.tsx:255-266 | Escape from tab row closes panel | same from the Constats tab button |
| editor-no-loss.test.tsx:146-153 | reference creation form, in the panel | in the Références tab, id `tab-reference-new-citation` |
| editor-no-loss.test.tsx:285-291 | focused header button survives crossing | focused tab button (Constats) survives crossing: no header button left |
| editor-no-loss.test.tsx:293-307 | references search in panel keeps focus/text | same in the Références tab body |
| editor-no-loss.test.tsx:390-400 | `everyPlace` ends by opening the panel | visits Références in the tab loop, no panel open |
| editor-no-loss-decisions.test.tsx:248-259 | open references panel holds the decision back | REMOVED: the panel exists only over Constats, decisions live in Annotations (hidden then); « a widening on another tab opens nothing » (same file) covers the withholding |
| editor-route-recovery.test.tsx:93-97 | recovery offer: header button opens panel, `aria-labelledby` | tab Références shows `editor-tab-references` labelled by `editor-references-title` |
| editor-references-panel.test.tsx (all) | header-button-driven panel tests incl. search, order, add, « Aller à » | split: panel tests (finding path only) stay in this file; library tests moved to new editor-references-tab.test.tsx (search matching, ↑/↓ only without search, counts, Ctrl+Z, read-only, « Aller à », add clears search, refused add keeps it); new: reset signal, ids unique with both mounted (P14), P6 fallback under « Plus » |

e2e (updated only, not run):

| file:old line | old | new |
|---|---|---|
| editor-shell.spec.ts:95-108 | panel keeps form text, no id repeats | Références tab keeps form text (`#tab-reference-new-citation`), ids unique with the panel open |
| editor-shell.spec.ts:121-142 | open panel leaves header and tab row clickable (incl. header Références button, add form) | `openCitations`; header button target and form steps dropped |
| editor-shell-journeys.spec.ts:113-123 | four tabs, `old` list includes « Références » | five tabs, « Références » removed from the old-layout list |
| editor-shell-journeys.spec.ts:246-249 | Aller à reference -> panel visible, close | `place('references')` visible, tab Références selected, row focus key, no close |
| editor-shell-layout.spec.ts:84-103 | overflow on four tabs + panel over drawing | five tabs + `openCitations`/`closeCitations` |
| editor-shell-layout.spec.ts:54-63 | local `goToTab` | removed, uses `openTab` |
| editor-shell-layout.spec.ts:140-158 | canvas width without/with panel over the drawing | E1: width measured before open and after a P21 switch to Annotations, asserted equal |
| editor-shell-layout.spec.ts:161-189 | axe on four tabs + open panel | five tabs + citations panel |
| editor-shell-layout.spec.ts:~255-310 | keyboard order began with `header` (the Références button) | `header` dropped from both orders (no focusable header control while the draft is clean); panel test selects Annotations before walking to `side` |
| editor-access.spec.ts:150-152,191-194,219-220 | axe/overflow with the panel at 320/375/768/800, 1024, read-only | same checks through `openCitations` (`showDrawing` calls dropped) |
| editor-shell-crossing.spec.ts:194-206 | references form with panel open, tab `annotations` | in the tab, focus expected on `editor-tab-references` |
| editor-shell-crossing.spec.ts:264-282 | panel open + add-form text across crossing | citations panel over a crossing, no typed-text step |
| editor-shell-crossing.spec.ts:~385-410 | decision withheld while panel open, Reprendre | REMOVED (state unreachable, see unit row) |
| editor-deselect.spec.ts:226-229 | Escape closes header-opened panel, selection kept | opened via Constats, Escape, back to Annotations, selection kept |
| editor-structures.spec.ts:80-122 | two references added, counts 2/1 | shape now holds `ref-a`: counts 3/2, `nth(1)` after move, saved list `['Référence A','Seconde référence']`, no panel |
| editor-equine.spec.ts:304-305,404-405 | openReferences/closeReferences | `openTab(page, dict, 'references')`: mis à jour, non exécuté, non vérifié |

Fix round 1: 1. e2e/shell/editor-shell.spec.ts « the open citations panel leaves the header and the tab row clickable »: before `openCitations`, the test now opens the Références tab and adds a reference through the library form (`#tab-reference-new-type` book, `#tab-reference-new-citation` « Smith 1999 », « Ajouter la référence »), so the draft is dirty and Save is enabled. All original assertion
2026-11-12 20:29:27 +01:00
bchanot fc3fec7654 refactor(editor): rename the reference panel's place to citations
Frees the name « references » for the fifth tab (R2.1). The panel's
data-place, PlaceName and ids become citations; no visible change.
EditorTarget, move kind, i18n keys and domain fields keep their names
(removed in R2.1).

R-24 (no assertion removed or weakened): unit editor-route, no-loss,
references-panel, route-recovery ids editor-references-* -> editor-citations-*;
keep-alive inPlace/place('references') -> 'citations'; focus-request
ownedBy 'references' -> 'citations'. e2e support openReferences /
closeReferences, crossing 204/271, journeys 247, layout 234/305,
deselect 229, shell 135 -> place 'citations'; crossing 205 searchbox and
structures 95 « citée 0 fois » -> libraryRoot(page) (new helper).

Gates: typecheck, lint, test:run (app 1382), build, e2e:ui 251 passed,
e2e:shell 7 specs 63 passed / 63 skipped on db:sandbox (editor-equine
not listed); full-row guard: no pre-existing row changed in any table.
2026-11-12 20:01:47 +01:00
bchanot 2cdee42fe1 test(tests): working-copy dialog checks independent of the shared slot
admin.spec opened the working-copy dialog on the historical sheet, whose
single slot was taken by a copy the sandbox suite leaked. The dialog checks
move to an e2e:ui page on the real component; the suite archives its own copies.
2026-11-12 17:06:42 +01:00
bchanot 927537b343 fix(editor): keep the drawing still when the selection changes
The « Sélection : … » tag above the drawing mounted on select and
unmounted on deselect, moving the canvas. It is now sr-only text,
not live, in both twins; board 04 deviation recorded (owner 2026-11-12).
2026-11-12 15:16:34 +01:00
bchanot 6ef5223f0e docs(app): useEmptyTap comment says pen follows touch (R1, D6b) 2026-11-12 13:51:54 +01:00
bchanot 9807ed217a test(app): R1 browser spec without a session path 2026-11-12 13:42:02 +01:00
bchanot 6ed90efb3a fix(app): D6b pen follows touch, stale press and hover guards (R1, D6b) 2026-11-12 13:42:01 +01:00
bchanot 132756eecd fix(app): R1 Escape layers with the page focused, twin keyboard framing, « Plus » field guard 2026-11-12 13:42:00 +01:00
bchanot 0d1edac39a fix(app): « Désélectionner » 44 px touch target below xl, 6 px icon gap (R1 design review) 2026-11-12 13:16:27 +01:00
bchanot 0849e54bc0 test(app): R1 browser checks assert the touch guards and the margin 2026-11-12 13:13:47 +01:00
bchanot 2327d61d8e test(app): « Plus » Escape in the R1 browser checks 2026-11-12 13:05:43 +01:00
bchanot ab823f4191 test(app): browser checks for R1 and D6b
editor-deselect.spec.ts: « Désélectionner » (live region, row focus, document unchanged after reload); Escape by place (canvas, field, delete dialog, references, tracing); mouse empty clicks, selecting, selected point and zone kept; zoom/pan/drag/Ctrl+wheel kept; typed value applied by the deselecting click; touch with a capture recorder; read-only twin at 375 px. editor-equine.spec.ts: empty click on the horse drawing deselects.

Touch guards reached: taps on empty (also 40 px above a zone, 36 px above the box bottom): primary down/up, one click on no annotation, deselect at click. Tap 6 px outside a marker: click target is the marker, it ends selected, no announcement. One-finger drag: no click (twin: pointercancel). Two-finger tap and pinch: non-primary pointerdown seen, 2 pointerups, no click.
2026-11-12 13:04:03 +01:00
bchanot a1ee194725 test(app): D6b link, listener cleanup and pen cases; useEmptyTap within limits (R1, D6b) 2026-11-12 12:55:45 +01:00
bchanot bbdfd27311 feat(app): a click on the drawing deselects (R1, D6b)
The decision comes from the press (landed off a marker, moved <= 4 px, one
pointer), not the click target: mouse and pen act at pointerup, touch in the
tap's own click. The reader passes no onEmpty and is unchanged.
No existing assertion rewritten.
2026-11-12 12:51:59 +01:00