chore(memory): journal — bugfix Refaire hold e2e, plan + contract

This commit is contained in:
bchanot committed 2026-11-21 02:14:17 +01:00
1 parent e9f750e437
commit f05f3fa0e7
4 files changed
+50 -1

No files matched your search

+3
View File
@@ -588,3 +588,6 @@ R5.4: `draft/{labels,changelog,review_report,drawing,overlay,app_review,svg_comp
## 2026-11-20
- U2 trial adjustments shipped on feature/v1-2-anatomical-sheets (4e993058..007d9d41): add buttons arm tools on pointer, keyboard keeps centre, SR path; coarse handles lighter; − bubble open-side placement, hit-area clear. Verifier CONFORME, security PASS. Criterion 32 several chip rows overflow: owner decision. Refaire hold-bubble e2e intermittent.
## 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.
+1 -1
View File
@@ -940,4 +940,4 @@ Apply when implementing B-phase:
- [ ] 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.
- [ ] Anomaly to diagnose (2026-11-20): `editor-annotations.spec.ts:370` « a mouse click on « Refaire » during an arrow series says why » fails 2/2 when run with editor-touch + editor-zones at `--workers=2` on 007d9d41/b79c4aef (history-hold-bubble never appears; « Refaire » is held with its description), passes alone (19/19, workers 2), in that combination at `--workers=1` (39/39), in the full 33-spec run at 1f9ed523 and 3/3 alone. Concurrency-dependent; no file of the held-reason path (HistoryButtons, HeldReasonBubble, useHeldBubble) changed in this run. Unconfirmed hypothesis: under CPU load the press on « Refaire » blurs the handle, the arrow series commits on blur before the press is read, the hold ends. Could matter on a slow tablet. Cause not concluded.
- [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`.
@@ -0,0 +1,31 @@
# CONTRACT — held-bubble-stale-scroll
- date: 2026-11-20 | flow: bugfix | branch: feature/v1-2-anatomical-sheets
- status: active
- run-base: ddf34ada
## REQUEST (verbatim — IMMUTABLE)
2. TEST « REFAIRE » SOUS CHARGE
Je souhaite un diagnostic ciblé.
Le fait que ce test échoue deux fois sur deux dans une combinaison précise ne permet pas encore de le classer comme une simple instabilité du banc de test.
Détermine si le problème vient du test, de la synchronisation des événements ou du comportement réel de l'éditeur.
Je te laisse choisir la méthode de diagnostic et les corrections adaptées.
Ne considère pas ce point comme résolu sans preuve.
## CLARIFICATIONS
Q: Diagnosis / A: plan `.claude/tasks/plans/2026-11-20-held-bubble-stale-scroll-1708.md` rev 2: mechanism proven by an instrumented run (late scroll event of the test's own scrollIntoView closes the bubble after the press); root cause = the test omits `settleScroll` after its scrollIntoView, unlike every other bubble test since b5dcb766; product rule « closed by any scroll » deliberate, hardening offered as an owner option, not done.
Q: Method and fix / A: delegated by the owner (« Je te laisse choisir la méthode de diagnostic et les corrections adaptées »).
Q: Verifier ECARTS(4) outside the fix / A: [ruled 2026-11-20, orchestrator] criteria 1-3 MET. The 3 untracked files docs/design/v1-2-6-u2-chips/* are the owner-requested criterion 32 mockup (separate task, not part of this fix, not committed with it). The FLOOR finding `editor-annotations.spec.ts:930 test.skip(` predates run-base (1deb037f, 2026-11-17) and is clean against run-base ddf34ada. Neither is a gap of this fix.
## ACCEPTANCE CRITERIA
1. `apps/app/e2e/shell/editor-annotations.spec.ts` « a mouse click on « Refaire » during an arrow series » waits `settleScroll(page)` between its `scrollIntoView` and its press, with the same comment as the sibling test; no assertion removed or loosened; no other file changed by the fix.
2. Proof: the failing combination (`pnpm db:sandbox e2e-shell e2e/shell/editor-touch.spec.ts e2e/shell/editor-annotations.spec.ts e2e/shell/editor-zones.spec.ts --workers=2`) passes, in at least one instrumented run whose log shows the trusted `scroll #document` before the `pointerdown` on « Refaire » and no `bubble off` before the « Défaire » press, and in one clean (uninstrumented) run after the instrumentation is removed.
3. Gates: `pnpm typecheck` and `pnpm lint` green (the e2e tsconfig included).
## FILE SCOPE
apps/app/e2e/shell/editor-annotations.spec.ts (the :370 test only); docs/development/V1-2-6_UX_TESTS.md and .claude/tasks/TODO.md (records).
@@ -0,0 +1,15 @@
# Held-reason bubble e2e :370 — fix plan (rev 2, after the three-lens challenge)
## Diagnosis
- BUG: e2e `apps/app/e2e/shell/editor-annotations.spec.ts:370` (« a mouse click on « Refaire » during an arrow series says why ») fails 2/2 when run with editor-touch + editor-zones at `--workers=2`; passes alone, at `--workers=1`, in the full 33-spec run at 1f9ed523.
- MECHANISM (proven, instrumented run of the failing combination): `1502.3 pointerdown SPAN y=0`, `1502.5 click`, `1505.0 bubble on`, `1509.1 scroll #document y=0`, `1510.5 bubble off`. The bubble opens, then the scroll event of the test's own `redo.scrollIntoView({block:'center'})` (:403), dispatched at a later rendering step, arrives after the press and closes it: `useHeldBubble.ts` closes on any scroll by design. The arrow series stays pending (failure snapshot: « Refaire » still held), so « the press commits the series » is refuted.
- ROOT CAUSE: the test. Since rev 5 (b5dcb766, « Deterministic scroll-settle wait for the bubble e2e ») every bubble test waits `settleScroll(page)` (:70-74: « a scroll event of the move before is then past, which a bubble (closed by any scroll) must not meet ») after its scrollIntoView (:333-335); :403-404 presses right after the scroll without it. The race became visible when the spec load grew (1f9ed523 added 110 lines to editor-annotations and 202 to editor-touch, run together at --workers=2); product code of this path unchanged in 70d4addc..HEAD.
- PRODUCT: « closed by any scroll » is a deliberate rule (b5dcb766 chose the test-side settle). A user's own scroll ends before their press; no product failure is shown. A product hardening (close only when the page actually moved) was planned then dropped after the challenge: it leaves inner scrollers, a re-press baseline and React's deferred close as new cases, and has no browser proof of the real-scroll close. Offered to the owner as an option, not done.
- RELATED MEMORY: no BLK names this cause; LRN-089 is another late-event class (route replays). Honors b5dcb766's choice.
## Fix plan
1. `apps/app/e2e/shell/editor-annotations.spec.ts` between :403 and :404: `await settleScroll(page)`, with the comment used at :334 (« Its scroll event lands before the press, which a scroll would close. »).
2. Proof protocol (main loop): on the uncommitted fix, add a capture-phase log (scroll with `isTrusted`, pointerdown, click, bubble on/off, scrollX/scrollY, and the position before scrollIntoView) to :370; run the failing combination at `--workers=2`, up to 3 runs; a run counts only if :370 passes and its log shows the trusted `scroll #document` BEFORE `pointerdown` and no `bubble off` before the « Défaire » press. Remove the instrumentation by an exact reverse replace, check `git diff` shows only step 1, run the clean combination once more.
3. Unit suites untouched.
RISK: none for the product; the test keeps every assertion.
RESIDUAL (named, not closed): the product rule still lets any late scroll event, page or inner scroller, close an open bubble; owner option.