Multi-source Phase C2: onboarding wizard — populate-vs-empty + deep-history choice (#98)#101
Conversation
Code-review follow-ups (deferred from the #1–#5 fixes in 161b5d6)High-effort review surfaced these lower-severity findings on
(Refuted by the verify pass and intentionally not listed: |
…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
161b5d6 to
64a54ca
Compare
|
Rebased onto #103 (Phase C3) and simplified. This PR is now stacked on the C3 branch, so its diff is just the wizard delta on top of C3. The wizard's Merge order: merge #103 first; GitHub will then auto-retarget this PR's base to |
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