# Live data · Divan

> Live data should feel live. The database broadcasts that something changed over Supabase Realtime (WebSocket); the page re-reads its own data through the server, which applies every rule. A slow poll stays as a safety net.

Part of Divan, the DivanWorks design system. Web page: https://brand.divanworks.com/live · All topics: https://brand.divanworks.com/llms.txt

## Rules

- Use connectLive (src/lib/episode-live.svelte.ts) style: subscribe to a public topic, debounce bursts, re-read with invalidate.
- Every backoffice page is live without code of its own: the layout listens on the topics of the tables the page reads (LIVE_TABLES in src/lib/backoffice-live.ts, "bo:<table>", sent once per statement by the trigger in supabase/migrations/*_backoffice_realtime.sql) and the page header shows the live dot while the socket is up. A new page adds its tables there (a test fails when a menu page is missing), never its own setInterval. A page fed by an outside service that keeps moving with no row changing here (Live: Cloudflare and PostHog) gets a beat in LIVE_TICK instead.
- Show that a view is live with <Status tone="success">Live</Status> and a gentle pulse; numbers that change count up (CountUp).
- Slow data streams in: return promises from load and show Skeletons until they answer, so the page appears at once. Each re-read brings new promises: keep a part’s last answer on screen while the next comes (in Studio never inside {#await data.…}: reread-drops-view), and a view a person moved stays where they left it.
- Optimistic UI for the person’s own actions: show the result at once, roll back with a Note if it fails.
