From 8f1a08fefee3a8e928baec741c830a88a4cd7200 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 2 May 2026 10:41:12 +0900 Subject: feat(study): submit reviews offline via IndexedDB Move FSRS scheduling to a shared module so the client can compute next card state without contacting the server. StudyPage now writes the updated card and review log straight to IndexedDB and lets the existing sync engine push them on reconnect, instead of POSTing to /api/decks/:deckId/study/:cardId. Online sessions still trigger a sync immediately so server-side aggregates stay fresh; offline sessions accumulate in pendingCountAtom until the next online tick. The legacy study POST route is preserved for backwards compatibility. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/client/sync/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/client/sync/index.ts') diff --git a/src/client/sync/index.ts b/src/client/sync/index.ts index 9e86f2a..d565569 100644 --- a/src/client/sync/index.ts +++ b/src/client/sync/index.ts @@ -43,3 +43,10 @@ export { type SyncStatusType, syncQueue, } from "./queue"; +export { + cacheStudyCards, + type ServerStudyCard, + type SubmitReviewResult, + submitReviewLocal, + undoReviewLocal, +} from "./scheduler"; -- cgit v1.3.1