feat: sync GridSmart agendas and use event-relative demo time

Support script and URL sources, automatic Sessionize polling, staff-linked service sessions, chronological agenda blocks, and inline Placeholders. Fix demo mode to use the active event date and document deployed behavior with regression coverage.
This commit is contained in:
Lago committed 2026-10-11 08:39:15 +02:00
1 parent 40f24cf5f7
commit c0fbf495dc
27 files changed
+1215 -60

No files matched your search

+13 -12
View File
@@ -76,24 +76,26 @@ The app drives slot status (Live / Up next / Done) from a **"now"** that is
either the **real system clock** or a **simulated mid-event clock**, decided per
event by the `events.use_realtime_clock` flag (see
[admin-app.md](./admin-app.md) for the toggle). By default it's the simulated
clock, so the demo always looks mid-event:
clock, using the active event's first day at 10:20:
```ts
export const EVENT_DATE = '2026-02-20';
export const DEFAULT_NOW = new Date(`${EVENT_DATE}T10:20:00`);
export function demoNow(eventDate: string): Date {
return new Date(`${eventDate}T10:20:00`);
}
```
`EVENT_DATE` matches the seed's event day. `DEFAULT_NOW` is frozen at **10:20 on
the event day**, so the demo shows a live session no matter what the actual
calendar date is (open it on 25 Aug 2026 and it still looks like it's 10:20 on
20 Feb).
`demoNow(event.start_date)` is frozen at **10:20 on the active event's start
date**, independent of the actual calendar date. Changing the active event or
its configured start date changes the simulated date after the event data loads.
There is no hardcoded seed date. The demo time remains intentionally fixed; an
event without a session at 10:20 may have no Live session.
`useEvent()` picks the clock from the flag and exposes both the resulting `now`
and which mode it used:
```ts
const clockMode: 'simulated' | 'realtime' = event?.use_realtime_clock ? 'realtime' : 'simulated';
const now = clockMode === 'realtime' ? new Date() : DEFAULT_NOW;
const now = clockMode === 'simulated' && event ? demoNow(event.start_date) : new Date();
```
The Home header shows a **🎬 Demo clock** indicator only when the simulated
@@ -130,10 +132,9 @@ At the frozen `10:20`, the seed's slots resolve to:
So the Home screen shows a live Now card, an upcoming Next card, and a done slot
that can carry a pending-feedback nudge.
> **Why a simulated clock by default?** The event day (20 Feb 2026) is in the
> past relative to "today", so a real clock would mark **every** slot `done` —
> there'd be no Live or Next card, just a wall of "Done". The frozen clock is
> what keeps the demo looking alive on any date.
> **Why a simulated clock by default?** Outside an event's dates, a real clock
> would show all slots as either future or past. The simulated clock lets the
> event be demonstrated at a predictable time on its configured first day.
> **Using the real clock.** This is a **frontend-only** concern — the database
> stores real slot times; the clock only decides which slot is "live" for