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:
2026-11-22 15:30:14 +02:00
co-authored by Claude Opus 5.5
parent 0bd32d9171
commit 1b111c0e27
20 changed files with 229 additions and 28 deletions
@@ -138,6 +138,12 @@ export default function CustomerDisplaySettings() {
<option value="light">{t('display.themes.light')}</option>
</Select>
</Field>
<Field label={t('display.brand')} hint={t('display.brandHint')}>
<Select value={form.brand || 'own'} onChange={e => set('brand', e.target.value)} data-testid="display-brand">
<option value="own">{t('display.brands.own')}</option>
<option value="identity">{t('display.brands.identity')}</option>
</Select>
</Field>
{shows('slides') && (
<Field label={t('display.slideSeconds')}>
<Input inputMode="numeric" value={String(form.slide_seconds)} data-testid="display-slide-seconds"
@@ -1,22 +1,25 @@
// Venue language and time zone (plan step 2.6f, D-11, D-12): venue.language is the
// language of staff without their own choice and of printed tickets/reports; venue.timezone
// is the zone every time is shown in (applies at once); venue.theme is the staff apps' accent
// colour (plan step 4.6: the waiter's phones). All reload bootstrap after saving.
// colour (plan step 4.6: the waiter's phones; 6R.20: "The venue's identity" = its first colour, for
// the phones and every screen of the terminal). All reload bootstrap after saving.
import { useId, useMemo } from 'react'
import { useAccess } from '@xenia/access'
import { LANGUAGE_NAMES, useTranslation, useFormat } from '@xenia/i18n'
import { Select, Spinner } from '@xenia/ui'
import { SettingRow, SettingsCard } from './SettingsCard'
import { useSettings } from './useSettings'
import { useIdentity } from '../../../shell/useIdentity'
import { timeZones } from './timeZones'
const VENUE_THEMES = ['amber', 'teal', 'blue', 'violet', 'rose'] // packages/ui tokens.css data-venue-theme
const VENUE_THEMES = ['amber', 'teal', 'blue', 'violet', 'rose', 'identity'] // packages/ui tokens.css data-venue-theme; identity: venueAccent.js
export default function VenueSettings() {
const { t } = useTranslation('manager')
const f = useFormat()
const { languages } = useAccess()
const s = useSettings()
const { data: identity } = useIdentity()
const langId = useId()
const tzId = useId()
const themeId = useId()
@@ -37,7 +40,8 @@ export default function VenueSettings() {
onChange={e => s.save('venue.timezone', e.target.value)}
options={zones.map(z => ({ value: z, label: z.replace(/_/g, ' ') }))} />
</SettingRow>
<SettingRow label={t('settings.venue.theme')} htmlFor={themeId} hint={t('settings.venue.themeHint')}>
<SettingRow label={t('settings.venue.theme')} htmlFor={themeId} hint={t('settings.venue.themeHint')}
warning={s.get('venue.theme') === 'identity' && !identity?.colours?.length ? t('settings.venue.identityNoColour') : undefined}>
<Select id={themeId} value={s.get('venue.theme', 'amber')} disabled={s.saving} data-testid="setting-venue.theme"
onChange={e => s.save('venue.theme', e.target.value)}
options={VENUE_THEMES.map(v => ({ value: v, label: t(`settings.venue.themes.${v}`) }))} />
@@ -315,8 +315,13 @@ function BelowFields({ w, set, media, onMedia, extras, path, depth, selected, on
const { t } = useTranslation('manager')
if (MORE_KINDS.includes(w.kind)) return <MoreBelow w={w} set={set} media={media} onMedia={onMedia} />
if (w.kind === 'logo') {
return <MediaPick kind="image" value={w.media_id} entry={media[String(w.media_id)]} testid="signage-widget-logo"
onChange={item => { onMedia(item); set({ media_id: item.id }) }} />
return (
<div className="grid gap-1">
<MediaPick kind="image" value={w.media_id} entry={media[String(w.media_id)]} testid="signage-widget-logo"
onChange={item => { onMedia(item); set({ media_id: item.id }) }} onRemove={() => set({ media_id: null })} />
{!w.media_id && <p className="text-caption text-ink-3">{t('signage.widgets.logoFromIdentity')}</p>}
</div>
)
}
if (w.kind === 'message') return <MessageHint />
if (w.kind === 'weather') {