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:
2026-11-21 07:53:27 +02:00
co-authored by Claude Opus 5.5
parent 60e6a16217
commit 83551714f7
46 changed files with 1934 additions and 431 deletions
@@ -10,7 +10,7 @@ import client from '../../api/client'
import { configGroups, configValue, refOptions } from './devicesLogic'
// Where a `ref` field's choices come from (the device list is passed in)
const REF_URLS = { prep_zones: '/api/prep-zones', categories: '/api/products/categories', printers: '/api/system/printers', display_looks: '/api/display/looks', signage_playlists: '/api/signage/playlists', signage_schedules: '/api/signage/schedules', tables: '/api/tables/' }
const REF_URLS = { prep_zones: '/api/prep-zones', categories: '/api/products/categories', printers: '/api/system/printers', display_looks: '/api/display/looks', signage_playlists: '/api/signage/playlists', signage_slides: '/api/signage/library', signage_schedules: '/api/signage/schedules', tables: '/api/tables/' }
export default function DeviceConfigFields({ appKey, fields = [], value, onChange, devices = [], selfId = null }) {
const { t } = useTranslation('manager')
@@ -30,6 +30,7 @@ export default function DeviceConfigFields({ appKey, fields = [], value, onChang
const printers = lists.printers ?? []
const looks = lists.display_looks ?? []
const playlists = lists.signage_playlists ?? []
const slides = lists.signage_slides?.slides ?? [] // the Slides library answers { slides, media }
const schedules = lists.signage_schedules ?? []
const tables = lists.tables ?? []
@@ -57,7 +58,7 @@ export default function DeviceConfigFields({ appKey, fields = [], value, onChang
<Field key={f.key} label={label} hint={hint}>
<Select value={v == null ? '' : String(v)} onChange={e => set(f, e.target.value)} data-config={f.key}
options={[{ value: '', label: t(`${base(f.key)}.none`, { defaultValue: t('devices.form.none') }) },
...refOptions(f, { zones, categories, printers, looks, playlists, schedules, tables, devices, selfId })]} />
...refOptions(f, { zones, categories, printers, looks, playlists, slides, schedules, tables, devices, selfId })]} />
</Field>
)
}
@@ -86,10 +86,11 @@ export function configGroups(fields = []) {
}
/** Options of a `ref` field: prep zones, categories, printers, customer display looks, or live devices of one app ("devices:<app>"). */
export function refOptions(field, { zones = [], categories = [], printers = [], looks = [], playlists = [], schedules = [], tables = [], devices = [], selfId = null } = {}) {
export function refOptions(field, { zones = [], categories = [], printers = [], looks = [], playlists = [], slides = [], schedules = [], tables = [], devices = [], selfId = null } = {}) {
if (field.choices_from === 'tables') return tables.filter(x => x.is_active !== false).map(x => ({ value: String(x.id), label: x.label || String(x.number) }))
if (field.choices_from === 'signage_schedules') return schedules.map(s => ({ value: String(s.id), label: s.name }))
if (field.choices_from === 'signage_playlists') return playlists.map(p => ({ value: String(p.id), label: p.name }))
if (field.choices_from === 'signage_slides') return slides.map(p => ({ value: String(p.id), label: p.name }))
if (field.choices_from === 'display_looks') return looks.map(l => ({ value: String(l.id), label: l.name }))
if (field.choices_from === 'prep_zones') return zones.map(z => ({ value: String(z.id), label: z.name }))
if (field.choices_from === 'categories') return categories.map(c => ({ value: String(c.id), label: c.name }))