From 7670db2c6ef95fce89f2f33a24d229412581ee95 Mon Sep 17 00:00:00 2001 From: mikael-lovqvists-claude-agent Date: Fri, 3 Apr 2026 03:12:51 +0000 Subject: [PATCH] Note: SSE-based live updates when data changes from any client Co-Authored-By: Claude Sonnet 4.6 --- future-plans.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/future-plans.md b/future-plans.md index 2292ace..98a76ac 100644 --- a/future-plans.md +++ b/future-plans.md @@ -21,6 +21,23 @@ that records every `set`/`delete` as a timestamped entry. The main file stays a clean current-state snapshot; the delta file accumulates the full history. Enables undo, audit trails, and debugging data corruption. +## Real-time / live updates + +### Server-sent events for data changes +When data changes on the server (upload, edit, delete — from any client), connected +browsers should receive a notification and update the affected view automatically. +Use case: uploading photos from a phone while the desktop browser has the Images or +Bins section open. + +Server-sent events (SSE) are the natural fit — lightweight, one-directional, no +library needed. The server emits a change event with a `type` (e.g. `source_images`, +`bins`) and the client re-fetches and re-renders only the affected collection. +Views that aren't currently visible don't need to do anything — they'll reload on +next navigation. + +Ties directly into the delta tracking plan: the same write path that appends to the +delta log can also fan out to connected SSE clients. + ## App architecture ### parse_url mutates too many module-level variables