Skip to content

Ajedrez: one-shot "Download & import" action instead of a toggle (#196)#199

Merged
jozef2svrcek merged 1 commit into
mainfrom
ajedrez-one-shot-import-196
Jul 25, 2026
Merged

Ajedrez: one-shot "Download & import" action instead of a toggle (#196)#199
jozef2svrcek merged 1 commit into
mainfrom
ajedrez-one-shot-import-196

Conversation

@jozef2svrcek

Copy link
Copy Markdown
Contributor

Closes #196.

Ajedrez is a one-time deep-history base (≤ 2012-12-31), not a subscription — so the enable/disable toggle didn't fit.

Frontend

Bulk-kind source cards now show a single Download & import button (licence acknowledgment inline on a first run) instead of a toggle. It:

  • enables the source + records the ack (so it counts toward coverage), then
  • submits sources_syncdownload + import + full maintenance (bulk already requests the full identity-first pass).

Idempotent (the decided behaviour): a re-run imports only parts not yet imported — finishing a partial import, otherwise a cheap no-op. The button reads "Re-run import" once imported and "Importing…" (disabled) while a sync is in flight, so it can't be double-fired. Header shows a one-time chip instead of a switch.

Backend

Bulk sources are excluded from the recurring scheduler — feeds_due_for_resync is now feed-kind only — so Ajedrez is never auto-synced on the daily cadence; only its explicit action triggers it. (The wizard's first-run pipeline still imports it via enabled_sources_ordered, unchanged.)

Deferred

The ticket's open question — a "remove Ajedrez data" action on the card — is out of scope here; easy to add later if wanted.

Tests

  • Bulk sources are never returned by feeds_due_for_resync; feeds still are.

Build + clippy (-D warnings) + 46 chess-db tests green; frontend builds.

🤖 Generated with Claude Code

https://claude.ai/code/session_019KdPPg7P3bZ5p2RRhZZcv2

Ajedrez is a one-time deep-history base (≤ 2012-12-31), not a subscription,
so the enable/disable toggle didn't fit.

Frontend: bulk-kind source cards now show a single **Download & import**
button (with the licence acknowledgment inline for a first run) instead of
a toggle. It enables the source, records the ack, and submits `sources_sync`
— download + import + full maintenance (bulk → full, already the coalesced
default). Idempotent: a re-run imports only parts not yet imported (the #191
registration dedupe), so it finishes a partial import and otherwise no-ops;
the button reads "Re-run import" once imported and "Importing…" (disabled)
while a sync is in flight, so it can't be double-fired.

Backend: bulk sources are excluded from the recurring scheduler
(`feeds_due_for_resync` is now feed-kind only), so Ajedrez is never
auto-synced on the daily cadence — only via its explicit action.

Deferred (the ticket's open question): a "remove Ajedrez data" action is
out of scope here.

Tests: bulk sources are never auto-synced; feeds still are.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019KdPPg7P3bZ5p2RRhZZcv2
@jozef2svrcek
jozef2svrcek merged commit 40347ba into main Jul 25, 2026
6 checks passed
jozef2svrcek added a commit that referenced this pull request Jul 25, 2026
…jedrez, per-card metrics + incremental dedup

Lands the tested batch behind the 0.9.9 draft:

- #194 (PR #200): configurable daily update-check time + next-run visibility.
- #195 (PR #198): enabling a feed triggers an immediate sync.
- #196 (PR #199): Ajedrez one-shot "Download & import" action instead of a toggle.
- #197 (PR #201): per-source metrics moved into each card; aggregated blocks dropped.
- PR #203: crisp high-contrast toggle icon.

Plus follow-up work validated during testing:
- Incremental dedup_games via a `deduped` marker; unified single maintenance pass
  (supersedes the closed PR #204).
- Sync init shows the indeterminate bar instead of a stuck 100%.
- Enable-flag write persists before the sync is dispatched; toggle state derived
  from the job pipeline + a module-level intent store, so it survives navigation.
- FIDE card reflects background (scheduler / post-sync) refreshes.
- Coalesced maintenance is pinned to the queue tail the moment a feed is enabled.
@jozef2svrcek
jozef2svrcek deleted the ajedrez-one-shot-import-196 branch July 25, 2026 22: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.

Ajedrez: one-shot "Download & import" action instead of a subscribe toggle

1 participant