feat(editor): board 01 annotation card, side column from 1 024 px

Annotations of the view move from under the drawing to the overview card
(grouped by category, name filter, all rows); side column from lg.
Properties panel gains « Toutes les annotations ».

E2E mapping (R-24): after a creation the card is hidden (the new annotation is
selected), so list(...).getByText(name) became selectionTag toContainText
(annotations, geometry, journey); row clicks go through pickAnnotation
(annotations, geometry, journey, structures); geometry's list count 0 while a
creation is pending became selectionTag count 0.
This commit is contained in:
bchanot committed 2026-11-06 21:40:25 +01:00
1 parent 51fd3db608
commit 6131225288
16 files changed
+404 -94

No files matched your search

@@ -8,8 +8,10 @@ import {
editorActor,
geometryField,
openEditor,
pickAnnotation,
saveDraft,
seedDraft,
selectionTag,
selectTab,
serverDocument,
standardShape,
@@ -92,7 +94,7 @@ test.describe('editor annotations (A3)', () => {
.getByLabel(dict['editor.annotations.zone'])
.selectOption('zone-a')
await createFromPanel(page)
await expect(list(page).getByText('Point un')).toBeVisible()
await expect(selectionTag(page)).toContainText('Point un')
await expect(properties(page)).toBeVisible()
const placed = await geometryField(page, dict, 'cx').inputValue()
expect(Math.abs(Number(placed) - 300)).toBeLessThan(1)
@@ -110,7 +112,7 @@ test.describe('editor annotations (A3)', () => {
.click()
await fillCreation(page, { fr: 'Zone une', en: 'Zone one' })
await createFromPanel(page)
await expect(list(page).getByText('Zone une')).toBeVisible()
await expect(selectionTag(page)).toContainText('Zone une')
// A link to the detail view: the same tracing, the opened view chosen.
await tool(page, 'link').click()
@@ -125,7 +127,7 @@ test.describe('editor annotations (A3)', () => {
.click()
await fillCreation(page, { fr: 'Accès un', en: 'Access one' }, 'detail-a')
await createFromPanel(page)
await expect(list(page).getByText('Accès un')).toBeVisible()
await expect(selectionTag(page)).toContainText('Accès un')
await expect(
page.getByRole('button', {
name: dict['editor.annotations.undo'],
@@ -134,9 +136,7 @@ test.describe('editor annotations (A3)', () => {
).toBeEnabled()
// A numeric edit of the point, then undo and redo.
await list(page)
.getByRole('button', { name: /Point un/ })
.click()
await pickAnnotation(page, dict, /Point un/)
const cx = geometryField(page, dict, 'cx')
await cx.fill('420')
await cx.press('Enter')
@@ -234,7 +234,7 @@ test.describe('editor annotations (A3)', () => {
.focus()
await page.keyboard.press('Enter')
await expect(creation(page)).toHaveCount(0)
await expect(list(page).getByText('Clavier')).toBeVisible()
await expect(selectionTag(page)).toContainText('Clavier')
await expect(geometryField(page, dict, 'cx')).toHaveValue('250')
const cy = geometryField(page, dict, 'cy')
@@ -252,7 +252,7 @@ test.describe('editor annotations (A3)', () => {
.getByRole('button', { name: dict['editor.annotations.create'] })
.focus()
await page.keyboard.press('Enter')
await expect(list(page).getByText('Zone clavier')).toBeVisible()
await expect(selectionTag(page)).toContainText('Zone clavier')
const vertexX = page.getByLabel(
dict['editor.annotations.geometry.vertex_x'].replace('{n}', '1'),
)
+9 -13
View File
@@ -10,9 +10,11 @@ import {
geometryField,
openEditor,
openSection,
pickAnnotation,
pointOf,
saveDraft,
seedDraft,
selectionTag,
selectTab,
serverDocument,
shapeWith,
@@ -30,8 +32,6 @@ const dict = fr
const isPhone = (info: TestInfo) => info.project.name === 'chromium-375'
const creation = (page: Page) => page.getByTestId('annotation-creation')
const notice = (page: Page) => page.getByTestId('correction-notice')
const list = (page: Page) =>
page.getByRole('list', { name: dict['editor.annotations.list'] })
const tool = (page: Page, id: string) =>
page.getByRole('button', {
@@ -93,7 +93,7 @@ test.describe('editor geometry (adversarial)', () => {
await expect(notice(page)).toBeVisible()
await expect(page.getByTestId('overlay-click-cross')).toBeAttached()
const shown = await proposed(page)
await expect(list(page)).toHaveCount(0)
await expect(selectionTag(page)).toHaveCount(0) // an insertion selects it
// Cancelled: the notice goes, nothing was inserted.
await notice(page)
@@ -102,7 +102,7 @@ test.describe('editor geometry (adversarial)', () => {
})
.click()
await expect(notice(page)).toHaveCount(0)
await expect(list(page)).toHaveCount(0)
await expect(selectionTag(page)).toHaveCount(0) // an insertion selects it
// Confirmed: the same attempt again, the corrected position inserted.
await creation(page)
@@ -114,7 +114,7 @@ test.describe('editor geometry (adversarial)', () => {
.getByRole('button', { name: dict['editor.annotations.correction_use'] })
.click()
await expect(creation(page)).toHaveCount(0)
await expect(list(page).getByText('Bord')).toBeVisible()
await expect(selectionTag(page)).toContainText('Bord')
await expect(geometryField(page, dict, 'cx')).toHaveValue(shown.x)
await expect(geometryField(page, dict, 'cy')).toHaveValue(shown.y)
})
@@ -143,7 +143,7 @@ test.describe('editor geometry (adversarial)', () => {
})
.click()
await expect(notice(page)).toHaveCount(0)
await expect(list(page)).toHaveCount(0)
await expect(selectionTag(page)).toHaveCount(0) // an insertion selects it
// Then confirmed: the same attempt again inserts the corrected position.
await creation(page)
.getByRole('button', { name: dict['editor.annotations.create'] })
@@ -152,7 +152,7 @@ test.describe('editor geometry (adversarial)', () => {
await notice(page)
.getByRole('button', { name: dict['editor.annotations.correction_use'] })
.click()
await expect(list(page).getByText('Bord détail')).toBeVisible()
await expect(selectionTag(page)).toContainText('Bord détail')
})
test('a point inherited out of its frame is repaired through the geometry group', async ({
@@ -165,9 +165,7 @@ test.describe('editor geometry (adversarial)', () => {
)
requests.forbid(actor.account.email, actor.account.password)
await viewChip(page, 'Détail A').click()
await list(page)
.getByRole('button', { name: /Hors cadre/ })
.click()
await pickAnnotation(page, dict, /Hors cadre/)
const issues = page.getByTestId('annotation-geometry-issues')
await expect(issues).toBeVisible()
const verification = page.getByRole('tab', {
@@ -454,9 +452,7 @@ test.describe('editor touch path (real browser)', () => {
// A movable selection needs the touch itself: the browser reads touch-action at
// touchstart, so a drag of the selected marker must not be left to the pan.
await list(page)
.getByRole('button', { name: /Tactile/ })
.click()
await pickAnnotation(page, dict, /Tactile/)
await expect.poll(touchAction).toBe('none')
const cx = geometryField(page, dict, 'cx')
await expect(cx).toHaveValue('500')
+6 -8
View File
@@ -5,7 +5,8 @@ import { stepUpAdmin } from '../support/admin'
import { expect, expectAccessible, test } from '../support/browser'
import { dropLateReplays, routeToSandbox } from '../support/sandbox'
import {
annotationList,
pickAnnotation,
selectionTag,
clickDrawing,
createFromPanel,
creationPanel,
@@ -175,20 +176,19 @@ const MODIFIED = { point: 3, vertex: 4 }
/** Applies (not only refuses) changes to a point, a zone and a link; read back at the save. */
async function modifyAnnotations(page: Page) {
const list = annotationList(page, dict)
await list.getByRole('button', { name: /Point essai/ }).click()
await pickAnnotation(page, dict, /Point essai/)
const cx = geometryField(page, dict, 'cx')
const before = Number(await cx.inputValue())
await commitText(cx, String(before + MODIFIED.point))
await expect(cx).toHaveValue(String(before + MODIFIED.point))
await list.getByRole('button', { name: /Zone dessinée/ }).click()
await pickAnnotation(page, dict, /Zone dessinée/)
const vertex = page.getByLabel(
dict['editor.annotations.geometry.vertex_x'].replace('{n}', '1'),
)
const start = Number(await vertex.inputValue())
await commitText(vertex, String(start + MODIFIED.vertex))
await expect(vertex).toHaveValue(String(start + MODIFIED.vertex))
await list.getByRole('button', { name: /Accès essai/ }).click()
await pickAnnotation(page, dict, /Accès essai/)
await commitText(page.locator('#annotation-name-fr'), 'Accès modifié')
await page.locator('#annotation-laterality').selectOption('bilateral')
await expect(page.locator('#annotation-name-fr')).toHaveValue('Accès modifié')
@@ -204,9 +204,7 @@ async function repairGeometry(page: Page) {
await clickDrawing(page, 1, 1)
await fillCreation(page, dict, { fr: 'Point de bord', en: 'Edge point' })
await createFromPanel(page, dict)
await expect(
annotationList(page, dict).getByText('Point de bord'),
).toBeVisible()
await expect(selectionTag(page)).toContainText('Point de bord')
const cx = geometryField(page, dict, 'cx')
await cx.fill('9999')
await cx.press('Enter')
+2 -4
View File
@@ -9,6 +9,7 @@ import {
openEditor,
openReferences,
openSection,
pickAnnotation,
pointOf,
saveDraft,
seedDraft,
@@ -289,10 +290,7 @@ test.describe('editor structures (A4)', () => {
// The point goes first; the zone then deletes with its descendants named.
await showDrawing(page, dict)
await page
.getByRole('list', { name: dict['editor.annotations.list'] })
.getByRole('button', { name: /Point lié/ })
.click()
await pickAnnotation(page, dict, /Point lié/)
await page
.getByTestId('annotation-properties')
.getByRole('button', { name: dict['editor.action.delete'] })