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
+24
View File
@@ -168,3 +168,27 @@ test('stacks: even shares and a part resized against its neighbour; hidden produ
const pages = boardPages({ content: { columns: 1 }, menu: { groups } }, 0, 1920, 1080)
assert.deepEqual(pages.flat().flatMap(g => g.items.map(i => i.id)), [2])
})
test("a menu's look part by part: sizes against the board's text, colours fall back to text / accent (2026-11-21)", async () => {
const { menuLook, priceChars } = await import('../src/logic.js')
const plain = menuLook({ text_size: 100, text_colour: '#ffffff', accent_colour: '#f59e0b' })
assert.equal(plain.heading.fontSize, '1.15em')
assert.equal(plain.heading.color, '#f59e0b')
assert.equal(plain.item.color, '#ffffff')
assert.equal(plain.price.fontWeight, 700)
assert.equal(plain.lineHeight, 1.25)
assert.equal(plain.itemAlign, 'left')
assert.equal(plain.priceAlign, 'right')
const own = menuLook({ text_size: 200, heading_style: { size: 300, colour: '#ff0000', italic: true, align: 'center' }, price_style: { bold: false },
dot_style: { style: 'dashed', size: 200, colour: '#00ff00' }, line_height: 1.5, photo_shape: 'round', photo_size: 200, item_style: { size: 250 } })
assert.equal(own.heading.fontSize, '1.725em')
assert.equal(own.heading.fontStyle, 'italic')
assert.equal(own.heading.textAlign, 'center')
assert.equal(own.price.fontWeight, 400)
assert.equal(own.dots.borderBottom, '0.16em dashed #00ff00')
assert.equal(own.photo.radius, '50%')
assert.equal(own.photo.size, '4.4em')
assert.equal(own.rowScale, 1.5 * 1.2)
assert.deepEqual(menuLook({ dot_style: { style: 'none' } }).dots, { borderBottom: 'none' })
assert.equal(priceChars([{ items: [{ price: 4.5 }, { price: 12 }, { price: null }] }], p => `€${p.toFixed(2)}`), 6)
})