From cb848a616e284e51665485779ed805128efd06a0 Mon Sep 17 00:00:00 2001 From: Dinesh Pandiyan Date: Mon, 19 Oct 2026 20:23:37 +1100 Subject: [PATCH] feat: stream local collection and render available snapshots --- DESIGN.md | 6 +- apps/web/src/Header.tsx | 21 +- apps/web/src/session-context.tsx | 121 +++++---- apps/web/src/style.css | 3 +- apps/web/src/use-diff.ts | 36 ++- apps/web/test/browser/local-workspace.spec.ts | 212 +++++++++++++-- cmd/diffx/ingestion_test.go | 32 ++- cmd/diffx/local.go | 18 +- docs/architecture.md | 12 +- docs/development.md | 26 +- docs/system.md | 30 +- internal/collector/discovery.go | 137 +++++----- internal/collector/discovery_test.go | 256 +++++++++++++++++- internal/collector/workspaces.go | 103 +++++-- internal/daemon/foreground.go | 3 +- internal/daemon/server.go | 2 +- internal/daemon/server_test.go | 5 +- internal/serverapp/capabilities_test.go | 20 +- internal/serverapp/collection.go | 57 ++-- internal/serverapp/collection_test.go | 11 +- internal/serverapp/startup_collection_test.go | 128 ++++++++- packages/api/src/client.ts | 1 + 22 files changed, 968 insertions(+), 272 deletions(-) diff --git a/DESIGN.md b/DESIGN.md index e53fceca..49ff3069 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -494,7 +494,11 @@ Do not add motion for decoration. New animation must honor names, counts, progress percentages or addition/deletion colors. - Replace skeletons as data arrives, without a minimum display delay. Stored manifest loading uses the same diff-frame skeleton without unmounting Pierre. - Background Sync preserves the existing review and usable controls. Errors and + Open available stored snapshots while load-time Sync continues; use skeletons + only for unavailable data. Replace each file preview independently as it arrives. + Keep the header busy indicator active through collection and preview loading. + Background Sync preserves the existing review and usable controls; newer heads + use the existing “Newer snapshot” notice and explicit “View latest” action. Errors and empty results replace placeholders with their existing explanation and actions. ## Responsive design diff --git a/apps/web/src/Header.tsx b/apps/web/src/Header.tsx index dfdc5bf3..bed00573 100644 --- a/apps/web/src/Header.tsx +++ b/apps/web/src/Header.tsx @@ -1,4 +1,9 @@ -import { FolderSyncIcon, ListTreeIcon, RefreshCwIcon } from "lucide-react"; +import { + FolderSyncIcon, + ListTreeIcon, + LoaderCircleIcon, + RefreshCwIcon, +} from "lucide-react"; import { Button } from "@/components/ui/button"; import { AccountButton } from "./account.tsx"; import { ThemeButton } from "./ThemeButton.tsx"; @@ -74,10 +79,20 @@ export function Header() { size="icon" aria-label="Sync all checkouts" title="Sync all checkouts (Alt+R)" - aria-busy={collecting} + aria-busy={collecting || diff.busy} onClick={refresh} > -