diff --git a/apps/app/e2e/shell/editor-annotations.spec.ts b/apps/app/e2e/shell/editor-annotations.spec.ts index 058267c8..9071e213 100644 --- a/apps/app/e2e/shell/editor-annotations.spec.ts +++ b/apps/app/e2e/shell/editor-annotations.spec.ts @@ -268,9 +268,9 @@ test.describe('editor annotations (A3)', () => { dict['editor.history.hold_pending'], ) // Playwright refuses to click an aria-disabled button: scroll it clear of the sticky - // bar, then press it by force (the mouse events are real). + // bar, then press it at its box (the mouse events are real). await redo.evaluate((el) => el.scrollIntoView({ block: 'center' })) - await redo.click({ force: true }) + await pressAtBox(page, redo) await expect(page.getByTestId('gesture-line')).toContainText( dict['editor.history.hold_pending'], ) diff --git a/apps/app/src/components/editor/HistoryButtons.tsx b/apps/app/src/components/editor/HistoryButtons.tsx index 0ed2e400..09f4c6ec 100644 --- a/apps/app/src/components/editor/HistoryButtons.tsx +++ b/apps/app/src/components/editor/HistoryButtons.tsx @@ -55,9 +55,9 @@ function holdOf( /** * The press, in two steps: leaving a field commits the typed text (its blur: forced at - * pointer-down, natural when Tab reaches the button), the click or key then reads the - * store, so the typed text is the last change the undo reverts. A field whose commit was - * refused keeps its error: the step is skipped and focus goes back to it. The field is + * pointer-down unless the button is held, natural when Tab reaches the button), the click or + * key then reads the store, so the typed text is the last change the undo reverts. A field + * whose commit was refused keeps its error: the step is skipped and focus goes back to it. The field is * remembered across the pair: from a field, « Défaire » is two Shift+Tab away. A touch * press fires pointer leave between its up and its click, so only a mouse leaving the * button forgets the field (a hovering pointer that left meant no press), or a cancel. diff --git a/apps/app/src/editor/annotations/useZoneEdit.ts b/apps/app/src/editor/annotations/useZoneEdit.ts index 2e92eb09..3c445f75 100644 --- a/apps/app/src/editor/annotations/useZoneEdit.ts +++ b/apps/app/src/editor/annotations/useZoneEdit.ts @@ -101,8 +101,8 @@ function stepVertex(input: ZoneEditInput, index: number, event: KeyboardEvent) { const inMoveMode = () => useAnnotationWork.getState().mode?.kind === 'move' /** - * Delete (or Enter on « − ») removes the chosen vertex; the next one is chosen so the focus - * stays on a vertex (ZoneHandles follows the choice). + * Delete, Backspace (or Enter on « − ») removes the chosen vertex; the next one is chosen so + * the focus stays on a vertex (ZoneHandles follows the choice). */ function deleteChosen(input: ZoneEditInput): void { const id = input.target?.id diff --git a/apps/app/tests/unit/editor-zone-edit.test.tsx b/apps/app/tests/unit/editor-zone-edit.test.tsx index d0f633bd..fce7b20a 100644 --- a/apps/app/tests/unit/editor-zone-edit.test.tsx +++ b/apps/app/tests/unit/editor-zone-edit.test.tsx @@ -209,19 +209,18 @@ describe('a vertex (R-9)', () => { expect(message()).toHaveTextContent('Sommet ajouté') }) - it('undo after « + » drops the chosen vertex: « − » removes nothing stale (Review Focus 2)', async () => { + it('undo after « + » drops the chosen vertex: no stale « − » (Review Focus 2)', async () => { await mount(squareText()) render() await select() clickHandle('Ajouter un sommet après le sommet 1 de N', [50, 20]) - const bubble = hitOf('Retirer le sommet 2 de N') + hitOf('Retirer le sommet 2 de N') fireEvent.keyDown(document.body, { key: 'z', ctrlKey: true }) expect(pointsOf('z')).toEqual(SQUARE) expect(chosen()).toBeNull() expect( screen.queryByRole('button', { name: /^Retirer le sommet/ }), ).toBeNull() - void bubble const after = depth() // (A vertex key acts on its own handle, so it is not a stale case; only the bubble is.) // A press where the bubble was reaches what is there now: a bubble still shown, else the @@ -242,7 +241,7 @@ describe('a vertex (R-9)', () => { expect(message()).toHaveTextContent('Sommet retiré') }) - it('Backspace removes and « + » inserts like Delete and Insert, one commit each, the default prevented', async () => { + it('Backspace removes and « + » inserts like Delete and Insert, one commit each', async () => { await mount(squareText()) await select() const before = depth()