feat(editor): vertex handles, insert and remove, zone move, redraw
U2 Task 5. A selected polygon gets its vertex, « + » and « − » handles (R-9, hidden « + » under two hit radii, R-18 zoom hint in the strip), the handle cap at 40 (R-7), vertex drag and keys, the move mode on the zone or the chosen vertex, « Redessiner » as a redraw mode kept in step with its tracing (R-12 guard, R-13 drop), close radius in CSS px (R-11). The numeric group leaves the properties panel (D1). Removed or rewritten assertions (numeric group -> replacement): - tab « shows its exact stored numbers » (Centre x field) -> the overlay selection circle's cx attribute, same exact value. - tab « a numeric edit » x3 -> « an edit on the drawing »: Enter on the handle without a step commits nothing, a step + Enter commits once; a refused handle drag keeps the stored shape then a drag inside the frame repairs it (issues gone); Escape drops a pending series. - tab C26 « Centre x 15 » -> overlay cx 15. - tab C32 unmeasured « Centre x as text » -> no handle, no field. - tab « adds and removes a vertex as part of the whole group » -> « + » then « − » on the drawing; « never offers to remove below three » -> « − » aria-disabled at 3. - tab H8 « refused Remplacer drops the tracing » -> keeps it open with « Fermeture refusée » (board 33 A); « refused vertex add/remove stay non appliqué » -> a refused vertex drag restores the shape exactly. - tab Désélectionner and D6b (typed Centre x committed, refused, undone) x6 and strip « a new commit replaces the message » -> the same with the Nom (FR) field (a blank name is the refused value). - focus-request « Centre x 20 » -> overlay cx 20. - escape « strip commands keep their Escape » -> a redraw: Escape on the strip or the box cancels it (R-12 row 4); kept for a new zone tracing. - keep-alive « Remplacer tracing kept across Aller à » -> ended by a tab when empty, asked once a vertex is placed (R-12). - e2e annotations: numeric cx edit + undo/redo -> handle keys + undo/ redo; jitter/drag and Task 4 point reads -> overlay attributes (the stored place during the mode -> overlay-old-place); keyboard-only cy and vertex x typed -> handle and vertex keys. - e2e deselect: Centre x typed/refused/committed -> Nom (FR). - e2e geometry, shell-crossing: Centre x/cy reads -> overlay attributes. - e2e journey: cx +3 and vertex x +4 typed -> 3 and 4 arrow steps + Enter; a far typed value + revert -> a far handle drag refused. - e2e equine latency: typed cx rounds -> handle arrow + Enter rounds.
This commit is contained in:
1 parent
ba8e766fe8
commit
6211046537
44 files changed
+3790
-1050
No files matched your search
@@ -8,7 +8,8 @@ import {
|
||||
clickDrawing,
|
||||
clientOf,
|
||||
editorActor,
|
||||
geometryField,
|
||||
shownNumber,
|
||||
shownShape,
|
||||
openEditor,
|
||||
openSection,
|
||||
pickAnnotation,
|
||||
@@ -130,8 +131,8 @@ test.describe('editor geometry (adversarial)', () => {
|
||||
.click()
|
||||
await expect(creation(page)).toHaveCount(0)
|
||||
await expect(selectionTag(page)).toContainText('Bord')
|
||||
await expect(geometryField(page, dict, 'cx')).toHaveValue(shown.x)
|
||||
await expect(geometryField(page, dict, 'cy')).toHaveValue(shown.y)
|
||||
await expect(shownShape(page)).toHaveAttribute('cx', shown.x)
|
||||
await expect(shownShape(page)).toHaveAttribute('cy', shown.y)
|
||||
})
|
||||
|
||||
test('a click near the edge of a detail crop is corrected inside the crop', async ({
|
||||
@@ -190,7 +191,6 @@ test.describe('editor geometry (adversarial)', () => {
|
||||
(await verification.innerText()).replace(/\D/g, ''),
|
||||
)
|
||||
expect(errorsBefore).toBeGreaterThan(0)
|
||||
const cx = geometryField(page, dict, 'cx')
|
||||
const move = page.getByRole('button', {
|
||||
name: dict['editor.annotations.move.point'],
|
||||
})
|
||||
@@ -201,6 +201,10 @@ test.describe('editor geometry (adversarial)', () => {
|
||||
// A partial move (still out of the frame): refused by the core, the point restored.
|
||||
// Nothing around the drawing moves (A14); the side panel's content may (Task 6).
|
||||
const swaps = ['aside-content'] as const
|
||||
// The list row scrolled the page to its end. Without the coordinate fields (U2 Task 5)
|
||||
// the panel is short enough that the issue list leaving it (aside content, exempt until
|
||||
// Task 6) would clamp that scroll: the check starts from the top.
|
||||
await page.evaluate(() => window.scrollTo(0, 0))
|
||||
await expectNoShift(page, () => move.click(), swaps)
|
||||
await dragInMode(page, { x: 250, y: 250 }, { x: 260, y: 260 })
|
||||
await expectNoShift(
|
||||
@@ -215,7 +219,7 @@ test.describe('editor geometry (adversarial)', () => {
|
||||
dict['editor.annotations.message.move_refused'].split(' :')[0],
|
||||
)
|
||||
await expect(page.getByTestId('overlay-refused-place')).toBeAttached()
|
||||
await expect(cx).toHaveValue('110')
|
||||
await expect(shownShape(page)).toHaveAttribute('cx', '110')
|
||||
await expect(issues).toBeVisible()
|
||||
|
||||
// Far enough inside: kept, the issue gone, one error less.
|
||||
@@ -229,7 +233,7 @@ test.describe('editor geometry (adversarial)', () => {
|
||||
},
|
||||
swaps,
|
||||
)
|
||||
expect(Math.abs(Number(await cx.inputValue()) - 150)).toBeLessThan(2)
|
||||
expect(Math.abs((await shownNumber(page, 'cx')) - 150)).toBeLessThan(2)
|
||||
const after = (await verification.innerText()).replace(/\D/g, '')
|
||||
expect(Number(after || 0)).toBeLessThan(errorsBefore)
|
||||
})
|
||||
@@ -501,8 +505,7 @@ test.describe('editor touch path (real browser)', () => {
|
||||
// touchstart, so a drag of the selected marker must not be left to the pan.
|
||||
await pickAnnotation(page, dict, /Tactile/)
|
||||
await expect.poll(touchAction).toBe('none')
|
||||
const cx = geometryField(page, dict, 'cx')
|
||||
await expect(cx).toHaveValue('500')
|
||||
await expect(shownShape(page)).toHaveAttribute('cx', '500')
|
||||
const from = await clientOf(page, 500, 400)
|
||||
const to = await clientOf(page, 620, 400)
|
||||
const cdp = await context.newCDPSession(page)
|
||||
@@ -521,7 +524,7 @@ test.describe('editor touch path (real browser)', () => {
|
||||
y: from.y,
|
||||
})
|
||||
await touch('touchEnd', null)
|
||||
await expect(cx).not.toHaveValue('500')
|
||||
expect(Math.abs(Number(await cx.inputValue()) - 620)).toBeLessThan(3)
|
||||
await expect(shownShape(page)).not.toHaveAttribute('cx', '500')
|
||||
expect(Math.abs((await shownNumber(page, 'cx')) - 620)).toBeLessThan(3)
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user