Commit Graph
185 Commits
Author SHA1 Message Date
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
bchanot bbb1668406 feat(app): Désélectionner and the Escape priority (R1, D6, A5, A6)
« Désélectionner » (secondary sm, deselect glyph) sits left of « Supprimer » in a
bordered row of the properties panel, read-only too, hidden while a tracing runs.
It commits the typed field, clears the selection, focuses the row (else the drawing)
and announces. Escape deselects through one document listener per visible body
(not in a text field, only inside the workspace); G1: row focus only from the panel.
« Plus » and the references panel close first; a tracing cancel marks its Escape.

No existing assertion rewritten.
2026-11-12 12:45:45 +01:00
bchanot 7dda61d2ae feat(app): history reads Défaire / Refaire (R1, D5)
FR names Défaire / Refaire; title = name + shortcut (Ctrl+Z ou ⌘Z /
Ctrl+Maj+Z ou ⇧⌘Z), aria-label = name, aria-keyshortcuts adds Meta forms.
New keys editor.history.{undo,redo}_shortcut (fr, en). FR prose use_parent_body
and repair.body_one/_other say Défaire. Dialog Annuler unchanged.

Assertion map (R-24):
- editor-history-buttons.test.tsx UNDO/REDO constants 'Annuler la dernière
  modification' / 'Rétablir la dernière modification annulée' → 'Défaire la
  dernière modification' / 'Refaire la dernière modification défaite'
- :80-81 title === UNDO/REDO → title `${UNDO} (Ctrl+Z ou ⌘Z)` / `${REDO}
  (Ctrl+Maj+Z ou ⇧⌘Z)`
- :82-83 aria-keyshortcuts 'Control+Z' / 'Control+Shift+Z' → 'Control+Z
  Meta+Z' / 'Control+Shift+Z Meta+Shift+Z'
- visible labels ['Annuler','Rétablir'] → ['Défaire','Refaire']
- tool column absence /Annuler|Rétablir/ → /Défaire|Refaire/ (also
  editor-annotations-tab.test.tsx:514)
- Rétablir button lookup by literal name → REDO constant
- added: EN names unchanged with title '(Ctrl+Z or ⌘Z)'; FR prose contains
  Défaire while use_parent_cancel stays 'Annuler'
- e2e titles/comments only: Annuler/Rétablir → Défaire/Refaire
2026-11-12 12:39:01 +01:00
bchanot 9f60d841eb fix(app): trial dev server serves one of two known stacks only (R13)
trial.config.ts no longer accepts any loopback gateway. A literal
table (vite/trial-targets.ts) holds the db:sandbox trial target
(5193, gateway 57801, issuer db-sandbox) and the db:trial target
(5194, gateway 58801, issuer faunosteo-trial, gateway identity
probe); the gateway picks the entry by exact match and the app
port, app URL and anon key issuer must match it, with no default
and no fallback. Tests cover both mix-ups, the probe and the
values db-sandbox.sh passes today.
2026-11-10 13:40:42 +01:00
bchanot b682f78209 test(supabase): sandbox suites refuse every target but the sandbox
The sandbox suites (stack.ts and its importers, the shell Playwright
config) stop before their first request unless the container, the
four loopback URLs and the key issuer are exactly the db:sandbox
ones; the LAN config accepts the 5193 trial app only. Drift and
wiring tests tie the constants to scripts/db-sandbox.sh.
2026-11-10 13:36:08 +01:00
bchanot 0467885527 fix(editor): final review fixes (touch undo guard, focus, save line)
Important 1: a touch press fires pointer leave between up and click; only a
mouse leave (or a pointer cancel) forgets the refused field, so Annuler no
longer undoes an unrelated change. Important 2: the LAN spec reads the
revision before the attach, through shownRevision, which throws instead of NaN
(spec stays not run). Minor 1: refocusIfHidden refocuses a still shown element
the commit blurred (references search on a 1 024 px crossing). Minor 2:
discardChanges keeps lastSave (reload path still drops it). Minor 3: the
overview filter term lives in UiState / the read-only twin, not the card.
Minor 4: categories section drops its inner h3 and the unused
editor.general.categories keys. AC8: badge test.

