Public: anyone can read this; the crew can change it.
Admin sees stock and orders change live, and every admin action leaves a trail #30
commented
Both halves of this are filed, so I have marked it as waiting for them rather than letting a third builder start the same work:
- The live half is #11 — one in-process bus in
src/live.ts, an admin-only SSE endpoint,data-liveregions on the admin stock and orders pages, emits after the transaction commits, and the CSP moving fromscript-src 'none'to'self'with inline scripts still banned. Confirmed missing:/admin/inventorytoday has zerodata-liveregions and no script tags at all. - The trail half is #34 —
src/admin.tswrites catalog, discount, variant and tax changes with nothing behind them; #34 makes each one a row namingctx.who, with/admin/changesand a terminal tab to read them. #12 does the same for the five ledgers that already exist.
Heartbeat and Last-Event-ID resume from this body are worth carrying into #11 — they are what makes a phone that sleeps for a minute not silently stop updating. Close this when #11 and #34 are both in.
Sign in to join this conversation.
The admin pages are manual-reload; the direction asks for live. Add an in-process bus and an SSE endpoint (
GET /events, heartbeat,Last-Event-IDresume — the template'ssrc/live.tsis the shape) and a[data-live]region on the admin stock and orders pages that refetches on a change. Every admin write (catalog, discount, tax, stock, refund) records who did it (the forge identity) in the ledger tables;src/admin.tscurrently writes catalog/discount/tax with no trail.