feat(signage): slides keep their shape on any screen, custom shapes (21:9, 16:10…), Calibrate the picture edge by edge with presets
A slide is drawn at its playlist's shape, as large as fits the screen's picture, the bands in its own background (or stretched, the screen's choice). Playlists and library slides may have a shape of their own (aspect, Alembic 0045). Signage -> Screens -> Calibrate the picture: the TV outlines its area with arrows and its size, each edge moves pixel by pixel or a preset centres a shape; the TV follows live (signage.calibrate) and reports its window (POST /screen/viewport). Plan 6R.13, F-110. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+54
-4
@@ -190,7 +190,8 @@ try {
|
||||
await shown(tall, 'pairing-code', 20_000)
|
||||
const code2 = await tall.getByTestId('pairing-code').getAttribute('data-code')
|
||||
const dev2 = await api('POST', '/api/devices', { token: boss, body: { code: code2, app_key: 'signage', name: 'Tall TV' } })
|
||||
await api('PUT', `/api/signage/screens/${dev2.id}`, { token: boss, body: { playlist_id: board.id, orientation: 'portrait' } })
|
||||
// (a landscape board keeps its shape on a portrait TV unless the screen stretches it: 6R.13)
|
||||
await api('PUT', `/api/signage/screens/${dev2.id}`, { token: boss, body: { playlist_id: board.id, orientation: 'portrait', fit: 'stretch' } })
|
||||
await waitFor(async () => (await tall.getByTestId('signage-slide').getAttribute('data-kind').catch(() => null)) === 'menu', 20_000, 300)
|
||||
const pagesTall = Number(await tall.getByTestId('signage-menu').getAttribute('data-pages'))
|
||||
r.check('5.5b: on a portrait TV the same board needs fewer pages', pagesTall < pagesWide, `${pagesTall} < ${pagesWide}`)
|
||||
@@ -365,8 +366,9 @@ try {
|
||||
const place = part2().getByTestId('signage-stack-place').first()
|
||||
const css = await place.evaluate(el => ({ align: getComputedStyle(el).alignItems, italic: getComputedStyle(el.querySelector('[data-testid="signage-w-text"]')).fontStyle,
|
||||
colour: getComputedStyle(el.querySelector('[data-widget]')).color }))
|
||||
return css.align === 'flex-end' && css.italic === 'italic' && css.colour === 'rgb(239, 68, 68)'
|
||||
}, 6000, 300) === true)
|
||||
return ['flex-end', 'flow-end'].includes(css.align) && css.italic === 'italic' && css.colour === 'rgb(239, 68, 68)' ? true : null
|
||||
}, 6000, 300) === true, JSON.stringify(await part2().getByTestId('signage-stack-place').first().evaluate(el => ({ align: getComputedStyle(el).alignItems,
|
||||
italic: getComputedStyle(el.querySelector('[data-testid="signage-w-text"]')).fontStyle, colour: getComputedStyle(el.querySelector('[data-widget]')).color })).catch(e => String(e))))
|
||||
// Delete removes the picked widget (picked on its card)
|
||||
await stackCard.locator('span', { hasText: 'Horizontal stack' }).first().click()
|
||||
await mgr.keyboard.press('Delete')
|
||||
@@ -528,6 +530,53 @@ try {
|
||||
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)))
|
||||
// ── 6R.13: slides keep their shape on a 21:9 TV; stretch; a playlist of its own shape; calibrating ──
|
||||
await choose(card, 'signage-screen-playlist', 'Window')
|
||||
await waitFor(async () => (await tv.getByTestId('app-signage').getAttribute('data-playlist')) === String(pl.id), 15_000, 300)
|
||||
await tv.setViewportSize({ width: 1260, height: 540 })
|
||||
const boxNow = () => tv.getByTestId('signage-shape').getAttribute('data-box', { timeout: 3000 }).catch(() => null)
|
||||
r.check('6R.13: a 16:9 slide on a 21:9 TV keeps its shape, centred, the bands in its own background',
|
||||
await waitFor(async () => (await boxNow()) === '960x540', 10_000, 200) === true && await tv.getByTestId('signage-backdrop').count() > 0, String(await boxNow()))
|
||||
await tv.screenshot({ path: path.join(OUT, 'signage-21x9-bands.png') })
|
||||
await choose(card, 'signage-screen-fit', 'Stretch to fill')
|
||||
r.check('6R.13: …or stretched over the whole picture (the screen\'s choice)', await waitFor(async () => (await boxNow()) === '1260x540', 10_000, 200) === true)
|
||||
await choose(card, 'signage-screen-fit', 'Keep their shape (bands)')
|
||||
await waitFor(async () => (await boxNow()) === '960x540', 10_000, 200)
|
||||
// the playlist built for 21:9 (its own shape, picked in the editor) fills it
|
||||
await mgr.getByTestId('signage-tab-playlists').click()
|
||||
await mgr.locator('[data-testid="signage-playlist-item"][data-name="Window"]').click()
|
||||
await mgr.getByTestId('signage-orientation-custom').click()
|
||||
await mgr.getByTestId('signage-shape-panel').locator('[data-shape="21:9"]').click()
|
||||
const wide = await waitFor(async () => ((await api('GET', `/api/signage/playlists/${pl.id}`, { token: boss })).aspect === '21:9' ? true : null), 8000, 300)
|
||||
r.check('6R.13: a playlist given its own shape (21:9) in the editor', wide === true
|
||||
&& (await mgr.getByTestId('signage-orientation').getAttribute('data-shape')) === '21:9')
|
||||
r.check('6R.13: …the TV draws it over the whole 21:9 picture, no bands',
|
||||
await waitFor(async () => (await boxNow()) === '1260x540', 10_000, 200) === true && await tv.getByTestId('signage-backdrop').count() === 0, String(await boxNow()))
|
||||
await api('PUT', `/api/signage/playlists/${pl.id}`, { token: boss, body: { orientation: 'landscape' } })
|
||||
// calibrating: the TV outlines its picture; a preset and a pixel move reach it at once
|
||||
await mgr.getByTestId('signage-tab-screens').click()
|
||||
await card.getByTestId('signage-screen-calibrate').click()
|
||||
const outlined = await shown(tv, 'signage-calibrate', 10_000)
|
||||
const outline = outlined ? await tv.getByTestId('signage-calibrate').getAttribute('data-size') : null
|
||||
r.check('6R.13: Calibrate the picture: the TV outlines it with arrows and its size', outline === '1260x540', `${outlined} ${outline}`)
|
||||
r.check('6R.13: …the dialog knows the TV\'s window (it reported 1260 × 540)',
|
||||
await waitFor(async () => (await mgr.getByTestId('signage-calibrate-window').textContent()).includes('1260 × 540'), 8000, 300) === true)
|
||||
await mgr.getByTestId('signage-calibrate-dialog').locator('[data-preset="16:9"]').click()
|
||||
const areaNow = () => tv.getByTestId('signage-area').getAttribute('data-area')
|
||||
r.check('6R.13: the 16:9 preset leaves the largest 16:9 box in the middle of the TV', await waitFor(async () => (await areaNow()) === '150,0,960,540', 8000, 200) === true, String(await areaNow()))
|
||||
const plus = mgr.getByTestId('signage-calibrate-top').locator('xpath=..').locator('button').last()
|
||||
await plus.click(); await plus.click()
|
||||
r.check('6R.13: …the top edge moved in 2 px with + (the TV follows)', await waitFor(async () => (await areaNow()) === '150,2,960,538', 8000, 200) === true, String(await areaNow()))
|
||||
await mgr.screenshot({ path: path.join(OUT, 'signage-calibrate.png') })
|
||||
await tv.screenshot({ path: path.join(OUT, 'signage-calibrate-tv.png') })
|
||||
await mgr.getByTestId('signage-calibrate-done').click()
|
||||
r.check('6R.13: Done: the outline goes away, the calibrated picture stays',
|
||||
await tv.getByTestId('signage-calibrate').waitFor({ state: 'detached', timeout: 10_000 }).then(() => true).catch(() => false) && (await areaNow()) === '150,2,960,538')
|
||||
const saved = (await api('GET', '/api/signage/screens', { token: boss })).find(x => x.id === dev.id)
|
||||
r.check('6R.13: the insets are the screen\'s settings', JSON.stringify(saved.area) === JSON.stringify({ left: 150, top: 2, right: 150, bottom: 0 }), JSON.stringify(saved.area))
|
||||
await api('PUT', `/api/signage/screens/${dev.id}`, { token: boss, body: { area_left: 0, area_top: 0, area_right: 0, area_bottom: 0 } })
|
||||
await tv.setViewportSize({ width: 1280, height: 720 })
|
||||
|
||||
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)
|
||||
@@ -535,7 +584,8 @@ try {
|
||||
// ── the server stops: the TV keeps playing ────────────────────────────────
|
||||
await backend.stop()
|
||||
const offlineOrder = await watch(tv, 14_000)
|
||||
r.check('server stopped: the TV keeps playing its slides', new Set(offlineOrder).size >= 3, offlineOrder.join(' '))
|
||||
r.check('server stopped: the TV keeps playing its slides', new Set(offlineOrder).size >= 3,
|
||||
`${offlineOrder.join(' ')} pages=${await tv.getByTestId('signage-menu').getAttribute('data-pages', { timeout: 1000 }).catch(() => '?')}`)
|
||||
r.check('…with a small mark, never the banner over the slides', await shown(tv, 'offline-mark', 15_000) && await tv.getByTestId('offline-banner').count() === 0)
|
||||
const offImg = await waitFor(async () => (await kindNow(tv)) === 'image' ? tv.getByTestId('signage-image').evaluate(i => i.complete && i.naturalWidth) : null, 20_000, 200)
|
||||
r.check('…and the picture still shows', offImg > 0, String(offImg))
|
||||
|
||||
Reference in New Issue
Block a user