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.
This commit is contained in:
bchanot committed 2026-11-06 20:25:35 +01:00
1 parent 95b1b7e461
commit bc2dba7c14
56 files changed
+2419 -699

No files matched your search

+11 -6
View File
@@ -4,8 +4,11 @@ import { expect, expectAccessible, test } from '../support/browser'
import { dropLateReplays, routeToSandbox } from '../support/sandbox'
import {
bareShape,
closeReferences,
editorActor,
openEditor,
openReferences,
openSection,
pointOf,
saveDraft,
seedDraft,
@@ -13,6 +16,7 @@ import {
serverDocument,
serverRevision,
shapeWith,
showDrawing,
} from '../support/editor'
// V1-2.6 A4 (contract C9 to C12, C19): the structures around the drawing. Annotation
@@ -56,7 +60,7 @@ test.describe('editor structures (A4)', () => {
requests.forbid(actor.account.email, actor.account.password)
// A category added, then renamed in place.
await selectTab(page, dict, 'general')
await openSection(page, dict, 'categories')
await page.locator('#category-new-fr').fill('Catégorie B')
await page.locator('#category-new-en').fill('Category B')
await page
@@ -67,10 +71,10 @@ test.describe('editor structures (A4)', () => {
await expect(names).toHaveCount(2)
await commitText(names.nth(1), 'Catégorie B bis')
await expect(names.nth(1)).toHaveValue('Catégorie B bis')
await expectAccessible(page, 'the general tab')
await expectAccessible(page, 'the categories section')
// Two references, the second moved up.
await selectTab(page, dict, 'references')
await openReferences(page, dict)
for (const citation of ['Première référence', 'Seconde référence']) {
await page.locator('#reference-new-type').selectOption('book')
await page.locator('#reference-new-citation').fill(citation)
@@ -100,7 +104,8 @@ test.describe('editor structures (A4)', () => {
await expect(citations).toHaveCount(1)
// A region with its count.
await selectTab(page, dict, 'vertebrae')
await closeReferences(page, dict)
await openSection(page, dict, 'regions')
await page.locator('#region-new-code').fill('T')
await page.locator('#region-new-fr').fill('Thoracique')
await page.locator('#region-new-en').fill('Thoracic')
@@ -245,7 +250,7 @@ test.describe('editor structures (A4)', () => {
requests.forbid(actor.account.email, actor.account.password)
// The category is used by the point: the dialog lists it and offers no deletion.
await selectTab(page, dict, 'general')
await openSection(page, dict, 'categories')
await page
.getByRole('listitem')
.filter({ has: page.locator('#category-cat-a-name-fr') })
@@ -283,7 +288,7 @@ test.describe('editor structures (A4)', () => {
.click()
// The point goes first; the zone then deletes with its descendants named.
await selectTab(page, dict, 'annotations')
await showDrawing(page, dict)
await page
.getByRole('list', { name: dict['editor.annotations.list'] })
.getByRole('button', { name: /Point lié/ })