feat(signage): More settings for every widget (opacity, rotation, shadow, border, entrance animation, a logo's fit; text weight, highlight, typing out; date and clock formats; a logo in a QR code)

Folded under each widget card like Text and colours. The TV puts them on the element
that places the widget (fx), animations on translate / scale so its place's transform
stays (an older TV only fades); an entrance animates to the widget's own opacity.
Calibrating: a strict-mode remount no longer ends it. Plan 6R.17, F-115.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 15:01:42 +02:00
co-authored by Claude Opus 5.5
parent 1eb7e5e3a9
commit 673113aff7
11 changed files with 444 additions and 26 deletions
+10 -2
View File
@@ -594,11 +594,13 @@ try {
const wl = await api('POST', '/api/signage/playlists', { token: boss, body: { name: 'New widgets', orientation: 'landscape' } })
await api('POST', `/api/signage/playlists/${wl.id}/slides`, { token: boss, body: { kind: 'blank', duration_s: 60, content: { widgets: [
{ kind: 'shape', position: 'custom', box: { x: 2, y: 2, w: 10, h: 15 }, shape: 'star' },
{ kind: 'countdown', position: 'top-center', countdown_to: '2099-01-01T00:00', text: 'Opening in' },
{ kind: 'countdown', position: 'top-center', countdown_to: '2099-01-01T00:00', text: 'Opening in', opacity: 60, rotation: 10, shadow: 'strong', animation: 'pop' },
{ kind: 'hours', position: 'top-left' }, { kind: 'wifi', position: 'bottom-right' }, { kind: 'contact', position: 'bottom-left' },
{ kind: 'ticker', position: 'top-bar', text: 'Fresh fish today' },
{ kind: 'reviews', position: 'custom', box: { x: 30, y: 40, w: 40, h: 25 } },
{ kind: 'gallery', position: 'custom', box: { x: 75, y: 30, w: 20, h: 20 }, gallery_source: 'folder', gallery_folder: dishes.id }] } } })
{ kind: 'gallery', position: 'custom', box: { x: 75, y: 30, w: 20, h: 20 }, gallery_source: 'folder', gallery_folder: dishes.id },
{ kind: 'date', position: 'custom', box: { x: 5, y: 80, w: 20, h: 6 }, date_format: 'numeric', date_separator: '.' },
{ kind: 'clock', position: 'custom', box: { x: 30, y: 80, w: 20, h: 6 }, clock_format: '12', clock_separator: '.' }] } } })
await api('PUT', `/api/signage/screens/${dev.id}`, { token: boss, body: { playlist_id: wl.id } })
const widgetsOn = async () => (await Promise.all(['shape', 'countdown', 'hours', 'wifi', 'contact', 'ticker', 'reviews', 'gallery'].map(k => tv.getByTestId(`signage-w-${k}`).count()))).every(n => n === 1)
r.check('6R.15: a shape, a countdown, the opening hours, Wi-Fi (from the identity), contact details and a scrolling text on the TV',
@@ -607,6 +609,12 @@ try {
&& await tv.getByTestId('signage-w-wifi').locator('svg').count() > 0)
r.check('6R.16: a gallery of a media folder shows its picture (kept on the TV)', await tv.getByTestId('signage-w-gallery').getAttribute('data-count') === '1'
&& (await tv.getByTestId('signage-w-gallery').locator('img').getAttribute('src')).startsWith('blob:'))
await sleep(1200) // its entrance (pop) is over
const cdBox = await tv.getByTestId('signage-w-countdown').evaluate(el => { const b = el.closest('[data-widget]'); const cs = getComputedStyle(b); return { o: cs.opacity, t: cs.transform, f: cs.filter } })
r.check('6R.17: More settings on the TV: opacity, turned, a shadow', cdBox.o === '0.6' && cdBox.t !== 'none' && cdBox.f.includes('drop-shadow'), JSON.stringify(cdBox))
const dateTxt = await tv.getByTestId('signage-w-date').textContent()
const clockTxt = await tv.getByTestId('signage-w-clock').textContent()
r.check('6R.17: a numeric date with dots, a 12-hour clock with a dot', /^\d\d\.\d\d\.\d{4}$/.test(dateTxt) && /^\d{1,2}\.\d\d\s?(am|pm|AM|PM|π\.μ\.|μ\.μ\.)$/i.test(clockTxt), `${dateTxt} | ${clockTxt}`)
r.check('6R.19: a review typed in by hand shows (the 2-star one is left out)', await tv.getByTestId('signage-w-reviews').getAttribute('data-count') === '1'
&& (await tv.getByTestId('signage-w-reviews').textContent()).includes('Best octopus'))
r.check('6R.15: the countdown runs (days left to 2099)', /^\d+d \d\d:\d\d:\d\d$/.test((await tv.getByTestId('signage-w-countdown').textContent()).replace('Opening in', '').trim()))