Multi-source Phase C2: onboarding wizard — populate-vs-empty + deep-history choice (#98)#108
Merged
Merged
Conversation
…istory choice (#98) Replace the wizard's inline "download + import TWIC with a progress bar" step with a Sources step that keeps onboarding a simple binary and defers all detail to Maintenance → Sources (C1): - Populate the reference database (recommended) vs Start with an empty database. - Populate path: currency feeds (TWIC + Lichess Broadcasts) auto-selected, plus a deep-history choice — Free (the bulk archive, currently Ajedrez OTB), I own a commercial DB (reuses the existing local PGN import via AddGameDialog), or None. - One acknowledgment list with a per-source credit checkbox (non-commercial licences flagged), reusing the C1 credit_acked gate (sources_set_enabled with credit_acked). Enabling fires sources_sync jobs that run on the daemon in the background, so onboarding finishes immediately instead of blocking on a bar. Client-only: the commercial route and background sync both reuse existing backend job types; no new endpoints. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018gaUhu1KVkdxAjSJBLgbbk
…guards (#98) Address the high-effort code review of the new SourcesStep: - enableAndImport now catches a failing setSourceEnabled/submitJob, surfaces the error, and keeps the user on the step instead of silently dropping the failure (earlier sources may already be enabled; re-clicking is safe). - getSources failures show a distinct error + Retry rather than collapsing into an empty catalog that looks like "zero sources". - The primary button is gated on a non-empty selection, so an empty selection can no longer "complete" a no-op populate while reporting success. - The step's busy state is reported as (enabling || importing) via one effect, so the brief enable loop no longer clears the close guard while a commercial PGN import is still running. - Commercial mode: the embedded import now completes the step on success, and the primary button is relabelled "Enable live feeds & finish" with copy clarifying the commercial DB is imported separately. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018gaUhu1KVkdxAjSJBLgbbk
With Phase C3 (#99), enabling a source is enough — the daemon's scheduler picks up enabled-but-not-yet-synced sources and imports them in the background. So the onboarding wizard no longer submits a sources_sync per source; it just enables them (with the credit acknowledgment) and finishes. This resolves the C2 review follow-ups #6/#7 (no completion-before-data race from the wizard's side, and no redundant/duplicate sync jobs). Stacked on the C3 branch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018gaUhu1KVkdxAjSJBLgbbk
Reduce the setup wizard from 9 steps to 5 and align it with the async, daemon-driven import model: - Welcome: drop the Express/Advanced fork for a single "Get started" intro. - Remove the Players-import and own-database (PGN) import steps. - Split the old Sources step into two: Deep history (first) then Live feeds. - Fix the feed-selection bug: each source is now an independent checkbox where ticking IS the licence acknowledgment (enable + credit_acked in one gesture). Feeds are no longer forced — any subset (or none) can be chosen. - Drop the manual Dedup/Names/Index steps. With imports running asynchronously on the daemon, firing them at wizard time would run them before the games arrived. They are now surfaced on the Summary screen as automatic background maintenance (import -> dedup -> index -> normalise), with a pointer to the header activity indicator. The efficient, prompt, transparent first-run maintenance pipeline this Summary copy describes is tracked separately in #109. Bumps the wizard localStorage key to -v3 so stale persisted state from the old step set is discarded rather than mis-mapped. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LNz6kobBkfpYCxLgfTykcd
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.
Phase C2 of multi-source (#40). Redesigns the setup wizard's source step per the locked design: onboarding stays a simple binary, with all per-source detail deferred to Maintenance → Sources (C1, #97).
What changed (
SetupWizard.tsx, client-only)Replaces the inline "download + import TWIC with a progress bar" step with a Sources step:
AddGameDialoglocal PGN import path — no new backend) · None.credit_ackedgate (sources_set_enabledwithcredit_acked).sources_syncjobs that run on the daemon in the background, so onboarding finishes immediately instead of blocking on a progress bar.twicstep + its TWIC-only helpers/imports removed.Notes
Verification
npm run build(tsc + vite) passes clean on Node 22.Relates to #40. Closes #98.
🤖 Generated with Claude Code