Assertions rewritten or added (R-24):
- editor-tabs-general « Général no longer holds the categories editor »:
  queryByText of the deleted heading (now vacuous) -> queryByLabelText of the
  category name fields.
- editor-focus-request « Annotations: selects the annotation »: findAllByText
  /anno-b|Sélection/ -> the properties panel holds Centre x = 20 (anno-b) and
  owns the focused heading.
- editor-shell-layout panel walk: added after.at(-1) === 'side'.
- editor-recovery title « Annuler les modifications » -> « Abandonner ».
- new: touch/cancel/mouse press, references search crossing, discard keeps
  lastSave, filter kept, one categories heading, badge 1/2/0, shownRevision.
2026-11-09 12:19:32 +01:00
bchanot 606f7ba268 fix(app): crossing focus for any element in a hidden part
Focus held by any element that a crossing hides or unmounts (button, tool,
canvas, link) goes to the shown tab, decided by the element leaving the page,
not by tag; a field still commits first; visible focus stays.
History pair: remembered field must be connected, and a pointer-down off a
field keeps it. TextField.commit compares with the latest committed value.
Open-panel axe settles and checks dialogs like the other places.

R-24: no assertion rewritten or deleted; one Chromium case and three unit
tests added.
2026-11-08 20:43:27 +01:00
bchanot a474ddaa40 test(app): browser journeys of the four-tab editor shell
New specs editor-shell-{journeys,crossing,layout}: four tabs, cross-tab
undo, typed text then header undo, Shift+Tab to Annuler with a refused field,
Ctrl+Z in and out of a field, Aller a per issue kind, save line states,
every kept part across a 1 024 px crossing, drag across it, confirmations
closing, withheld decision, widths, axe, keyboard order, canvas widths with
and without the panel; equine commit-to-paint with every place visited.

R-24 mapping: editor-shell B2b `:focus` count 0 after the crossing is now
focus on #editor-tab-annotations (focus goes to the shown tab, not body).
Prettier re-wrapped two Lot F lines in editor-shell.spec.ts; no assertion
changed there.
2026-11-08 20:23:40 +01:00
bchanot 0bb150f860 fix(app): focus the shown tab after a crossing, one commit per typed field
- A field blurred by a 1 024 px crossing or a read-only switch hands its
  focus to the shown tab (or Plus), never to body (focusRequest, useViewport).
- TextField no longer commits a blurred value twice when it unmounts before
  the render that brings the new value: one undo step, one count.
- Annuler and Retablir share the field left by Tab, so Shift+Tab to Annuler
  and Enter still skips the undo of a refused field.
- Adding a reference clears the finding filter and the search.

Unit tests: no-loss (focus on tab and on Plus, one undo entry), history
buttons (field kept across the pair), references panel (add clears, refused
add keeps).
2026-11-08 20:23:40 +01:00
bchanot 925d843521 style(app): wrap Lot F lines over 100 columns 2026-11-08 19:30:46 +01:00
bchanot 62fb8dc7b8 fix(app): Lot F review polish (tests, drawer default)
Measure kept as a canvas-width annotation, no console.log; positive
two-frame wait replaces the fixed sleep; 64rem listener asserted
absent in the editor; drawer default read from DEFAULT_SHELL; long
test lines wrapped.
2026-11-08 19:29:36 +01:00
bchanot 580ff28214 feat(app): editor sidebar hidden below 1 280 px, menu one tap away
AC9: on the draft editor path AppLayout uses the xl class set (sidebar
from 1 280 px, menu button and brand below); other pages keep lg.
AppLayout split: Sidebar and TopBar in ShellChrome.tsx. MobileDrawer
takes closesFrom ('64rem' | '80rem') and also closes at setup when
its query already matches.

Rewritten assertions (R-24):
- shell.AppLayout "opens the mobile drawer" and shell.navigation
  "carries the same entries into the mobile drawer": stub a narrow
  matchMedia, the drawer now closes at setup at the happy-dom width.
