feat: the venue's identity in every app: its colour as the accent of the waiters' phones and every terminal screen, customer display looks on the identity, the signage logo widget falls back to the venue's logo
Settings -> Venue -> accent "The venue's identity" (venue.theme = identity): bootstrap carries the identity's first colour and logos; @xenia/ui applyVenueTheme makes the accent tokens (light and dark, readable foregrounds) from it. A display look's "Colours and logo" can be the venue's identity. Plan 6R.20, F-117. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+13
-2
@@ -586,11 +586,13 @@ try {
|
||||
// ── 6R.14 / 6R.15: the identity and opening hours feed the new widgets on the TV ──
|
||||
const ident = await api('GET', '/api/identity', { token: boss })
|
||||
await api('PUT', '/api/identity', { token: boss, body: { name: ident.name || 'Taverna', wifi: { ssid: 'Xenia Guests', password: 'kalimera', security: 'WPA' },
|
||||
contact: { phone: '2310 123456', instagram: '@xenia' } } })
|
||||
contact: { phone: '2310 123456', instagram: '@xenia' }, colours: [{ name: 'Main', colour: '#1e3a8a' }], logos: { main: photo.id } } })
|
||||
await api('PUT', '/api/settings/venue.theme', { token: boss, body: { value: 'identity' } })
|
||||
await api('PUT', '/api/signage/reviews', { token: boss, body: { reviews: [{ name: 'Maria', stars: 5, text: 'Best octopus on the island' }, { name: 'Bob', stars: 2, text: 'Meh' }] } })
|
||||
await api('PUT', '/api/identity/hours', { token: boss, body: { days: [[{ from: '12:00', to: '23:00' }], [], [], [], [], [], []] } })
|
||||
const dishes = await api('POST', '/api/media/folders', { token: boss, body: { name: 'Dishes' } })
|
||||
await api('POST', '/api/media/move', { token: boss, body: { ids: [photo.id], folder_id: dishes.id } })
|
||||
await api('PUT', '/api/signage/performance', { token: boss, body: { max_widgets: 20 } }) // this slide shows them all at once
|
||||
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' },
|
||||
@@ -600,7 +602,8 @@ try {
|
||||
{ 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: '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: '.' }] } } })
|
||||
{ kind: 'clock', position: 'custom', box: { x: 30, y: 80, w: 20, h: 6 }, clock_format: '12', clock_separator: '.' },
|
||||
{ kind: 'logo', position: 'bottom-center' }] } } })
|
||||
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',
|
||||
@@ -615,6 +618,14 @@ try {
|
||||
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.20: a logo widget without its own picture shows the venue's logo", await waitFor(async () => (await tv.getByTestId('signage-w-logo').count()) === 1 || null, 10_000, 300) === true)
|
||||
await tv.reload()
|
||||
const accent = await waitFor(async () => {
|
||||
const a = await tv.evaluate(() => [document.documentElement.getAttribute('data-venue-theme'), getComputedStyle(document.documentElement).getPropertyValue('--x-accent-rgb').trim()])
|
||||
return a[0] === 'identity' ? a : null
|
||||
}, 15_000, 300)
|
||||
r.check('6R.20: the venue identity colour is the accent of the screens (venue.theme identity)', accent?.[1] === '30 58 138', JSON.stringify(accent))
|
||||
await api('PUT', '/api/settings/venue.theme', { token: boss, body: { value: 'amber' } })
|
||||
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()))
|
||||
|
||||
Reference in New Issue
Block a user