Repository navigation
Merge offline-first PWA into web/ (keep configurable batch size) - #5
Merged
Merged
Conversation
Unifies the two diverged web copies into a single source of truth under web/: layers the offline-first PWA (from the standalone crosspoint-flashcards-web repo) on top of the mono-repo's configurable batch-size feature. The app now studies fully offline AND lets you set cards-per-batch (1-20). - engine.js: isomorphic (Node Buffer / browser Uint8Array shim). Batch size threaded through createNextBatch/restoreOrCreateBatch/selectNextCard/rateCard/ loadDeck via normalizeBatchSize (clamped [1,20]; BATCH_SIZE=20 stays the device-bin ceiling so serialized batches remain firmware-compatible). - server.js: serves the app shell + engine.js for the browser PWA; keeps /api/settings (batchSize) and threads settings.batchSize through openDeck/deckView (adds configuredBatchSize)/rate. - public/: split into shell (index.html) + offline client (app.js over IndexedDB, running the shared engine) + service worker (sw.js). Adds a Settings screen for batch size that applies locally at once and syncs. - test/test.js: keeps byte-parity + browser-path tests, adds batch-size tests. - agent/sync_agent.py: config.json credential fallback for non-interactive shells. Verified: 25/25 engine tests incl. real-device-bin byte-identical round-trip; local server smoke test (offline assets served, /api/settings clamp+persist, rating at a custom batch size refills the batch at the configured size). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
watchmesink
marked this pull request as ready for review
July 14, 2026 08:46
watchmesink
merged commit Jul 14, 2026
6960ca4
into
codex/flashcards-sm2pp-upload
1 of 6 checks passed
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.
What & why
The web app had diverged into two copies that were never merged:
crosspoint-flashcards-web(standalone) — the offline-first PWA (isomorphic engine + IndexedDB client + service worker), but fixed batch size.web/in this repo — an online-only SPA, but with configurable batch size.This unifies them into a single source of truth under
web/: the offline-first PWA plus configurable batch size. The app now studies fully offline and lets you set cards-per-batch (1–20).Changes
engine.js— isomorphic (NodeBuffer/ browserUint8Arrayshim). Batch size threaded throughcreateNextBatch/restoreOrCreateBatch/selectNextCard/rateCard/loadDeckvianormalizeBatchSize(clamped[1,20];BATCH_SIZE=20stays the device-bin ceiling so serialized batches remain firmware-compatible).server.js— serves the app shell +engine.jsfor the browser PWA; keepsGET/POST /api/settings(batchSize) and threadssettings.batchSizethroughopenDeck/deckView(addsconfiguredBatchSize) / rate.public/— split into shell (index.html) + offline client (app.jsover IndexedDB, running the shared engine) + service worker (sw.js, cachev4). Adds a Settings screen for batch size that applies locally immediately and syncs (dirty-flag push, else server pull).test/test.js— keeps byte-parity + browser-path (PortableBuffer) tests, adds batch-size tests.agent/sync_agent.py—~/.crosspoint_sync/config.jsoncredential fallback for non-interactive shells.Verification
node test/test.js→ 25/25 pass, including the real-device-bin byte-identical round-trip (engine stays firmware-compatible)./app.js,/sw.js,/engine.js) served200;/api/settingsclamps (999→20,0→1) and persists tosettings.json; rating via/api/decks/:deck/rateat a custom batch size (3) advances and refills the batch at the configured size.Deployed to the Railway
crosspoint-flashcardsservice; the standalonecrosspoint-flashcards-webfork is being retired.🤖 Generated with Claude Code