feat(editor): point handle, size slider with core minimum, move mode
HandleLayer: its own svg over the overlay, not aria-hidden; the selected
point (or link circle) gets a focusable « Point {nom} » handle whose hit
circle (data-handle) the press machine reads, sized in CSS px under zoom
(R-9, read once from any-pointer: coarse). The Task 2 stand-in (the
selected marker as its own handle) is removed.
Keys on the handle: arrows step 0.5 % of the frame (Shift x10) as a
stamped series, Enter or blur commit once, Escape drops it (R-11, R-13).
SizeSlider in the strip for a selected point and for the Point tool (A5):
the view's sizes as ticks, the core minimum as a red mark, snap 8 px,
arrows 1 %, Page Up/Down next size, one commit on release, Enter or blur;
a refusal restores the size and draws the refused place in red dashes.
« Déplacer le point » opens the move mode (board 06 B): drag anywhere or
four arrows move a preview only, clicks select nothing, « Valider la
position » commits once, « Annuler » and Escape restore; the focus comes
back to the button. Escape follows board 32 (escapeAction). The overlay
reads the preview from the work store and draws the old place in grey
dashes. Ctrl+Z now also works from a slider (not a text field).
Rewritten assertions:
- editor-annotations-tab « a finger drags the selected point »:
drag(marker('anno-a')) -> drag(pointHandle()), same expected geometry.
- editor-geometry.spec « a point inherited out of its frame is repaired
through the geometry group » (cx/cy typed 200) -> « ... repaired with
the move mode »: a partial move refused and restored (cx 110, issue
kept), then a move inside kept (issue gone, fewer errors).
This commit is contained in:
1 parent
2882821661
commit
91e94952f0
23 files changed
+1679
-149
No files matched your search
@@ -23,7 +23,7 @@ import {
|
||||
|
||||
// V1-2.6 geometry and adversarial cases (contract C7, C8, C21; owner 2026-11-04): a click
|
||||
// near the edge of a frame (the corrected position shown, confirmed and cancelled), a
|
||||
// point inherited out of its frame repaired through the geometry group, a crop change
|
||||
// point inherited out of its frame repaired with the move mode (U2 Task 4), a crop change
|
||||
// refused when it would invalidate a point, an unmeasured view with its tools disabled,
|
||||
// and the touch path (touch-action, pointer capture) in a real browser.
|
||||
|
||||
@@ -52,6 +52,20 @@ async function proposed(page: Page): Promise<{ x: string; y: string }> {
|
||||
return { x: found[1], y: found[2] }
|
||||
}
|
||||
|
||||
/** A mouse drag on the drawing in the move mode, between two points in drawing units. */
|
||||
async function dragInMode(
|
||||
page: Page,
|
||||
from: { x: number; y: number },
|
||||
to: { x: number; y: number },
|
||||
) {
|
||||
const start = await clientOf(page, from.x, from.y)
|
||||
const end = await clientOf(page, to.x, to.y)
|
||||
await page.mouse.move(start.x, start.y)
|
||||
await page.mouse.down()
|
||||
await page.mouse.move(end.x, end.y, { steps: 6 })
|
||||
await page.mouse.up()
|
||||
}
|
||||
|
||||
async function fillNames(page: Page, fr: string, en: string) {
|
||||
await creation(page).getByLabel(dict['editor.annotations.name_fr']).fill(fr)
|
||||
await creation(page).getByLabel(dict['editor.annotations.name_en']).fill(en)
|
||||
@@ -155,7 +169,7 @@ test.describe('editor geometry (adversarial)', () => {
|
||||
await expect(selectionTag(page)).toContainText('Bord détail')
|
||||
})
|
||||
|
||||
test('a point inherited out of its frame is repaired through the geometry group', async ({
|
||||
test('a point inherited out of its frame is repaired with the move mode', async ({
|
||||
page,
|
||||
requests,
|
||||
}) => {
|
||||
@@ -175,14 +189,31 @@ test.describe('editor geometry (adversarial)', () => {
|
||||
(await verification.innerText()).replace(/\D/g, ''),
|
||||
)
|
||||
expect(errorsBefore).toBeGreaterThan(0)
|
||||
|
||||
const cx = geometryField(page, dict, 'cx')
|
||||
await cx.fill('200')
|
||||
await cx.press('Enter')
|
||||
const cy = geometryField(page, dict, 'cy')
|
||||
await cy.fill('200')
|
||||
await cy.press('Enter')
|
||||
const move = page.getByRole('button', {
|
||||
name: dict['editor.annotations.move.point'],
|
||||
})
|
||||
const confirm = page.getByRole('button', {
|
||||
name: dict['editor.annotations.move.confirm'],
|
||||
})
|
||||
|
||||
// A partial move (still out of the frame): refused by the core, the point restored.
|
||||
await move.click()
|
||||
await dragInMode(page, { x: 250, y: 250 }, { x: 260, y: 260 })
|
||||
await confirm.click()
|
||||
await expect(page.getByTestId('gesture-message')).toContainText(
|
||||
dict['editor.annotations.message.move_refused'].split(' :')[0],
|
||||
)
|
||||
await expect(page.getByTestId('overlay-refused-place')).toBeAttached()
|
||||
await expect(cx).toHaveValue('110')
|
||||
await expect(issues).toBeVisible()
|
||||
|
||||
// Far enough inside: kept, the issue gone, one error less.
|
||||
await move.click()
|
||||
await dragInMode(page, { x: 250, y: 250 }, { x: 290, y: 290 })
|
||||
await confirm.click()
|
||||
await expect(issues).toHaveCount(0)
|
||||
expect(Math.abs(Number(await cx.inputValue()) - 150)).toBeLessThan(2)
|
||||
const after = (await verification.innerText()).replace(/\D/g, '')
|
||||
expect(Number(after || 0)).toBeLessThan(errorsBefore)
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user