feat(signage): menus play whole rounds, seconds fields with − / +, widget limit setting, widgets as big as their content (owner review 6)

- A menu board with pages plays whole rounds (menuMs rounds its seconds up); the editor says how
  long it really plays under "Seconds on screen", the card and the playlist total use it.
- Seconds on screen / per page: shared NumberInput (− / +, may be emptied: an error under the
  field and Save blocked until filled; 1 s at least, server ge=1).
- Performance (Signage -> Message & settings): widgets per slide (signage.max_widgets, 10
  recommended, up to 50), checked by the server (signage.too_many_widgets) and the editor.
- Text, clock, date, QR, weather, logo placed by hand: the box is exactly the content (its height
  x text size sets the size, the width follows; handles scale keeping the shape; text size grows
  the box); a slide's widget may run off the slide while 5 % stays on it.
- Slider: the value as close to the slider as the frame's padding; floor and table-colour sliders
  use the shared Slider. Timeline cards' ring no longer clipped; larger playlist buttons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 15:11:48 +02:00
co-authored by Claude Opus 5.5
parent aa3fe85053
commit aa8ba5d1d4
33 changed files with 436 additions and 75 deletions
@@ -18,7 +18,7 @@
// has every setting a slide's widget has, aligned both ways in its place or moved and sized there on
// the preview (Custom); the message of the day changed from its widget. The picked widget is a path
// ("2", "2.1.0": see WidgetCanvas).
// Up to 10 (the server's limit).
// Up to the venue's limit (10 recommended; Signage → Message & settings → Performance).
import { Fragment, useEffect, useRef, useState } from 'react'
import {
AlignCenter, AlignLeft, AlignRight, AlignVerticalJustifyCenter, AlignVerticalJustifyEnd, AlignVerticalJustifyStart, ArrowDown, ArrowUp, Bold, Italic, Palette, RotateCcw, Underline, BookImage, CalendarDays, ChevronDown, Clock, CloudSun, Columns3, GripVertical,
@@ -28,6 +28,7 @@ import { cellWidgets, evenShares, setShare } from '@xenia/signage'
import { useTranslation } from '@xenia/i18n'
import { Button, ColourField, Dialog, Dropdown, Field, FieldRow, IconButton, Input, Popover, Segmented, Slider, Switch } from '@xenia/ui'
import MessageOfTheDay from './MessageOfTheDay'
import { usePerformance } from './usePerformance'
import * as api from './signageApi'
import MenuEditor from './MenuEditor'
import { MediaPick, Section } from './SignageFields'
@@ -52,6 +53,7 @@ function useLibrary() {
export default function WidgetsEditor({ widgets = [], onChange, media, onMedia, selected = null, onSelect, extras = {} }) {
const { t } = useTranslation('manager')
const most = usePerformance().max_widgets // the venue's limit (Performance; 10 recommended)
const [drag, setDrag] = useState(null) // { from, at }: the card dragged and where it would land
const set = (i, patch) => onChange(widgets.map((w, j) => (j === i ? { ...w, ...patch } : w)))
const add = kind => {
@@ -129,7 +131,7 @@ export default function WidgetsEditor({ widgets = [], onChange, media, onMedia,
)
})}
{line(widgets.length)}
{widgets.length < 10 && (
{widgets.length < most && (
<div className="flex flex-wrap items-center gap-1.5">
{[...WIDGET_KINDS, 'hstack', 'vstack'].map(k => {
const Icon = ICON[k]
@@ -141,6 +143,7 @@ export default function WidgetsEditor({ widgets = [], onChange, media, onMedia,
})}
</div>
)}
{widgets.length >= most && <p className="text-caption text-ink-3" data-testid="signage-widgets-full">{t('signage.widgets.full', { count: most })}</p>}
</Section>
)
}