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:
1 parent
e299c3d4f6
commit
13e2503e6a
5 files changed
+143
-28
No files matched your search
@@ -416,6 +416,30 @@ test.describe('editor annotations (A3)', () => {
|
||||
.first()
|
||||
.evaluate((span) => span.scrollWidth > span.clientWidth)
|
||||
expect(cut, 'the message is cut short').toBe(false)
|
||||
// M-5: « Défaire » answers 44 px tall below xl (36 px from xl), the pill unchanged.
|
||||
const reach = width < 1280 ? 44 : 36
|
||||
const hit = await line(page)
|
||||
.getByRole('button', { name: dict['editor.history.undo_title'] })
|
||||
.evaluate(
|
||||
(button, half) => {
|
||||
const box = button.getBoundingClientRect()
|
||||
const x = box.left + box.width / 2
|
||||
const mid = box.top + box.height / 2
|
||||
const at = (dy: number) => document.elementFromPoint(x, mid + dy)
|
||||
const pill = button.closest('[data-testid="gesture-message"]')!
|
||||
return {
|
||||
top: at(-half) === button,
|
||||
bottom: at(half) === button,
|
||||
pill: pill.getBoundingClientRect().height,
|
||||
}
|
||||
},
|
||||
reach / 2 - 1,
|
||||
)
|
||||
expect(hit, `a ${reach} px hit area at ${width} px`).toEqual({
|
||||
top: true,
|
||||
bottom: true,
|
||||
pill: 36,
|
||||
})
|
||||
// Its expiry, 6 s later.
|
||||
await expectNoShift(page, async () => {
|
||||
await page.clock.fastForward(6_100)
|
||||
|
||||
Reference in new issue
Block a user