feat(terminal): signage menu boards that page by themselves, and the widgets (platform-v2 step 5.5b)

- Menu board: the board's own order, grouped with headings or one list,
  photos, descriptions, badges (translated), sold out crossed out with a
  label, prices in the venue's money format, dotted leaders, a page dot row.
  Pages: rows that fit from the frame's shape (portrait fits more), text size,
  photos / descriptions, the title and widget bars (`page_size` overrides);
  they go round every `page_seconds` while the slide lasts.
- Widgets on text and menu slides: logo, name, date, clock, message of the
  day, QR code, weather (hidden without a forecast) in corners and bars, three
  sizes.
- logic.js: menuPages, rowsPerColumn, frameHeightVmin, boardPages, menuMs,
  pageAt, weatherIcon (+4 tests).
- e2e signage.mjs: a long board pages by itself, widgets in place, weather
  hidden with no place, the chosen product first with its badge, a price change
  and sold out show within seconds, a portrait TV needs fewer pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 20:00:14 +02:00
co-authored by Claude Opus 5.5
parent e612e2436c
commit e90c2f4f8f
8 changed files with 375 additions and 40 deletions
+24 -10
View File
@@ -5,12 +5,12 @@
// GET /api/signage/screen in localStorage and every picture and video as an in-memory copy, so it
// keeps playing (and switching by its schedule) while the server is down, and catches up on
// `signage.changed`, a reconnect, or every few minutes (prices that change by time alone).
// Menu boards and widgets are drawn in 5.5b.
// Menu boards page by themselves when they don't fit (5.5b); widgets sit in corners and bars.
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { useTranslation } from '@xenia/i18n'
import client from '../../api/client'
import { useDevice, useLiveEvent, useLiveEvents } from '../../device/context'
import { frameStyle, localNow, mediaUrls, nextSlide, playlistNow, slideMs } from './logic'
import { boardPages, frameStyle, localNow, mediaUrls, menuMs, nextSlide, pageAt, playlistNow, slideMs } from './logic'
import { MenuSlide, TextSlide } from './Slides'
const quiet = { xenia: { noOverride: true } }
@@ -97,7 +97,7 @@ export default function SignageApp() {
data-testid="app-signage" data-playlist={playlist?.id ?? ''} data-orientation={screen?.orientation ?? ''} data-offline={offline ? 'true' : 'false'}>
<div style={frameStyle(screen?.rotation)} data-testid="signage-frame" data-rotation={screen?.rotation ?? 0}>
{playlist?.slides?.length
? <Player key={playlist.id} playlist={playlist} kept={kept} tz={tz} venue={data?.venue} now={now} />
? <Player key={playlist.id} playlist={playlist} kept={kept} tz={tz} venue={data?.venue} now={now} rotation={screen?.rotation} />
: <Empty text={data ? t('signage.nothing') : t('signage.starting')} />}
</div>
</main>
@@ -113,9 +113,21 @@ function Empty({ text }) {
}
/** Plays one playlist: the current slide, the next when its time is up, with the transition. */
function Player({ playlist, kept, tz, venue, now }) {
function useWindowSize() {
const [size, setSize] = useState(() => ({ w: window.innerWidth, h: window.innerHeight }))
useEffect(() => {
const on = () => setSize({ w: window.innerWidth, h: window.innerHeight })
window.addEventListener('resize', on)
return () => window.removeEventListener('resize', on)
}, [])
return size
}
function Player({ playlist, kept, tz, venue, now, rotation }) {
const local = localNow(tz, now)
const slides = playlist.slides
const size = useWindowSize()
const pagesOf = useCallback(sl => (sl?.kind === 'menu' ? boardPages(sl, rotation, size.w, size.h) : null), [rotation, size])
const [cur, setCur] = useState(() => ({ index: nextSlide(slides, -1, local), at: Date.now(), n: 0 }))
const [prev, setPrev] = useState(null)
const media = id => {
@@ -141,10 +153,10 @@ function Player({ playlist, kept, tz, venue, now }) {
// time's up (videos to their end call advance themselves, with a safety limit)
useEffect(() => {
if (!slide) return undefined
const ms = slideMs(slide) ?? VIDEO_MAX_MS
const ms = slide.kind === 'menu' ? menuMs(slide, pagesOf(slide).length) : (slideMs(slide) ?? VIDEO_MAX_MS)
const id = setTimeout(advance, ms)
return () => clearTimeout(id)
}, [slide, cur.n, advance])
}, [slide, cur.n, advance, pagesOf])
// a slide that may no longer show (its window ended) is skipped at once; none showing → wait
useEffect(() => {
if (cur.index < 0 && nextSlide(slides, -1, local) >= 0) advance()
@@ -160,22 +172,24 @@ function Player({ playlist, kept, tz, venue, now }) {
return (
<>
{prev && slides[prev.index] && (
<Layer key={`out-${prev.n}`} slide={slides[prev.index]} media={media} venue={venue} now={now} className={`sg-out sg-out-${transition}`} />
<Layer key={`out-${prev.n}`} slide={slides[prev.index]} media={media} venue={venue} now={now} className={`sg-out sg-out-${transition}`}
pages={pagesOf(slides[prev.index])} page={pageAt(pagesOf(slides[prev.index])?.length || 0, slides[prev.index].content?.page_seconds, cur.at - prev.at - 1)} />
)}
<Layer key={`in-${cur.n}`} slide={slide} media={media} venue={venue} now={now} onEnded={advance}
className={cur.n === 0 ? '' : `sg-in sg-in-${transition}`} current />
className={cur.n === 0 ? '' : `sg-in sg-in-${transition}`} current
pages={pagesOf(slide)} page={pageAt(pagesOf(slide)?.length || 0, slide.content?.page_seconds, now.getTime() - cur.at)} />
</>
)
}
function Layer({ slide, media, venue, now, onEnded, className, current = false }) {
function Layer({ slide, media, venue, now, onEnded, className, current = false, pages, page }) {
return (
<section className={`absolute inset-0 overflow-hidden ${className}`} style={{ animationDuration: `${TRANSITION_MS}ms` }}
data-testid={current ? 'signage-slide' : 'signage-slide-out'} data-kind={slide.kind} data-slide={slide.id}>
{slide.kind === 'image' && <ImageSlide content={slide.content} media={media} />}
{slide.kind === 'video' && <VideoSlide slide={slide} media={media} onEnded={current ? onEnded : undefined} />}
{slide.kind === 'text' && <TextSlide content={slide.content} media={media} venue={venue} now={now} />}
{slide.kind === 'menu' && <MenuSlide slide={slide} media={media} venue={venue} now={now} />}
{slide.kind === 'menu' && <MenuSlide slide={slide} media={media} venue={venue} now={now} pages={pages || []} page={page || 0} />}
</section>
)
}
+142 -24
View File
@@ -1,9 +1,11 @@
// Text and menu slides of the signage player (plan steps 5.5a, 5.5b). Colours, fonts and sizes
// here are the venue's own choices for its TV (slide content = data, CS-16), so they are inline
// styles, not tokens. Sizes scale with the screen (vmin), so a slide looks the same on any TV.
import { useFormat } from '@xenia/i18n'
import { FONTS } from './logic'
// Text and menu slides of the signage player, and their widgets (plan steps 5.5a, 5.5b). Colours,
// fonts and sizes here are the venue's own choices for its TV (slide content = data, CS-16), so
// they are inline styles, not tokens. Sizes scale with the screen (vmin), so a slide looks the
// same on any TV.
import { Cloud, CloudFog, CloudLightning, CloudMoon, CloudRain, CloudSnow, CloudSun, Moon, Sun } from 'lucide-react'
import { QRCodeSVG } from 'qrcode.react'
import { useFormat, useTranslation } from '@xenia/i18n'
import { FONTS, weatherIcon } from './logic'
/** A slide's background: a colour, or a photo (cover / contain) with a darkening layer. */
export function Background({ bg, media }) {
@@ -17,50 +19,166 @@ export function Background({ bg, media }) {
}
const JUSTIFY = { top: 'flex-start', middle: 'center', bottom: 'flex-end' }
const hasBar = (c, where) => (c.widgets || []).some(w => w.position === where)
export function TextSlide({ content: c, media }) {
export function TextSlide({ content: c, media, venue, now }) {
const scale = (c.text_size || 100) / 100
return (
<div className="absolute inset-0">
<div className="absolute inset-0" style={{ color: c.text_colour || '#fff', fontFamily: FONTS[c.font] || FONTS.sans }}>
<Background bg={c.background} media={media} />
<div className="absolute inset-0 flex flex-col" style={{
justifyContent: JUSTIFY[c.vertical] || 'center', textAlign: c.align || 'center', color: c.text_colour || '#fff',
fontFamily: FONTS[c.font] || FONTS.sans, padding: '8vmin', gap: `${3 * scale}vmin`,
justifyContent: JUSTIFY[c.vertical] || 'center', textAlign: c.align || 'center',
padding: `${hasBar(c, 'top-bar') ? 14 : 8}vmin 8vmin ${hasBar(c, 'bottom-bar') ? 14 : 8}vmin`, gap: `${3 * scale}vmin`,
}}>
{c.title && <h1 style={{ fontSize: `${9 * scale}vmin`, lineHeight: 1.1, fontWeight: 800, margin: 0 }} data-testid="signage-title">{c.title}</h1>}
{c.body && <p style={{ fontSize: `${4.5 * scale}vmin`, lineHeight: 1.35, margin: 0, whiteSpace: 'pre-line' }} data-testid="signage-body">{c.body}</p>}
</div>
<Widgets widgets={c.widgets} media={media} venue={venue} now={now} colour={c.text_colour} />
</div>
)
}
/** A first menu board (5.5a): its title and every item with its price; 5.5b lays it out fully. */
export function MenuSlide({ slide, media }) {
/** A menu board (5.5b): its page of items (pages flip on their own), photos, descriptions, badges, sold out. */
export function MenuSlide({ slide, media, venue, now, page, pages }) {
const { t } = useTranslation('terminal')
const { formatMoney } = useFormat()
const c = slide.content
const scale = (c.text_size || 100) / 100
const groups = slide.menu?.groups || []
const accent = c.accent_colour || '#f59e0b'
const groups = pages[page] || []
return (
<div className="absolute inset-0">
<div className="absolute inset-0" style={{ color: c.text_colour || '#fff', fontFamily: FONTS[c.font] || FONTS.sans }}>
<Background bg={c.background} media={media} />
<div className="absolute inset-0 flex flex-col" style={{ color: c.text_colour || '#fff', fontFamily: FONTS[c.font] || FONTS.sans, padding: '5vmin' }}
data-testid="signage-menu">
{c.title && <h1 style={{ fontSize: `${7 * scale}vmin`, fontWeight: 800, margin: '0 0 2vmin', color: c.accent_colour }}>{c.title}</h1>}
<div style={{ columnCount: c.columns || 2, columnGap: '5vmin', fontSize: `${3.2 * scale}vmin` }}>
<div className="absolute inset-0 flex flex-col"
style={{ padding: `${hasBar(c, 'top-bar') ? 12 : 5}vmin 5vmin ${hasBar(c, 'bottom-bar') ? 12 : 5}vmin` }}
data-testid="signage-menu" data-page={page} data-pages={pages.length}>
{c.title && <h1 style={{ fontSize: `${7 * scale}vmin`, fontWeight: 800, margin: '0 0 2vmin', color: accent, lineHeight: 1.1 }}>{c.title}</h1>}
<div style={{ columnCount: c.columns || 2, columnGap: '5vmin', fontSize: `${3.2 * scale}vmin`, flex: 1, columnFill: 'auto' }}>
{groups.map((g, i) => (
<div key={g.category?.id ?? `all-${i}`} style={{ breakInside: 'avoid', marginBottom: '2vmin' }}>
{g.category && c.category_titles !== false && <h2 style={{ fontSize: '1.2em', color: c.accent_colour, margin: '0 0 0.5vmin' }}>{g.category.name}</h2>}
<div key={`${g.category?.id ?? 'all'}-${i}`} style={{ marginBottom: '1.6vmin' }}>
{g.category && c.category_titles !== false && (
<h2 style={{ fontSize: '1.15em', color: accent, margin: '0 0 0.6vmin', fontWeight: 700, breakAfter: 'avoid' }}
data-testid="signage-menu-heading">{g.category.name}</h2>
)}
{g.items.map(it => (
<div key={it.id} className="flex justify-between gap-4" data-testid="signage-menu-item" data-available={it.available ? 'true' : 'false'}
style={{ textDecoration: it.available ? 'none' : 'line-through', opacity: it.available ? 1 : 0.55 }}>
<span>{it.name}</span>
{it.price != null && <span style={{ color: c.accent_colour, fontVariantNumeric: 'tabular-nums' }} data-testid="signage-menu-price">{formatMoney(it.price)}</span>}
<div key={it.id} data-testid="signage-menu-item" data-id={it.id} data-available={it.available ? 'true' : 'false'}
style={{ display: 'flex', alignItems: 'center', gap: '1.5vmin', breakInside: 'avoid', padding: '0.5vmin 0',
opacity: it.available ? 1 : 0.5 }}>
{c.show_photos && (it.image
? <img src={it.image} alt="" style={{ width: '7vmin', height: '7vmin', objectFit: 'cover', borderRadius: '1vmin', flexShrink: 0 }} />
: <span style={{ width: '7vmin', height: '7vmin', flexShrink: 0 }} />)}
<div style={{ flex: 1, minWidth: 0 }}>
<div style={{ display: 'flex', alignItems: 'baseline', gap: '1vmin' }}>
<span style={{ textDecoration: it.available ? 'none' : 'line-through', fontWeight: 600 }}>{it.name}</span>
{it.badge && (
<span style={{ background: accent, color: '#111', fontSize: '0.55em', fontWeight: 800, padding: '0.2vmin 0.9vmin', borderRadius: '99vmin',
textTransform: 'uppercase', letterSpacing: '0.05em', whiteSpace: 'nowrap' }} data-testid="signage-badge">{t(`signage.badges.${it.badge}`)}</span>
)}
{!it.available && <span style={{ fontSize: '0.6em', whiteSpace: 'nowrap' }} data-testid="signage-sold-out">{t('signage.soldOut')}</span>}
<span style={{ flex: 1, borderBottom: '0.25vmin dotted currentColor', opacity: 0.35, minWidth: '2vmin' }} />
{it.price != null && <span style={{ color: accent, fontVariantNumeric: 'tabular-nums', fontWeight: 700, whiteSpace: 'nowrap' }}
data-testid="signage-menu-price">{formatMoney(it.price)}</span>}
</div>
{it.description && <div style={{ fontSize: '0.7em', opacity: 0.75, lineHeight: 1.25 }}>{it.description}</div>}
</div>
</div>
))}
</div>
))}
</div>
{pages.length > 1 && (
<div style={{ display: 'flex', gap: '1vmin', justifyContent: 'center', paddingTop: '1vmin' }} aria-hidden="true">
{pages.map((_, i) => <span key={i} style={{ width: '1.2vmin', height: '1.2vmin', borderRadius: '50%', background: i === page ? accent : 'currentColor', opacity: i === page ? 1 : 0.3 }} />)}
</div>
)}
</div>
<Widgets widgets={c.widgets} media={media} venue={venue} now={now} colour={c.text_colour} />
</div>
)
}
// ── widgets (5.5b) ──────────────────────────────────────────────────────────
const SIZE = { small: 0.75, medium: 1, large: 1.4 }
const CORNER = {
'top-left': { top: '3vmin', left: '3vmin', alignItems: 'flex-start' },
'top-center': { top: '3vmin', left: '50%', transform: 'translateX(-50%)', alignItems: 'center' },
'top-right': { top: '3vmin', right: '3vmin', alignItems: 'flex-end' },
'bottom-left': { bottom: '3vmin', left: '3vmin', alignItems: 'flex-start' },
'bottom-center': { bottom: '3vmin', left: '50%', transform: 'translateX(-50%)', alignItems: 'center' },
'bottom-right': { bottom: '3vmin', right: '3vmin', alignItems: 'flex-end' },
}
/** The widgets of a slide, in their corners and bars. One that has nothing to show is left out. */
export function Widgets({ widgets, media, venue, now, colour }) {
if (!widgets?.length) return null
const bar = where => widgets.filter(w => w.position === where)
const bars = [['top-bar', { top: 0 }], ['bottom-bar', { bottom: 0 }]]
return (
<>
{bars.map(([where, pos]) => bar(where).length > 0 && (
<div key={where} className="absolute inset-x-0" data-testid={`signage-${where}`}
style={{ ...pos, display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '3vmin', padding: '2vmin 4vmin',
background: 'rgba(0,0,0,0.35)', color: colour || '#fff', minHeight: '9vmin' }}>
{bar(where).map((w, i) => <Widget key={i} w={w} media={media} venue={venue} now={now} />)}
</div>
))}
{widgets.filter(w => CORNER[w.position]).map((w, i) => (
<div key={`c${i}`} className="absolute" style={{ ...CORNER[w.position], display: 'flex', flexDirection: 'column', color: colour || '#fff' }}>
<Widget w={w} media={media} venue={venue} now={now} />
</div>
))}
</>
)
}
const ICONS = { sun: Sun, moon: Moon, 'cloud-sun': CloudSun, 'cloud-moon': CloudMoon, cloud: Cloud, fog: CloudFog, rain: CloudRain, snow: CloudSnow, storm: CloudLightning }
function Widget({ w, media, venue, now }) {
const { formatDate, formatTime } = useFormat()
const s = SIZE[w.size] || 1
const text = { fontSize: `${3.4 * s}vmin`, fontWeight: 700, lineHeight: 1.15, textShadow: '0 0.2vmin 0.8vmin rgba(0,0,0,0.35)' }
if (w.kind === 'logo') {
const m = media(w.media_id)
return m ? <img src={m.src} alt="" style={{ height: `${9 * s}vmin`, maxWidth: `${30 * s}vmin`, objectFit: 'contain' }} data-testid="signage-w-logo" /> : null
}
if (w.kind === 'name') return venue?.name ? <span style={{ ...text, fontSize: `${4.2 * s}vmin` }} data-testid="signage-w-name">{venue.name}</span> : null
if (w.kind === 'date') return <span style={text} data-testid="signage-w-date">{formatDate(now, w.date_style === 'short' ? 'date' : 'dateLong')}</span>
if (w.kind === 'clock') return <span style={{ ...text, fontSize: `${4.6 * s}vmin`, fontVariantNumeric: 'tabular-nums' }} data-testid="signage-w-clock">{formatTime(now, w.clock_seconds ? 'timeSeconds' : 'time')}</span>
if (w.kind === 'message') {
const msg = w.text || venue?.message
return msg ? <span style={{ ...text, fontWeight: 600 }} data-testid="signage-w-message">{msg}</span> : null
}
if (w.kind === 'qr') {
return w.link ? (
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '0.8vmin' }} data-testid="signage-w-qr" data-link={w.link}>
<div style={{ background: '#fff', padding: '1vmin', borderRadius: '1vmin', lineHeight: 0 }}>
<QRCodeSVG value={w.link} size={256} style={{ width: `${14 * s}vmin`, height: `${14 * s}vmin` }} />
</div>
{w.qr_caption && <span style={{ ...text, fontSize: `${2.4 * s}vmin` }}>{w.qr_caption}</span>}
</div>
) : null
}
if (w.kind === 'weather') {
const wx = venue?.weather
if (!wx || wx.temperature == null) return null // no internet / no place: hidden (5.4c)
const Icon = ICONS[weatherIcon(wx.code, wx.is_day)] || Cloud
const deg = wx.units === 'fahrenheit' ? '°F' : '°C'
return (
<div style={{ display: 'flex', alignItems: 'center', gap: '1.5vmin' }} data-testid="signage-w-weather">
<Icon style={{ width: `${6 * s}vmin`, height: `${6 * s}vmin` }} aria-hidden="true" />
<span style={{ ...text, fontSize: `${4.4 * s}vmin` }}>{Math.round(wx.temperature)}{deg}</span>
{(w.weather_days || 1) > 1 && (wx.days || []).slice(1, w.weather_days).map(d => {
const DayIcon = ICONS[weatherIcon(d.code, true)] || Cloud
return (
<span key={d.date} style={{ display: 'flex', alignItems: 'center', gap: '0.6vmin', ...text, fontSize: `${2.4 * s}vmin`, fontWeight: 600 }}>
{formatDate(`${d.date}T12:00:00Z`, 'weekday').slice(0, 3)} <DayIcon style={{ width: `${3.4 * s}vmin`, height: `${3.4 * s}vmin` }} aria-hidden="true" />
{Math.round(d.max)}° / {Math.round(d.min)}°
</span>
)
})}
</div>
)
}
return null
}
+84
View File
@@ -116,3 +116,87 @@ export const FONTS = {
condensed: '"Arial Narrow", "Roboto Condensed", "Helvetica Neue", sans-serif',
display: 'Impact, "Arial Black", system-ui, sans-serif',
}
// ── menu boards (5.5b) ───────────────────────────────────────────────────────
/** The frame's height in vmin (its shorter side is 100) for a screen w × h: 100 when wide, ~178 when tall (16:9). */
export function frameHeightVmin(rotation, w = 16, h = 9) {
const turned = Number(rotation) === 90 || Number(rotation) === 270
const frameTall = turned ? w > h : h > w // the screen's sides, swapped when the picture is turned
return frameTall ? (100 * Math.max(w, h)) / Math.min(w, h) : 100
}
/**
* How many rows fit in one column of a menu board: rows are items (taller with a photo or a
* description) and group headings. Sizes in vmin, as the board draws them.
*/
export function rowsPerColumn({ heightVmin = 100, textSize = 100, photos = false, descriptions = false, title = false, bars = 0 }) {
const s = (textSize || 100) / 100
const row = (photos ? 8 : descriptions ? 7 : 4.8) * s
const used = 10 + (title ? 11 * s : 0) + bars * 9 // padding, the title, top / bottom bars of widgets
return Math.max(3, Math.floor((heightVmin - used) / row))
}
/**
* The board's pages: groups split into pages of at most `perPage` rows (a heading counts as a
* row; a group cut in two repeats its heading on the next page). → [[{category, items}], …]
*/
export function menuPages(groups, perPage, headings = true) {
const per = Math.max(1, perPage | 0)
const pages = []
let page = []
let used = 0
const flush = () => { if (page.length) pages.push(page); page = []; used = 0 }
for (const g of groups || []) {
let items = [...(g.items || [])]
if (!items.length) continue
while (items.length) {
const head = headings && g.category ? 1 : 0
if (used + head + 1 > per) flush()
const room = per - used - head
const take = items.slice(0, Math.max(1, room))
page.push({ category: g.category, items: take })
used += head + take.length
items = items.slice(take.length)
if (items.length) flush()
}
}
flush()
return pages
}
/** A menu slide's time: every page for its seconds, at least the slide's own time. */
export function menuMs(slide, pageCount) {
const per = Math.max(3, slide.content?.page_seconds || 10) * 1000
return Math.max(slideMs(slide), pageCount > 1 ? pageCount * per : 0)
}
/** The page on screen `elapsedMs` into the slide (the pages go round while the slide lasts). */
export function pageAt(pageCount, pageSeconds, elapsedMs) {
if (pageCount <= 1 || !(elapsedMs > 0)) return 0 // the clock's last tick may be just before the slide began
return Math.floor(elapsedMs / (Math.max(3, pageSeconds || 10) * 1000)) % pageCount // round and round while the slide lasts
}
/** A weather code (WMO, as Open-Meteo sends it) → an icon name for the widget. */
export function weatherIcon(code, isDay = true) {
if (code == null) return 'cloud'
if (code === 0) return isDay ? 'sun' : 'moon'
if (code <= 2) return isDay ? 'cloud-sun' : 'cloud-moon'
if (code === 3) return 'cloud'
if (code === 45 || code === 48) return 'fog'
if ((code >= 51 && code <= 67) || (code >= 80 && code <= 82)) return 'rain'
if ((code >= 71 && code <= 77) || code === 85 || code === 86) return 'snow'
if (code >= 95) return 'storm'
return 'cloud'
}
/** A menu slide's pages for this screen (w × h pixels, turned by `rotation`). */
export function boardPages(slide, rotation, w, h) {
const c = slide.content || {}
const widgets = c.widgets || []
const bars = ['top-bar', 'bottom-bar'].filter(p => widgets.some(x => x.position === p)).length
const rows = rowsPerColumn({ heightVmin: frameHeightVmin(rotation, w, h), textSize: c.text_size, photos: c.show_photos,
descriptions: c.show_descriptions, title: !!c.title, bars })
const per = c.page_size || rows * (c.columns || 2)
return menuPages(slide.menu?.groups || [], per, c.category_titles !== false)
}