From 8537a98beac520d4a6fc642d9b23b8ee75029c14 Mon Sep 17 00:00:00 2001 From: bchanot Date: Sun, 22 Nov 2026 00:24:42 +0100 Subject: [PATCH] =?UTF-8?q?chore(memory):=20journal=20=E2=80=94=20ship-fea?= =?UTF-8?q?ture=20criterion=2032=20view=20row=20=C2=B7=20TODO=20+1=20/=20-?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/memory/journal.md | 3 + .claude/tasks/TODO.md | 2 +- .../2026-11-21-chip-row-criterion-32-1400.md | 50 +++++++++++ .../2026-11-21-chip-row-criterion-32-1400.md | 85 +++++++++++++++++++ 4 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 .claude/tasks/contracts/2026-11-21-chip-row-criterion-32-1400.md create mode 100644 .claude/tasks/plans/2026-11-21-chip-row-criterion-32-1400.md diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index 49372f8a..f52c9269 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -592,3 +592,6 @@ R5.4: `draft/{labels,changelog,review_report,drawing,overlay,app_review,svg_comp ## 2026-11-21 - Refaire hold e2e :370 root-caused: test missed settleScroll after scrollIntoView (late scroll closes bubble by design); fixed e9f750e4, proven by instrumented runs. Owner: criterion 32 mockup V1-V6 validated, wants visual check before code. - « Placer au centre » shipped 922bd50a in add row (owner moved it from strip after challenge found 5 selection breaks); shared placeAtCentre; verifier CONFORME after 2 ECARTS (test gaps). Chips row: owner approved code. + +## 2026-11-22 +- Criterion 32 one scrolling view row built cbde3646..b59751d3 (ViewSwitcher one 44 px row, viewRow.ts, budget 162/154 px, thresholds 658/650). Final review fixes: reversed slide, double click ignored, 2 vacuous e2e. Verifier 13/13 + security PASS; full shell 381 pass, 13 fail = known 13. Trial step 23 probed in UI. BLK-016 open until owner check. diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index 1f004cb9..5ebc14f2 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -939,5 +939,5 @@ Apply when implementing B-phase: - [x] owner arbitrations (brief « arbitrages propriétaire et préparation de validation finale », 2026-11-02, on c2a3147): A1 BDR-095, A2 board 05 whole horse at 768 px, A3 V1-2.7 lists on failure_outcome, A4 24 common labels + owner arbitrations, A5 affected boards + contact sheet + archive -3.zip; verifier ECARTS(2) → ECARTS(1) → CONFORME 21/21 (27e5727, 74aa8f6) - [ ] Anomaly to diagnose (owner 2026-11-20, new, intermittent): axe colour-contrast failure on the animal archive dialog in the shell suite. Cause not concluded: do not assume it is only a measure taken during the animation. Diagnose with repeated runs, the computed colours and the animation state; no fix before the cause. Known failures outside U2 stay as documented. - [x] U2 trial adjustments (owner trial 2026-11-20; contract `.claude/tasks/contracts/2026-11-20-u2-trial-adjustments-1259.md`, plan `.claude/tasks/plans/2026-11-20-u2-trial-adjustments-1259.md`, commits 4e993058..007d9d41): « Ajouter … » buttons arm their tool on a click or tap (keyboard keeps the centre path, Enter on the drawing while armed, polite announcement); coarse handles lighter (14 / 18 / 32 × 26, hit areas kept); « − » bubble on the open side of its vertex, clear of shown « + » hit areas, on screen. Verifier CONFORME 15/15, security PASS, final review fixes applied. Awaiting the owner's targeted check on db:trial. -- [ ] Criterion 32, view chips on several rows (owner decision pending, 2026-11-20): the pinned column budget counts one row of chips (U2 Task 17); with 3-5 rows the stuck column overflows the window bottom by 64.3 px (1 024 × 768), 53.3 (1 180 × 820), 76.0 (1 180 × 700), 24.3 (1 280 × 800); test committed as `test.fixme` in `apps/app/e2e/shell/editor-geometry.spec.ts`. Second symptom: near the page end the column top also rises under the strip (e.g. 1 024 px, scrollY 1 025: column top 67.75 px vs strip bottom ~120 px). Derived from the four figures (not measured separately): each extra chip row costs about 38 px; rows that fit = 1 + spare / 38 → 1 180 × 820 and 1 180 × 700: one row only; 1 024 × 768: three; 1 280 × 800: four. Pre-existing by construction (the budget counts one row since U2 Task 17). Options: a budget per chip row, chips in one scrolling row, or accept the limit. +- [ ] Criterion 32, one scrolling view row (owner GO 2026-11-21, plan `.claude/tasks/plans/2026-11-21-chip-row-criterion-32-1400.md` rev 3, contract `.claude/tasks/contracts/2026-11-21-chip-row-criterion-32-1400.md`): BUILT cbde3646..HEAD on feature/v1-2-anatomical-sheets (ViewSwitcher one row in a fixed 44 px band, viewRow.ts, pinned budget 162/154 px, thresholds 658/650 px; criterion 32 e2e re-enabled, green at the four windows). Verifier 13/13 at 295413c5; final review fixes bc82cd63..7d6f7cb2 (reversed slide, double click, two e2e checks that could not fail). Open: owner's final check on db:trial incl. tablet step 23 (V1-2-6_OWNER_TRIAL.md); BLK-016 stays open until then. - [x] Anomaly `editor-annotations.spec.ts:370` (Refaire hold bubble under load) RESOLVED e9f750e4: cause = the test (scrollIntoView then press without the `settleScroll` wait every sibling bubble test uses since b5dcb766); its scroll event arrived after the press under --workers=2 load and closed the bubble (closed by any scroll, by design, kept by the owner 2026-11-20). Proof: instrumented run before (bubble on 1505.0 ms, late scroll 1509.1, off 1510.5), 3/3 instrumented runs after (trusted scroll before pointerdown, bubble stays) + clean run 39/39. Contract `.claude/tasks/contracts/2026-11-20-held-bubble-stale-scroll-1708.md`. diff --git a/.claude/tasks/contracts/2026-11-21-chip-row-criterion-32-1400.md b/.claude/tasks/contracts/2026-11-21-chip-row-criterion-32-1400.md new file mode 100644 index 00000000..f8bf85ac --- /dev/null +++ b/.claude/tasks/contracts/2026-11-21-chip-row-criterion-32-1400.md @@ -0,0 +1,50 @@ +# CONTRACT — chip-row-criterion-32 +- date: 2026-11-21 | flow: ship-feature | branch: feature/v1-2-anatomical-sheets +- status: active +- run-base: cbde3646 + +## REQUEST (verbatim — IMMUTABLE) +1. CRITÈRE 32 : UNE SEULE RANGÉE DE VUES + +Je préfère remplacer les vues sur plusieurs rangées par une seule rangée à défilement horizontal interne. + +L'objectif est de conserver une hauteur stable et de maximiser la surface disponible pour le dessin, indépendamment du nombre de vues. + +Exigences UX : +- glissement horizontal au doigt ; +- aucun défilement horizontal de la page entière ; +- toutes les vues accessibles au clavier ; +- vue active clairement identifiable ; +- indication discrète lorsque des vues supplémentaires se trouvent hors écran ; +- aucune régression des gestes sur le dessin. + +Comme il s'agit d'une modification de disposition, prépare une petite maquette ciblée et présente-la-moi avant d'implémenter ce changement. + +(2026-11-21, after the board) V1 : VALIDÉ. Un seul arrêt de tabulation sur la puce active. Les flèches, Début et Fin permettent de naviguer ; Entrée ou Espace active la vue. V2 : VALIDÉ. Fondu avec chevron cliquable pour signaler et atteindre les vues hors écran. V3 : VALIDÉ AVEC PRÉCISION. Je préfère la bande de 44 px contenant des puces visuellement compactes de 30 px. Cependant, leurs surfaces interactives doivent rester confortables au toucher, idéalement 44 px de hauteur. Si cette combinaison n'est pas adaptée, je préfère des puces de 44 px plutôt que de dégrader l'ergonomie tactile. V4 : VALIDÉ. Un indicateur sur le chevron signale la direction de la vue active lorsqu'elle est hors écran. Lors d'une navigation au clavier ou d'une activation, la vue concernée doit aussi être ramenée automatiquement dans la partie visible de la rangée. V5 : VALIDÉ. Le même composant est utilisé dans l'éditeur et en lecture seule, téléphone compris. V6 : VALIDÉ. Les noms des vues restent complets, sans points de suspension. Le défilement doit rester limité à la rangée des vues, sans provoquer de défilement horizontal de toute la page. (Then: « Oui, coder ».) + +## CLARIFICATIONS +Q: Board / A: docs/design/v1-2-6-u2-chips/ (board.html, board.png, captures, README) validated 2026-11-21; versioned with this work (BDR-042). +Q: Pinned budget / A: the parts budget and every figure derived from it (pin height thresholds, « capped below » window heights, docs/ANNOTATION-RENDERING.md pinned paragraph, spec comments) move together, recomputed (2026-11-20 precedent). +Q: Brainstorm choices / A: [gated 2026-11-21] (1) chevrons are pointer and touch aids only: not in the tab order, hidden from assistive technology, a hover title « Vues précédentes » / « Vues suivantes »; (2) a chevron press scrolls the row by 80 % of its width (or brings the off-screen active chip back when its dot shows); (3) activating the chip of the view already shown does nothing (tool, selection, filter kept); (4) at mount and when the row is shown again, the active chip is brought into view without animation; changes made elsewhere (view rows, « Aller à ») bring it with animation unless reduced motion. +Q: Execution deviations (verifier ECARTS on 12 and 13) / A: [gated 2026-11-21] (1) a chip receiving KEYBOARD focus from outside the row (`:focus-visible`) is revealed, because scroll-padding alone left a chip partly under the end fade hidden on Tab entry; a pointer press never scrolls the row (accepted, amends criterion 13's « no reveal on focus » to « no reveal on pointer focus »); (2) for the language switch and the resize, the vertical check measures the canvas top below the draft header (the header wraps differently per language, 116 → 72 px, a pre-existing move outside this work); the view change keeps the absolute ±0.5 px check (accepted, amends criterion 12). +Q: Residuals and the tablet trial / A: [gated 2026-11-21] owner: « Je valide les trois résidus documentés » (a row scroll closes an open hold bubble; the chevron hit areas are a swipe dead zone; some focus behaviours proven only in Chromium) and « Les comportements tactiles qui ne peuvent pas être démontrés de manière fiable en émulation devront figurer dans mon essai manuel sur tablette » → a tablet step in docs/development/V1-2-6_OWNER_TRIAL.md is in scope. +Q: Final review Important 2 (double-click on a peeking chip can activate its neighbour after the reveal slide) / A: [ruled 2026-11-21, technical detail delegated by the owner] the chip ignores the second click of a double-click (`event.detail > 1`); keyboard (detail 0) and a single click or tap (detail 1) unchanged. +Q: Verifier scope note (2026-11-22): `.claude/tasks/TODO.md` changed in the working tree / A: [ruled 2026-11-22, orchestrator] the criterion 32 TODO line rewritten at the capitalize step (records, `.claude/tasks/` run bookkeeping committed by the memory commit), not a product change; criteria 1-13 MET at 161386e8. + +## ACCEPTANCE CRITERIA +1. ViewSwitcher renders one non-wrapping row inside a fixed 44 px band; the row scrolls horizontally inside itself (finger swipe, wheel, trackpad), never the page: no page-wide horizontal scroll at 375, 1 024, 1 180 and 1 280 px with eight long-named views. +2. Each chip's interactive surface is the full 44 px band height with a visible 30 px pill; neighbouring hit areas do not overlap; the focus ring is fully visible (not clipped by the row). +3. Keyboard: one Tab stop on the active chip; ArrowLeft/ArrowRight/Home/End move focus between chips without activating; Enter or Space activates; leaving the row puts the tab stop back on the active chip; the focused chip is brought into the visible part of the row without scrolling the page. +4. The active chip is identifiable by more than colour (a check mark), aria-pressed kept; full names, no ellipsis. +5. A fade with a clickable chevron shows on a side where views are off screen; the chevron scrolls the row by 80 % of its width [gated], is not focusable and is hidden from assistive technology with a hover title [gated]; a dot on the chevron points to the side of an off-screen active view; an activation or a view change made elsewhere brings the active chip into view (animated unless reduced motion), and at mount or when the row is shown again it is placed without animation [gated]; activating the chip of the view already shown changes nothing [gated]. +6. Same component in the editor (guarded activation, R-12) and the read-only tab, phone included. +7. The pinned column budget follows the new band (recomputed parts, thresholds and cap figures, documented first in docs/ANNOTATION-RENDERING.md); criterion 32's test in apps/app/e2e/shell/editor-geometry.spec.ts is re-enabled and passes at 1 024 × 768, 1 180 × 820, 1 180 × 700, 1 280 × 800; the existing geometry, A14 and focus-never-scrolls-the-page tests stay green. +8. No regression of drawing gestures (the touch and annotations shell specs pass); axe passes on the row states. +9. Gates: typecheck, lint, test:run green; shell specs touching chips or the column pass (failures only among the 13 known, by name). +10. [gated 2026-11-21] Clicks and touches are never lost because the row moves: the code never scrolls the row at a press; a pointer press on a chip partly under a fade activates it at the first click; a chevron press never activates a chip. +11. [gated 2026-11-21] Keyboard comfort: a chip reached by Tab, an arrow, Home or End is visible (clear of the fades, except the first and last chips at the clamp) and activable by Enter or Space. +12. [gated 2026-11-21] The row never moves the drawing vertically: the canvas box's top is unchanged (±0.5 px) across a view change, a language switch and a window resize that keeps the layout (band height fixed at 44 px). +13. [gated 2026-11-21] Plan rev 3 (`.claude/tasks/plans/2026-11-21-chip-row-criterion-32-1400.md`) is the binding design: no reveal on focus (Tab relies on `scroll-padding-inline`), a refused guard changes no view, the opening window places instantly. Touch behaviours that emulation cannot show reliably are listed for the owner's tablet trial. BLK-016 is marked resolved only after the new budget and behaviours are verified. + +## FILE SCOPE +apps/app/src/components/editor/annotations/ViewSwitcher.tsx (and a helper module beside it if needed); apps/app/src/components/editor/annotations/EditableAnnotations.tsx; apps/app/src/components/editor/tabs/AnnotationsTab.tsx; apps/app/src/styles/index.css; apps/app/src/i18n/{fr,en}.ts; apps/app/src/components/ui/Icon.tsx (a chevron-left if needed); apps/app/tests/unit/* (chip tests); apps/app/e2e/shell/*.spec.ts and apps/app/e2e/support/* (chip locators, criterion 32 test); docs/ANNOTATION-RENDERING.md; docs/design/README.md; docs/design/v1-2-6-u2-chips/*; docs/development/V1-2-6_UX_TESTS.md; docs/development/V1-2-6_OWNER_TRIAL.md (budget figures, « deux rangées » wording) [gated 2026-11-21]; .claude/tasks/contracts/2026-11-17-v1-2-6-u2-implementation.md (addendum). diff --git a/.claude/tasks/plans/2026-11-21-chip-row-criterion-32-1400.md b/.claude/tasks/plans/2026-11-21-chip-row-criterion-32-1400.md new file mode 100644 index 00000000..bcc12ccc --- /dev/null +++ b/.claude/tasks/plans/2026-11-21-chip-row-criterion-32-1400.md @@ -0,0 +1,85 @@ +# One scrolling chip row (U2 criterion 32) — implementation plan (rev 3, after the confirmation challenge) + +> For agentic workers: executed by subagent-driven-development, one fresh implementer per task, tasks strictly in order (one sandbox, port 5192). + +**Goal:** the view chips become one horizontally scrolling row in a fixed 44 px band (owner board `docs/design/v1-2-6-u2-chips/`, choices V1-V6 and the four gated brainstorm answers), so the pinned drawing column has a stable height whatever the number of views. + +**Spec:** contract `/home/bchanot/Documents/faunosteo-v1-2/.claude/tasks/contracts/2026-11-21-chip-row-criterion-32-1400.md` (criteria 1-9, CLARIFICATIONS `[gated 2026-11-21]`). Board: `docs/design/v1-2-6-u2-chips/board.html` (`.vband` / `.vrow` / `.pill` / `.hint` / `.chev` CSS; `move()`, `target()`, `activate()`, `hints()` JS) and `README.md`. Where this plan and the board differ, this plan wins (it settles cases the board leaves open). + +## Global constraints +- Repo root `/home/bchanot/Documents/faunosteo-v1-2` (absolute). Branch `feature/v1-2-anatomical-sheets`, commit in place; no merge, no `gitflow.sh start`. Review range: `cbde3646..HEAD`. +- Conventional Commits (scopes `editor`, `ui`, `i18n`, `tests`, `docs`), no attribution lines; every commit leaves `pnpm test:run` green AND the touched e2e specs green. +- Gates: `pnpm typecheck`, then `pnpm lint` ALONE (it runs out of memory beside another heavy process), then `pnpm test:run`. E2E only `pnpm db:sandbox e2e-shell e2e/shell/.spec.ts --workers=2`, full paths, never editor-equine, never reset / up fresh, never DEV / db:trial. +- i18n: every string through `useT`, same keys in fr.ts and en.ts. +- A14 (BDR-122): no box moves; the band height is fixed, hints and chevrons are overlays. +- R-12 (BDR-123): the editor's chip activation stays behind `guardedPress` (EditableAnnotations.tsx); arrows never activate. +- Never `scrollIntoView` and never a plain `focus()` on a chip from code: the row is scrolled through its own `scrollLeft` / `scrollTo`, chips are focused with `{ preventScroll: true }`. +- Two instances can be mounted at once (edit body kept `hidden`, read-only twin): no ids; a hidden row measures 0. +- `useT()` returns a new function each render (LRN-088): keep `t` out of effect dependencies. +- Reduced motion: `useReducedMotion` from motion/react (tests: `tests/helpers/motion.ts`). +- happy-dom has no layout (all widths 0, `ResizeObserver.observe` inert): unit tests that need geometry stub it with the house idiom (`Object.defineProperty`, see `tests/unit/editor-zone-edit.test.tsx:926-930`) and carry a positive control. + +## Tasks + +### Task 1 — docs first, board versioned +- `docs/ANNOTATION-RENDERING.md` pinned paragraph (~:266-294) and any view-switcher mention: the chips are one scrolling row in a 44 px band; parts 162 / 154 px = 10.125 / 9.625 rem; pin thresholds 658 px = 41.125 rem (below 1 280 px) and 650 px = 40.625 rem (from 1 280 px), derived as parts + 496 like the existing 644 = 148 + 496 / 652 = 156 + 496; « capped below » window heights 686 / 803 / 678 px at 1 024 / 1 180 / 1 280 px (from `(H − 132 − parts) × 4/3 + 2 = natural box width` 524.7 / 680.7 / 524.7 px); remove « a second chip row adds about 38 px ». +- `docs/development/V1-2-6_OWNER_TRIAL.md` :807-811 and :872-873 (the 652 / 644 px, the 680 / 797 / 672 caps, « boutons de vue sur deux rangées »): the new figures and « une seule rangée de vues défilante ». +- `git add docs/design/v1-2-6-u2-chips/` (board.html, board.png, README.md, capture-*.png). Do NOT change the « implementation pending » mention of docs/design/README.md here (Task 4). +- Commit `docs(docs): one scrolling chip row, pinned budget follows`. + +### Task 2 — ViewSwitcher, its helper, the hosts, the budget and the locators (one commit) +Files: `apps/app/src/components/editor/annotations/ViewSwitcher.tsx` (rewrite), new `apps/app/src/components/editor/annotations/viewRow.ts`, `apps/app/src/i18n/{fr,en}.ts`, `apps/app/src/components/editor/annotations/EditableAnnotations.tsx` (`className="mb-1"` on the ViewSwitcher), `apps/app/src/components/editor/tabs/AnnotationsTab.tsx` (verify, unchanged call), `apps/app/src/styles/index.css` (parts, thresholds, comments with the arithmetic), `apps/app/e2e/shell/editor-geometry.spec.ts` (the `viewChip` helper :47-50 on `getByRole('toolbar', { name: … })`, the comment :683-684 with the new figures), `apps/app/e2e/shell/editor-drawings.spec.ts` (:169-172, toolbar locator), the unit tests that find the chips by `group` « Vues » (editor-overview.test.tsx:97-100, editor-annotations-tab.test.tsx:822-832, editor-zone-edit.test.tsx:1425-1432, editor-point-edit.test.tsx:720-723; grep for more) moved to `toolbar` « Vues » with every assertion kept. Band, gap, budget and locators land in ONE commit. + +#### Design (binding) +- Band and row: `
` holding the row `
` (computed `touch-action: pan-x pan-y pinch-zoom`; `scroll-padding-inline: 72px` keeps the browser's own focus scroll, e.g. Tab entry, clear of the fades), then the two hint overlays (z-[2] inside the isolated band). +- Chip: `