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

+10
View File
@@ -23,6 +23,16 @@ It runs on **port 3001** (Vite dev) or as the `convivo-admin` Docker container
| **Events** | Create event, toggle active/inactive (a switch; only one can be active at a time — activating one deactivates the rest), edit dates/location + the **Sessionize endpoint** + the **Real-time clock** toggle (on = the attendee app uses the real system clock for Live/Next/Done; off = the simulated mid-event clock, the default). Each row has a **Sync** button that runs a (blocking) Sessionize sync and shows a result modal. |
| **Interfaces** | Manages the Sessionize sync **sidecar**: status (online / running / last run), a **Run sync** control (event picker + blocking run + result modal), an **Import Excel** control (upload the Sessionize "Sessions and speakers (advanced)" `.xlsx` + a "How to get this file" tooltip), and a **Recent runs** table from `sync_runs`. See [../backend/sidecar.md](../backend/sidecar.md). |
## Sessionize Source Editing
The Events editor accepts a Sessionize `All` or `GridSmart` URL, or the full
Sessionize `<script src="...">` tag, in the same multiline source field. Save
extracts and validates the HTTPS Sessionize URL and stores it as
`sessionize_endpoint`; the script is never executed. Invalid sources produce an
in-place error and are not saved. Active configured events sync at startup and
every 15 minutes by default; the existing Sync button still runs immediately.
See [source parsing and polling](../backend/sidecar.md#gridsmart-sources-and-polling).
## Auth guard
Login uses **email-only magic links**, with no password field, sign-in method
+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
+11
View File
@@ -138,6 +138,17 @@ from `slotStatus(slot, now)`
## Agenda
Demo status uses 10:20 on the active event's configured start date. Real-time mode
uses the system date/time instead; see [the event clock](./app-structure.md#the-event-clock-libtime-ts).
Service sessions named **Placeholder** (case-insensitive, trimmed) are displayed
inside an ordinary talk block when their date, start time and end time match
exactly. Other services, unmatched Placeholders and partial time overlaps retain
their own blocks. The displayed slot count reflects these merged blocks.
Grouping is presentation-only: original slot IDs and session types remain intact.
Merged Placeholders retain staff speakers, stay visible under level/area filters,
and have no pick control, speaker mic tag or pending-material requirement.
Lists all slots, each with its sessions, a **slot-type badge** (**Session** /
**Service Session** — the `slot_type` enum, capitalized), and a status pill
(**Done / ● Live / Up next**). The user's pick per slot is highlighted (filled