fix(editor): veil ignores clicks, names merged apart, honest tests

U2 Task 6 fix round 1 (review minors 1 to 9).

- R-6: `Dialog` takes `veilCloses`; the annotation dialog passes false,
  so its veil ignores clicks centred too. Other dialogs unchanged.
- Save merges each name on its own (an EN refreshed meanwhile survives
  an FR-only edit); the merged annotation is typed per kind, no cast.
- Tests: the category change and the region row really run (a second
  category and a region in the fixture); EN kept under an FR edit;
  focus to the drawing when a filter hides the row; a centred veil
  ignores a click; act() around the store write; ui.Dialog restores
  innerHeight and visualViewport after each test.
- e2e: `pickAnnotation` no longer scrolls; `scrollToTop` is explicit
  where a low row leaves the drawing out of view (editor-zones x3,
  editor-geometry). editor-geometry runs the accepted repair from the
  page's end, buttons pressed in place, scroll unchanged. The touch
  and double-click tests wait on the clicks themselves; the stray
  click on the veil can fail.
- CreationPanel's `required.fields` recorded as a shortcut for Task 7;
  TODO lines updated. focusTarget comment wrapped.
This commit is contained in:
bchanot committed 2026-11-17 22:47:02 +01:00
1 parent db3f306523
commit 9a0fe3784c
12 files changed
+234 -58

No files matched your search

+13 -5
View File
@@ -22,6 +22,7 @@ import {
shapeWith,
standardShape,
openProperties,
scrollToTop,
} from '../support/editor'
// V1-2.6 geometry and adversarial cases (contract C7, C8, C21; owner 2026-11-04): a click
@@ -211,8 +212,8 @@ 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), wherever the page is scrolled: the issue
// lives in the strip and the dialog, the side column keeps the overview (U2 Task 6).
// Nothing around the drawing moves (A14), from the page's top here.
await scrollToTop(page)
await expectNoShift(page, () => move.click())
await dragInMode(page, { x: 250, y: 250 }, { x: 260, y: 260 })
await expectNoShift(page, async () => {
@@ -226,13 +227,20 @@ test.describe('editor geometry (adversarial)', () => {
await expect(shownShape(page)).toHaveAttribute('cx', '110')
await expect(verification).toContainText(String(errorsBefore))
// Far enough inside: kept, the issue gone, one error less.
await expectNoShift(page, () => move.click())
// Far enough inside, from the page's end: kept, the issue gone, one error less. The
// issue leaving no longer shortens the page (it lives in the strip and the dialog, the
// side column keeps the overview, U2 Task 6), so the scroll clamp moves nothing. The
// buttons are pressed in place (no scroll into view), the page stays at its end.
await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight))
const end = await page.evaluate(() => window.scrollY)
expect(end, 'the page scrolls: its end is not its top').toBeGreaterThan(0)
await expectNoShift(page, () => move.dispatchEvent('click'))
await dragInMode(page, { x: 250, y: 250 }, { x: 290, y: 290 })
await expectNoShift(page, async () => {
await confirm.click()
await confirm.dispatchEvent('click')
await expect(notice).not.toContainText(issue)
})
expect(await page.evaluate(() => window.scrollY)).toBe(end)
expect(Math.abs((await shownNumber(page, 'cx')) - 150)).toBeLessThan(2)
const after = (await verification.innerText()).replace(/\D/g, '')
expect(Number(after || 0)).toBeLessThan(errorsBefore)