feat: S5 onboarding scan-progress ring#72
Merged
Conversation
The registry re-emits session events with the tenant prepended (message/qr/ connected/…). Add history-progress to that set so the web onboarding flow can attribute WhatsApp's history-sync progress (0–100) to the requesting tenant — the feed for S5's onboarding scan-% ring. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add GET /api/onboarding/progress — an SSE stream that forwards the tenant's history-sync progress as `progress` frames and ends with a `done` frame at 100. Scoped to the requesting tenant only (mirrors the QR stream's isolation). Null progress (older syncs) keeps the stream open rather than ending early. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
After the WhatsApp link connects, WhatsApp streams the chat history. Replace the QR with a circular progress ring fed by /api/onboarding/progress, then load the app once the sync completes. A 90s safety timeout reloads anyway if the server never reports 100, so onboarding can't get stuck on this screen. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
S5 · Onboarding scan-progress ring
The last open roadmap slice (#55, epic #50) — the design's §1 step-2 "scanning your chats" ring shown after the WhatsApp link connects.
What changed (bottom-up)
collector—TenantSessionRegistry.wire()now re-emitshistory-progresswith the tenant prepended, the same way it already attributesmessage/qr/connected. This is the per-tenant progress feed.web—GET /api/onboarding/progress: an SSE stream that forwards the tenant's history-sync progress asprogressframes and ends with adoneframe at 100. Scoped to the requesting tenant only (mirrors the QR stream's isolation);nullprogress (older syncs) keeps the stream open rather than ending early.ui— afterconnected, the QR is replaced by a circular progress ring fed by/api/onboarding/progress; the app loads once the sync completes. A 90s safety timeout reloads anyway if the server never reports 100, so onboarding can't get stuck here.Scope note
This flow is multi-tenant-only — single-user mode has no login/onboarding pane, so the registry-backed onboarding routes aren't mounted. The whole feature only runs under
MULTI_TENANT=true.Verification
history-progresswith tenant attribution + isolation; the progress SSE streamsprogress→done, ignores other tenants, and stays open onnullprogress. Full suite 1320 passed.Gate
biome check·tsc --noEmit·build·vitest— all green (1320 passed).Closes #55.
🤖 Generated with Claude Code