feat(signage): look rows that wrap, one colour field with opacity, badges' text, several widgets per stack part, pages up to 2200 px (owner review 4)

- Menu text look: each field names its part ("Headings size"), rows wrap in aligned columns on
  alternating bands; names align left / right; line and letter spacing as lists (Auto default);
  each field changes only itself (followers frozen before the other changes); badge colour +
  badge text colour (auto: readableOn); "Reset the look" with a question.
- ColourField everywhere in signage: a Popover panel (new @xenia/ui Popover, portal, kept in the
  window) with 12 presets, picker, opacity (#rrggbbaa) and typed code; HEX accepts 8 digits.
- Stacks: Cell.widgets (a stored `widget` still reads), several widgets per part laid across the
  stack's direction; extras by path stack.part.place; Add a widget adds, each removable / ordered.
- Page rule: --x-page-max is 2200px (no longer follows the window height).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 12:53:14 +02:00
co-authored by Claude Opus 5.5
parent e8c8ec825e
commit aaa0914778
22 changed files with 663 additions and 281 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
// The page rule (2026-11-20): every manager page is a <Page> that scrolls on its own, fills a
// 1080p screen and stays at 16:9 width, centred, on an ultrawide. For each page, at 1920×1080
// 1080p screen and stays at 2200 px (never narrowed by a short window), centred, on an ultrawide. For each page, at 1920×1080
// and 3440×1440: the page body exists, fills the content area (1080p) or is capped and centred
// (ultrawide), and the page scrolls when its content is taller than the screen. Screenshots of a
// few key screens (and the open dropdowns / the day summary) go to out/manager-layout/.
@@ -37,7 +37,7 @@ const vite = spawn('npx', ['vite', '--port', '5191', '--strictPort'], {
stdio: ['ignore', log, log], env: { ...process.env, XENIA_BACKEND: backend.url },
})
const browser = await chromium.launch(BROWSER_CHANNEL ? { channel: BROWSER_CHANNEL } : {})
const r = reporter('manager layout (the page rule): fills 1080p, 16:9 and centred on ultrawides, scrolls')
const r = reporter('manager layout (the page rule): fills 1080p, 2200 px and centred on ultrawides, scrolls')
const name = p => p.replace(/[/?=]/g, '-')
try {
await waitHttp(APP)
@@ -71,7 +71,7 @@ try {
const a = { left: s.left, right: s.left + scroll.clientWidth, width: scroll.clientWidth }
// a form page (settings) is centred at its own width
const form = body.classList.contains('x-page__body--form')
return { form, left: b.left - a.left, right: a.right - b.right, width: b.width, area: a.width, cap: Math.max(1280, innerHeight * 16 / 9),
return { form, left: b.left - a.left, right: a.right - b.right, width: b.width, area: a.width, cap: 2200,
scrolls: scroll.scrollHeight <= scroll.clientHeight + 1 || getComputedStyle(scroll).overflowY === 'auto' }
})
if (!m) { bad.push(`${p}: no <Page>`); continue }
@@ -80,7 +80,7 @@ try {
if (!centred || !fills || !m.scrolls) bad.push(`${p}: ${JSON.stringify(m)}`)
if (SHOTS.includes(p)) await page.screenshot({ path: path.join(DIR, `${name(p)}-${screen.id}.png`) })
}
r.check(`${screen.id}: every page fills its area up to 16:9, centred, and scrolls`, bad.length === 0, bad.join('\n'))
r.check(`${screen.id}: every page fills its area up to 2200 px, centred, and scrolls`, bad.length === 0, bad.join('\n'))
// Products (2026-11-21): the page doesn't scroll, its two panes do, each on its own
await page.goto(`${APP}/management/products`)
+36 -2
View File
@@ -318,8 +318,8 @@ try {
await waitFor(async () => (await textCard.getByTestId('signage-widget-position').textContent()).includes('Custom'), 4000, 200) === true)
await mgr.getByTestId('signage-widget-add-hstack').click()
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-cell-editor').first().getByTestId('signage-stack-add').click()
await mgr.getByTestId('signage-stack-add-clock').click()
// 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()
@@ -338,6 +338,17 @@ try {
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)
// owner review 4: a second widget in the same part, then one removed
await stackCard.getByTestId('signage-stack-cell-editor').nth(1).getByTestId('signage-stack-add').click()
await mgr.getByTestId('signage-stack-add-text').click()
await stackCard.getByTestId('signage-stack-cell-editor').nth(1).locator('[data-testid="signage-stack-part-widget"][data-kind="text"]').getByTestId('signage-widget-own-text').fill('Two in one')
const part2 = () => mgr.getByTestId('signage-preview').getByTestId('signage-stack-cell').nth(1)
r.check('2026-11-21 (4): a part holds two widgets (a date and a text), one over the other',
await waitFor(async () => (await part2().getByTestId('signage-stack-place').count()) === 2 && (await part2().getByTestId('signage-w-text').count()) === 1
&& (await part2().getByTestId('signage-w-date').count()) === 1, 6000, 300) === true)
await stackCard.getByTestId('signage-stack-cell-editor').nth(1).locator('[data-testid="signage-stack-part-widget"][data-kind="date"]').getByTestId('signage-stack-part-remove').click()
r.check('2026-11-21 (4): …and one of them removed',
await waitFor(async () => (await part2().getByTestId('signage-stack-place').count()) === 1 && (await part2().getByTestId('signage-w-date').count()) === 0, 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')
@@ -349,6 +360,29 @@ try {
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()
// owner review 4: each look field changes only itself; the colour panel stays inside the window
r.check('2026-11-21 (4): names align left or right only', (await mgr.getByTestId('signage-look-item_style-align-center').count()) === 0)
const setRange = (loc, v) => loc.evaluate((el, x) => {
Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value').set.call(el, String(x))
el.dispatchEvent(new Event('input', { bubbles: true }))
}, v)
const headSize = async () => mgr.getByTestId('signage-look-heading_style-size').inputValue()
const before = await headSize()
await setRange(mgr.getByTestId('signage-look-item_style-size'), 180)
const headColour = async () => (await mgr.getByTestId('signage-look-heading_style-colour-open').textContent()).trim()
const colourBefore = await headColour()
await mgr.getByTestId('signage-accent-open').click()
const panel = await mgr.getByTestId('signage-accent-panel').boundingBox()
const vw = await mgr.evaluate(() => innerWidth)
r.check('2026-11-21 (4): the colour panel opens inside the window (12 ready colours)',
panel && panel.x >= 0 && panel.x + panel.width <= vw && (await mgr.getByTestId('signage-accent-preset').count()) === 12, JSON.stringify(panel))
await mgr.getByTestId('signage-accent-preset').nth(10).click()
r.check('2026-11-21 (4): the names size and the badges colour leave the headings as they were',
(await headSize()) === before && (await headColour()) === colourBefore, `${before} → ${await headSize()}, ${colourBefore} → ${await headColour()}`)
await mgr.getByTestId('signage-look-dots-colour-open').click()
await setRange(mgr.getByTestId('signage-look-dots-colour-opacity'), 50)
r.check('2026-11-21 (4): a see-through colour (#rrggbbaa)', /^#[0-9a-f]{8}$/.test((await mgr.getByTestId('signage-look-dots-colour-open').textContent()).trim()))
await mgr.keyboard.press('Escape')
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)