New: unit tests (class sets, 64rem/80rem close, setup close, leave
guard on a drawer link) and editor-shell.spec F journeys (sidebar at
1024/1180/1279/1280, one-tap menu, drawer open at 1180, guard).
2026-11-08 19:25:49 +01:00
bchanot 89da8d3f55 fix(editor): keyboard refused-commit rule, missing history tests
Keyboard activation after a refused blur commit skips the undo and refocuses the field. Adds restore, Général-from-Annotations and DeleteDialog tests; SaveLine helpers.
2026-11-08 18:09:10 +01:00
bchanot 99b669bf8f feat(editor): header history, save line and Abandonner les modifications
Header Annuler/Retablir on every tab (aria-disabled, commit on pointerdown,
refused blur commit skips the undo). Save line: unsaved count selector
(savedDistance), saveLineState forms, server save time via readSaveTime
(lastSave in the store, never the browser clock). Discard relabelled and
names the stored copy. Tool column pair removed, glyphs in EditorGlyph.

Rewritten or removed assertions (R-24):
- editor-route.test: Revision 3 / unsaved text / Annuler les modifications
  -> save-line testid, Abandonner label, copy sentence in the dialog
- editor-route-conflict, editor-route-recovery: Revision n and copy_cap/
  copy_quota text queries -> save-line testid
- editor-no-loss: discard button label
- editor-annotations-tab: tool column undo/redo test -> no pair left
  (behaviour moved to editor-history-buttons.test)
- e2e journey/annotations/recovery/structures/support saveDraft/lan:
  undo/redo and revision/unsaved text -> historyButton, saveLine helpers;
  structures toHaveCount(0) on old text -> exact Revision n line
- editor-shell clickability: header Annuler/Retablir added
2026-11-08 17:55:49 +01:00
bchanot ab51ea764d feat(editor): references side panel with filter, search and counts
Non-modal panel in a relative container after the tab row (scrim over the
tab panels, which are inert while it is open). Chip "Citées par" opened
from a finding's Citations block, "Tout afficher (N)", accent- and
case-insensitive search on citation, DOI and URL, "citée n fois" per card
(citationCounts, memoised TS read; the core stays the authority for
refused deletions). Up/down only without filter or search. "Aller à" a
reference clears a hiding search then focuses the card.

Rewritten assertions (R-24): editor-shell "the references panel keeps its
form text and no id repeats" closes the panel before reaching the inert
tab panels. Added: Chromium clickability at 1 024 and 1 280 px (top and
scrolled), editor-structures count and search, unit
editor-references-panel, editor-citations, navigation clear_cited_by.
2026-11-08 17:33:26 +01:00
bchanot cf9c300c80 test(editor): view row switches the canvas view 2026-11-08 17:18:02 +01:00
bchanot 7cca88592f test(editor): scoped overview card queries, group names 2026-11-07 03:03:39 +01:00
bchanot 6131225288 feat(editor): board 01 annotation card, side column from 1 024 px
Annotations of the view move from under the drawing to the overview card
(grouped by category, name filter, all rows); side column from lg.
Properties panel gains « Toutes les annotations ».

E2E mapping (R-24): after a creation the card is hidden (the new annotation is
selected), so list(...).getByText(name) became selectionTag toContainText
(annotations, geometry, journey); row clicks go through pickAnnotation
(annotations, geometry, journey, structures); geometry's list count 0 while a
creation is pending became selectionTag count 0.
2026-11-06 21:40:25 +01:00
bchanot 51fd3db608 feat(editor): no silent loss on a 1 024 px crossing
Drawing actions stay mounted and hidden while read-only: an upload in
flight, a cleaning candidate, a repair offer and a parent choice come
back on widening. Decision dialogs open only while editing, in a shown
place, references panel closed; otherwise the decision is held per
object, shown as a pending line, reopened by « Reprendre » (absent in
read-only). Picker, file input and parent button are disabled while one
is pending. Repair geometries move into RepairDialog, keyed on the offer.

