Skip to content

Multi-source Phase C2: onboarding wizard — populate-vs-empty + deep-history choice (#98)#108

Merged
jozef2svrcek merged 4 commits into
mainfrom
multi-source-c2-onboarding-wizard
Jun 30, 2026
Merged

Multi-source Phase C2: onboarding wizard — populate-vs-empty + deep-history choice (#98)#108
jozef2svrcek merged 4 commits into
mainfrom
multi-source-c2-onboarding-wizard

Conversation

@jozef2svrcek

Copy link
Copy Markdown
Contributor

Supersedes #101, which GitHub auto-closed when the C3 base branch was deleted on merge. Rebased onto main (C3 is now merged); diff is unchanged (SetupWizard.tsx only).

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:

  • Binary choicePopulate the reference database (recommended) vs Start with an empty database.
  • Populate path:
    • Currency: TWIC + Lichess Broadcasts auto-selected (the auto-updating feeds).
    • Deep history: Free (the bulk archive — currently Ajedrez OTB) · I own a commercial DB (reuses the existing AddGameDialog local PGN import path — no new backend) · 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 progress bar.
  • Express/Welcome/Done copy updated off TWIC; twic step + 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

jozef2svrcek and others added 3 commits June 30, 2026 22:53
…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
@jozef2svrcek jozef2svrcek merged commit 6d8d31d into main Jun 30, 2026
6 checks passed
@jozef2svrcek jozef2svrcek deleted the multi-source-c2-onboarding-wizard branch June 30, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-source Phase C2: onboarding wizard — populate-vs-empty + deep-history choice

1 participant