fix(editor): gesture line alerts, focus after « Défaire », hit area

Final review M-3, M-4, M-5, M-8.
- M-3: the line and the strip render a refusal's role="alert" beside
  their always-mounted role="status" region, never inside it; every
  shown message carries a serial that keys its pill, so a repeated
  identical refusal is a new pill and is announced again.
- M-4: after the line's « Défaire » the focus goes to the canvas box.
- M-5: « Défaire » gets a transparent ::before, 44 px tall below xl
  (36 px from xl), within the row's reserved 44 px: the pill keeps
  its 36 px. The A14 e2e checks the hit area at 1024, 1180, 1280 px.
- M-8: the « swallows the click on a marker » test fired a click the
  canvas ignores since T2; the inert click is dropped, the title says
  what the taps prove.

Tests rewritten: « the message sits on its own row »: role="status" on
the row → a role="status" region inside the row, empty at rest.
« a mouse tap deselects … swallows the click »: the final
fireEvent.click on the marker removed (inert), its isDeselected
assertion kept after the second tap.
This commit is contained in:
bchanot committed 2026-11-18 13:00:22 +01:00
1 parent e299c3d4f6
commit 13e2503e6a
5 files changed
+143 -28

No files matched your search

@@ -1,6 +1,7 @@
import {
useCallback,
useEffect,
useRef,
useState,
type FocusEvent,
type PointerEvent,
@@ -26,6 +27,11 @@ export interface GestureMessage {
undo: boolean
hint: boolean
stamp: Stamp
/**
* Counts every message shown: a repeated identical refusal changes no document, yet it
* is a new pill and is announced again (M-3).
*/
serial: number
/** The place the core refused, drawn in red dashes while the refusal shows. */
place: Geometry | null
}
@@ -103,6 +109,7 @@ export function useGestureMessage() {
[],
)
useCloseOnChange(close)
const serial = useRef(0)
useEffect(() => {
if (!message || held) return
const timer = setTimeout(
@@ -118,6 +125,7 @@ export function useGestureMessage() {
undo,
hint: false,
stamp: currentStamp(),
serial: ++serial.current,
place: place ?? null,
})
const hint = (text: string) => {
@@ -128,6 +136,7 @@ export function useGestureMessage() {
undo: false,
hint: true,
stamp: currentStamp(),
serial: ++serial.current,
place: null,
})
}