feat(signage): menu look part by part, board-only names, stack bar, Delete key (owner review 3)

- Menus (slides and widgets): headings / names / prices each with size,
  colour, font, bold / italic / underline and alignment; dots size, colour
  and style; line and letter spacing; photo size and shape (menuLook)
- Names aligned right end together, prices in a page-wide column
- Names for one board only (names, category_names) with a pencil on the
  board's list; the catalogue name stays for the waiters
- Fixed: menu lists inherited the page's fixed line height (big text
  overlapped); a menu slide's list grew past the screen (no 2nd column)
- Stacks: parts sized by dragging the lines on the bar; "Add a widget"
- Delete / Backspace removes the picked widget

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 10:51:03 +02:00
co-authored by Claude Opus 5.5
parent 1b993e4573
commit e8c8ec825e
16 changed files with 642 additions and 81 deletions
+28 -2
View File
@@ -320,15 +320,38 @@ try {
const stackCard = mgr.locator('[data-testid="signage-widget"][data-kind="stack"]')
await stackCard.getByTestId('signage-stack-shows').first().click()
await mgr.getByRole('option', { name: 'Clock', exact: true }).click()
await stackCard.getByTestId('signage-stack-share').first().fill('25')
// the parts sized by dragging the line between them on the bar (owner review 3)
const bar = await stackCard.getByTestId('signage-stack-bar').first().boundingBox()
const ln = await stackCard.getByTestId('signage-stack-line').first().boundingBox()
await mgr.mouse.move(ln.x + ln.width / 2, ln.y + ln.height / 2)
await mgr.mouse.down()
await mgr.mouse.move(bar.x + bar.width * 0.25, ln.y + ln.height / 2, { steps: 6 })
await mgr.mouse.up()
r.check('2026-11-21 (2): a horizontal stack: a clock in its first part, 25 / 75, on the preview',
await waitFor(async () => {
const cells = mgr.getByTestId('signage-preview').getByTestId('signage-stack-cell')
return (await cells.count()) === 2 && (await cells.first().getAttribute('data-share')) === '25'
&& (await cells.first().getByTestId('signage-w-clock').count()) === 1
}, 6000, 300) === true)
await stackCard.getByTestId('signage-widget-remove').click()
// "Add a widget" to the second part
await stackCard.getByTestId('signage-stack-cell-editor').nth(1).getByTestId('signage-stack-add').click()
await mgr.getByTestId('signage-stack-add-date').click()
r.check('2026-11-21 (3): "Add a widget" puts a date in the second part',
await waitFor(async () => (await mgr.getByTestId('signage-preview').getByTestId('signage-stack-cell').nth(1).getByTestId('signage-w-date').count()) === 1, 6000, 300) === true)
// Delete removes the picked widget (picked on its card)
await stackCard.locator('span', { hasText: 'Horizontal stack' }).first().click()
await mgr.keyboard.press('Delete')
r.check('2026-11-21 (3): Delete removes the picked widget', await waitFor(async () => (await mgr.locator('[data-testid="signage-widget"][data-kind="stack"]').count()) === 0, 4000, 200) === true)
await textCard.getByTestId('signage-widget-remove').click()
// this board's own name for a product; the names aligned right
await mgr.getByTestId('signage-item-name').first().hover()
await mgr.getByTestId('signage-item-name-edit').first().click()
await mgr.getByTestId('signage-item-name-input').fill('Signature dish')
await mgr.getByTestId('signage-item-name-input').press('Enter')
await mgr.getByTestId('signage-look-item_style-align-right').click()
r.check('2026-11-21 (3): a product named for this board only shows on the preview, the catalogue name under it in the list',
await waitFor(async () => (await mgr.getByTestId('signage-preview').getByText('Signature dish').count()) > 0
&& (await mgr.getByTestId('signage-menu-board').getByText(/Catalogue:/).count()) > 0, 6000, 300) === true)
// ── 2026-11-21: a widget moved and sized on the preview; the slide kept in the Slides library ──
await mgr.getByTestId('signage-preview-box').scrollIntoViewIfNeeded()
await sleep(300)
@@ -349,6 +372,9 @@ try {
await sleep(900)
const moved = (await api('GET', `/api/signage/playlists/${op.id}`, { token: boss })).slides.find(x => x.kind === 'menu').content.widgets.find(w => w.position === 'custom')
r.check('2026-11-21: …saved with its own box', moved?.position === 'custom' && moved.size === 'custom' && moved.box?.w > 0 && moved.box?.h > 0, JSON.stringify(moved))
const mc3 = (await api('GET', `/api/signage/playlists/${op.id}`, { token: boss })).slides.find(x => x.kind === 'menu').content
r.check('2026-11-21 (3): saved with a name for this board and the names aligned right',
Object.values(mc3.names || {}).includes('Signature dish') && mc3.item_style?.align === 'right', JSON.stringify({ names: mc3.names, item: mc3.item_style }))
await mgr.getByTestId('signage-keep-slide').click()
await mgr.getByTestId('signage-keep-name').fill('Board to keep')
await mgr.getByTestId('signage-keep-confirm').click()