Live sync
Open pages follow what other people change, in place and quietly, without a reload and without ever changing a form under the person typing in it.
An App asks for it with one key, and is off without it:
export default defineApp({ id: 'desk', name: 'Desk', live: true /* … */ });Provision the change store once, and every write the App serves (a Save, a command, a job, an agent’s) tells the pages that may read it:
tablewalk migrate stores up --db "$DATABASE_URL"A table whose writes nobody needs to see as they happen (a log, a hot
counter) stays out with live: false on its resource: its writes are not
filed, and a page over it refreshes as before. On an App that does not ask,
live: false changes nothing.
What a person sees:
- A list, a count, a dashboard tile is read again where it stands. A changed row is tinted for a moment, with no message.
- A record being viewed is read again, and the head says Updated by Ana just now (Updated just now where the history does not name a person the reader may see).
- A record being edited is never changed under the person. A notice says Ana changed this ticket, with Review changes, which lays their change beside the person’s own, and Keep editing.
- A list the person is working in (a row selected, a menu open, the pointer over the rows, scrolled or paged on) holds still behind 3 updates · Show, and shows them on click or two seconds after the person stops.
- A hidden tab lets its stream go after 30 seconds and reads once when it is shown again.
The stream carries which records changed, filtered by the reader’s own grants (a table or column they cannot read, a row outside their policy, are never mentioned), and never a value. The page asks again through the same reads it always used, so every rule those reads have still applies.
A dashboard no longer takes refresh. Under live sync it follows changes,
and re-reads what depends on the time (last 30 days, today) each minute;
without it, it re-reads all its reads each minute while the tab is visible.
--no-live turns live sync off for every App, even one that asks; a
database without the store serves as before. Changes made outside tablewalk
are not seen yet.