R-24: no existing assertion rewritten; editor-no-loss-decisions.test.tsx
added (12 cases).
2026-11-06 21:23:46 +01:00
bchanot c57af6441f feat(editor): keep edit-only forms across a width change
Edit-only parts (creation forms, submission note, crop group, annotation
edit body) mount at the first editable render and stay mounted, hidden
and detached from canvases, while read-only. Guards: the viewport hook
commits the focused field before the tier crosses 1 024 px, the route
releases focus left in a hidden part and treats a store out of step as
read-only, delete and discard confirmations close when the editor turns
read-only, a drag is dropped while the edit body is hidden. Read-only
twins take an id prefix.

R-24: no existing assertion rewritten; editor-no-loss.test.tsx and two
editor-shell Chromium cases added.
2026-11-06 21:22:10 +01:00
bchanot 9d89daed19 test(editor): pending creation announcement on « Aller à » 2026-11-06 20:59:11 +01:00
bchanot 79a09f8b25 test(editor): keep-alive paths, neutral place visibility
Place visibility context moves to lib/placeVisibility.ts so the catalogue
no longer imports from components/editor. Adds tests: selection survival,
unmeasured hint round trip, keyboard tab move and « Aller à » with a field
focused, replace-tracing kept, announcements. Parse-sharing test uses
object identity. Early exits are two statements; shortcut comment on the
parse cache.

R-24:
- editor-equine.spec.ts:118, editor-geometry.spec.ts:376,
  editor-recovery.spec.ts:39, editor-signout.spec.ts:26: page.getByLabel
  ('Nom (FR)') -> place(page, 'general').getByLabel(...)
- editor-shell.spec.ts: toHaveCount(0) on the visible query -> count 1
  on the raw selector and toBeHidden()
- editor-keep-alive.test.tsx: JSON.parse stack-trace count -> same
  object reference across places
2026-11-06 20:57:08 +01:00
bchanot 6689827a8d feat(editor): kept-mounted tabs, sections and references panel
Each visited tab, Annotations section and the references panel stay
mounted in a KeptPlace (hidden, nested visibility). Composed canvases
detach while hidden. One JSON.parse per document text. Focus requests
reach only their owning place.

Rewritten assertions (R-24):
- editor-route.test.tsx:127: annotations testid toBeNull -> not.toBeVisible
- editor-sections.test.tsx: place('annotations.drawing') toBeNull -> not.toBeVisible
- editor-journey.spec.ts:311: page-wide getByLabel('Nom (FR)') -> scoped to place 'general'
- editor-tabs-lists.test.tsx: ReferencesPanel `open` prop dropped (the wrapper hides it)
- editor-annotations-tab, editor-focus-request, editor-sections tests: props gain `visited`
No assertion removed.
2026-11-06 20:50:40 +01:00
bchanot ca184da4d9 refactor(editor): split B1 navigation hooks, category count on the overview card 2026-11-06 20:31:26 +01:00
bchanot bc2dba7c14 feat(editor): four tabs, Annotations sections, references from the header
U1 Lot B1. Four tabs (Général, Annotations, Constats, Vérification); views,
categories and regions become full-width Annotations sections opened from the
overview panel; references move to a header-toggled panel (minimal, Lot D
completes it); « Aller à » goes through EditorTarget and the navigation hook.
EditorWorkspace owns the navigation; DraftHeader split in HeaderActions and
SaveLine; EditorTabs split in TabList and MoreTabs.

R-24, assertions removed or rewritten (file: old -> new):
unit
- editor-route.test: seven tab names -> four; « Plus » at 800 px with
  Références clicked -> no « Plus »; below 640 px five others -> Général,
  Constats, and Constats opens the findings tab; + references panel cases
- editor-route-recovery.test: tab Références + editor-tab-references label ->
  header button + editor-references-panel labelled by its heading
- editor-mode.test: small tier `more` of five -> [general, findings]
- editor-focus-request.test: {key,serial} -> {target,serial}; ReferencesTab and
  VertebraeTab -> ReferencesPanel and RegionsSection; issueTarget tab/key ->
  target place/section/key (vertebrae tab -> annotations/regions); consumed
  context (serial) -> (serial, outcome); annotation case adds heading focus
