feat(signage): stacks, menu and text widgets, widget order (owner review 2)
- Stacks: horizontal / vertical, 2-6 parts with % shares; each part shows a widget, a stack one level deep, or a whole Slides-library slide - Menu widget (a board's list in its box), text widget, weather for tomorrow / the day after and in picture / degrees / both styles - Widgets' order (arrows, drag with a drop line), drawn in list order; arrow keys move the picked widget from its card too - Server: extras by widget path (QR links, menus, embedded slides), POST /preview/slide, resolve(keep_hidden) so hidden products stay greyed in the editor's list; screens told when an embedded slide changes - Editor rows tidied: framed sliders, colours as fields, text look on one row, Switch boxed toggles from its whole frame Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+28
-1
@@ -299,9 +299,36 @@ try {
|
||||
mc.select === 'custom' && mc.category_ids?.includes(catA.id) && mc.category_ids?.includes(catB.id) && mc.product_ids?.includes(extra.id)
|
||||
&& mc.exclude_ids?.includes(hiddenId) && mc.category_order?.[0] === catB.id && mc.badges?.[String(badgeId)] === 'offer'
|
||||
&& (mc.widgets || []).some(w => w.kind === 'clock')
|
||||
&& !menuSlide.menu.groups.flatMap(g => g.items).some(i => i.id === hiddenId) && menuSlide.menu.groups[0].category?.id === catB.id,
|
||||
&& !menuSlide.menu.groups.flatMap(g => g.items).some(i => i.id === hiddenId && !i.hidden) && menuSlide.menu.groups[0].category?.id === catB.id,
|
||||
JSON.stringify({ select: mc.select, cats: mc.category_ids, prods: mc.product_ids, ex: mc.exclude_ids, order: mc.category_order, badges: mc.badges }))
|
||||
await mgr.screenshot({ path: path.join(OUT, 'signage-menu-editor.png') })
|
||||
// ── owner review 2 (2026-11-21): a hidden product stays in the list, greyed; widgets ordered, moved by the keys from their card; stacks ──
|
||||
r.check('2026-11-21 (2): a product hidden from the board stays in the list of the editor, marked hidden',
|
||||
await mgr.locator(`[data-testid="signage-menu-row"][data-id="${hiddenId}"]`).getAttribute('data-hidden') === 'true')
|
||||
await mgr.getByTestId('signage-widget-add-text').click()
|
||||
await mgr.locator('[data-testid="signage-widget"][data-kind="text"]').getByTestId('signage-widget-own-text').fill('Happy hour')
|
||||
await mgr.locator('[data-testid="signage-widget"][data-kind="text"]').getByTestId('signage-widget-up').click()
|
||||
const kinds = await mgr.getByTestId('signage-widget').evaluateAll(els => els.map(e => e.dataset.kind))
|
||||
r.check('2026-11-21 (2): a text widget, moved up the list with its arrow', kinds.indexOf('text') < kinds.lastIndexOf('clock'), JSON.stringify(kinds))
|
||||
r.check('2026-11-21 (2): …shown on the preview', await waitFor(async () => (await mgr.getByTestId('signage-preview').getByTestId('signage-w-text').count()) > 0, 5000, 200) === true)
|
||||
const textCard = mgr.locator('[data-testid="signage-widget"][data-kind="text"]')
|
||||
await textCard.locator('span', { hasText: 'Text' }).first().click()
|
||||
await mgr.keyboard.press('ArrowRight')
|
||||
r.check('2026-11-21 (2): picked on its card, the arrow keys move the widget (Custom)',
|
||||
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-share').first().fill('25')
|
||||
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()
|
||||
await textCard.getByTestId('signage-widget-remove').click()
|
||||
// ── 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)
|
||||
|
||||
Reference in New Issue
Block a user