feat(signage): Slides library, widgets placed on the preview, blank slides, slide editor rework
- Slides library (Alembic 0044, /api/signage/library): slides kept with a name and a
description, added to playlists as copies ("Add a slide" → Your slides, "Keep in Slides"),
or shown alone as a screen's default (device config `slide`, played as "slide:<id>",
also as a schedule's fallback). Signage → Slides: gallery + a two-pane editor.
- Widgets moved and sized by hand on the preview (WidgetCanvas: handles, snapping, arrow
keys): position/size "custom" with a box the TV draws the same; alignment per widget.
- Blank slides (background + widgets); menu boards narrower and placed left/centre/right.
- Slide editor reworked: name | show, transition effect | seconds; sections; text look on
one row with ready colours; one card per widget, settings on one row.
- Questions inside the page (@xenia/ui ConfirmDialog/useConfirm), Switch boxed, Segmented
fill; the timeline's drop line; schedule lines run on weekdays or smart days, not both;
the playlist editor stays within 1080p with a long timeline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+45
-1
@@ -265,7 +265,8 @@ try {
|
||||
await mgr.getByTestId('signage-add-slide').click()
|
||||
await mgr.getByTestId('signage-template-menuBoard').click()
|
||||
await mgr.getByTestId('signage-menu-editor').waitFor({ timeout: 10_000 })
|
||||
await mgr.getByTestId('signage-menu-select').selectOption('custom')
|
||||
await mgr.getByTestId('signage-menu-select').click()
|
||||
await mgr.getByRole('option', { name: 'Chosen categories and products' }).click()
|
||||
await mgr.locator(`[data-testid="signage-menu-category"][data-name="${catA.name}"]`).click()
|
||||
await mgr.locator(`[data-testid="signage-menu-category"][data-name="${catB.name}"]`).click()
|
||||
await mgr.getByTestId('signage-menu-search').fill(extra.name.slice(0, 4))
|
||||
@@ -301,6 +302,43 @@ try {
|
||||
&& !menuSlide.menu.groups.flatMap(g => g.items).some(i => i.id === hiddenId) && 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') })
|
||||
// ── 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)
|
||||
const handle = mgr.getByTestId('signage-canvas-widget').last()
|
||||
const hb = await handle.boundingBox()
|
||||
await mgr.mouse.move(hb.x + hb.width / 2, hb.y + hb.height / 2)
|
||||
await mgr.mouse.down()
|
||||
await mgr.mouse.move(hb.x - 200, hb.y + 120, { steps: 6 })
|
||||
await mgr.mouse.up()
|
||||
const se = await mgr.getByTestId('signage-handle-se').boundingBox()
|
||||
await mgr.mouse.move(se.x + 7, se.y + 7)
|
||||
await mgr.mouse.down()
|
||||
await mgr.mouse.move(se.x + 60, se.y + 30, { steps: 5 })
|
||||
await mgr.mouse.up()
|
||||
r.check('2026-11-21: a widget dragged on the preview reads "Custom" in its card',
|
||||
(await mgr.locator('[data-testid="signage-widget"][data-selected="true"]').getByTestId('signage-widget-position').textContent()).includes('Custom'))
|
||||
await mgr.getByTestId('signage-slide-save').click()
|
||||
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))
|
||||
await mgr.getByTestId('signage-keep-slide').click()
|
||||
await mgr.getByTestId('signage-keep-name').fill('Board to keep')
|
||||
await mgr.getByTestId('signage-keep-confirm').click()
|
||||
await sleep(800)
|
||||
const kept = (await api('GET', '/api/signage/library', { token: boss })).slides.find(x => x.name === 'Board to keep')
|
||||
r.check('2026-11-21: a playlist\'s slide kept in the Slides library', kept?.kind === 'menu' && kept.content.widgets.some(w => w.position === 'custom'))
|
||||
await mgr.getByTestId('signage-add-slide').click()
|
||||
await mgr.locator('[data-testid="signage-add-saved"][data-name="Board to keep"]').click()
|
||||
await sleep(900)
|
||||
r.check('2026-11-21: …and added from "Your slides" to the playlist (a copy)',
|
||||
(await api('GET', `/api/signage/playlists/${op.id}`, { token: boss })).slides.filter(x => x.kind === 'menu').length === 2)
|
||||
// removing a slide asks inside the page (not the browser)
|
||||
await mgr.getByTestId('signage-slide-card').last().getByTestId('signage-slide-delete').click()
|
||||
await mgr.getByTestId('signage-slide-delete-confirm-ok').click()
|
||||
await sleep(900)
|
||||
r.check('2026-11-21: a slide removed after the page\'s own question',
|
||||
(await api('GET', `/api/signage/playlists/${op.id}`, { token: boss })).slides.filter(x => x.kind === 'menu').length === 1)
|
||||
// ── 5.6c: screens, schedules, the message of the day ─────────────────────
|
||||
await api('PUT', `/api/signage/screens/${dev.id}`, { token: boss, body: { playlist_id: pl.id } })
|
||||
await mgr.getByTestId('signage-tab-settings').click()
|
||||
@@ -353,6 +391,12 @@ try {
|
||||
await mgr.getByTestId('signage-tab-schedules').click()
|
||||
await mgr.screenshot({ path: path.join(OUT, 'signage-schedules.png'), fullPage: true })
|
||||
await api('PUT', '/api/signage/schedules', { token: boss, body: { lines: [] } })
|
||||
// a library slide as the screen's default (2026-11-21)
|
||||
await mgr.getByTestId('signage-tab-screens').click()
|
||||
await card.waitFor({ timeout: 10_000 })
|
||||
await choose(card, 'signage-screen-playlist', 'Board to keep')
|
||||
r.check('2026-11-21: Screens: a library slide as the default plays alone on the TV',
|
||||
!!(await waitFor(async () => (await tv.getByTestId('app-signage').getAttribute('data-playlist')) === `slide:${kept.id}`, 15_000, 300)))
|
||||
await mgr.context().close()
|
||||
await api('PUT', `/api/signage/screens/${dev.id}`, { token: boss, body: { playlist_id: pl.id } })
|
||||
await waitFor(async () => (await tv.getByTestId('app-signage').getAttribute('data-playlist')) === String(pl.id), 15_000, 300)
|
||||
|
||||
Reference in New Issue
Block a user