- editor-verification.test: onGoTo('annotations', key) -> navigate(targetOfKey
  (key), opener); props onSelectTab/onGoTo -> navigate
- editor-annotations-tab.test: props onSelectTab -> navigate + section props;
  no_category text « (onglet Général) » -> « (Annotations, section
  Catégories) »
- editor-tabs-general.test: categories cases render GeneralTab ->
  CategoriesSection(doc); + Général holds no categories editor
- editor-tabs-lists.test: tab imports -> panel and section; read-only
  references « no button » -> only « Fermer les références »
- editor-tabs-views, editor-drawing-upload, editor-repair.test: ViewsTab ->
  ViewsSection import, assertions kept; editor-findings.test: navigate prop
e2e
- support/editor selectTab: exact name -> pattern (error badge in the name);
  + place, openSection, showDrawing, backToDrawing, openReferences, TABS
- support/warm-up: seven tabs -> four + sections + references panel
- editor-access: seven-tab axe loops -> four tabs + three sections + panel
  (edit and read-only); narrow widths add panel overflow and axe
- editor-drawings: tab Vues -> openSection views; tab Annotations ->
  showDrawing
- editor-structures: tab Général (categories) -> openSection categories, axe
  label « general tab » -> « categories section »; tab Références ->
  openReferences/closeReferences; tab Vertèbres -> openSection regions; tab
  Annotations -> showDrawing
- editor-geometry: three tab Vues -> openSection views
- editor-equine: tab Général (categories add) -> openSection categories; five
  tabs loop -> two tabs + sections + panel; tab Annotations -> showDrawing
- editor-journey: tab Vues, tab Général (category), tab Annotations ->
  openSection views/categories, showDrawing; frozen axe scrolls to the header
- lan/trial-lan (not run): tab Vues -> Annotations tab + views entry

Verified: typecheck, lint, vitest 107 files / 1125 tests, whole shell suite on
the sandbox 151 passed, 49 skipped, 0 failed.
2026-11-06 20:25:35 +01:00
bchanot 95b1b7e461 feat(editor): navigation model for the four-tab shell 2026-11-06 18:25:21 +01:00
bchanot 9b86f54336 docs(supabase): trial guide, exact status of the editor-launch route 2026-11-04 23:58:11 +01:00
bchanot 9e68bdd1fa docs(supabase): trial comments and guide state the refusals exactly 2026-11-04 23:51:55 +01:00
bchanot 72b742f9d3 fix(supabase): LAN trial closes every upgrade socket, guide on CORS 2026-11-04 23:43:15 +01:00
bchanot 8531dd30d8 fix(supabase): LAN trial without CORS, hot-reload socket or editor launch 2026-11-04 23:30:52 +01:00
bchanot 5207f87e66 fix(supabase): LAN trial answers its own host only, guide matches lot O 2026-11-04 23:19:57 +01:00
bchanot fb95255759 fix(supabase): LAN trial serves the app sources only, no Postgres password in Vite 2026-11-04 23:03:47 +01:00
bchanot 2057b0ecbb style(i18n): single quotes on the zone label 2026-11-04 22:37:18 +01:00
bchanot d74c54ed05 feat(supabase): owner trial served on the LAN address, sandbox kept on loopback 2026-11-04 22:36:50 +01:00
bchanot a69eba569b fix(editor): free paths never reshaped on attach, category zone chosen explicitly 2026-11-04 22:14:59 +01:00
bchanot 5e0aa625a8 fix(editor): submission note sent as typed, copies purged again after sign-out 2026-11-04 20:50:16 +01:00
bchanot 46fd861224 refactor(editor): applyRepair within the locals limit 2026-11-04 20:20:38 +01:00
bchanot 9c21fd3f86 fix(editor): repair dialog limits, pending drafts block apply, dialog wording 2026-11-04 20:17:51 +01:00
bchanot 3776a33b79 feat(editor): repair out-of-frame annotations when attaching a drawing 2026-11-04 20:10:07 +01:00