aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-08 21:26:05 +0900
committernsfisis <nsfisis@gmail.com>2026-02-08 21:26:05 +0900
commit5c1fb77776f0cf3647a7f43a0f5a6b254d2f97ad (patch)
treec59de0fe383f905b4794433632199c84a33d29d4 /src
parentc0d092b3bfef491d9aa02a4e7e8f503ea35e6420 (diff)
downloadkioku-5c1fb77776f0cf3647a7f43a0f5a6b254d2f97ad.tar.gz
kioku-5c1fb77776f0cf3647a7f43a0f5a6b254d2f97ad.tar.zst
kioku-5c1fb77776f0cf3647a7f43a0f5a6b254d2f97ad.zip
refactor(study): remove legacy card fallback and comments
All cards now use note-based template rendering. The legacy front/back fallback path is no longer needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src')
-rw-r--r--src/client/db/index.ts1
-rw-r--r--src/client/pages/StudyPage.tsx20
2 files changed, 6 insertions, 15 deletions
diff --git a/src/client/db/index.ts b/src/client/db/index.ts
index 53df476..59cc526 100644
--- a/src/client/db/index.ts
+++ b/src/client/db/index.ts
@@ -243,7 +243,6 @@ export class KiokuDatabase extends Dexie {
});
// Version 3: noteId and isReversed are now required (NOT NULL)
- // No migration needed as production has no legacy data without notes
this.version(3).stores({
decks: "id, userId, updatedAt",
cards: "id, deckId, noteId, updatedAt, due, state",
diff --git a/src/client/pages/StudyPage.tsx b/src/client/pages/StudyPage.tsx
index eccdb50..92d655e 100644
--- a/src/client/pages/StudyPage.tsx
+++ b/src/client/pages/StudyPage.tsx
@@ -188,23 +188,15 @@ function StudySession({ deckId }: { deckId: string }) {
const hasNoCards = cards.length === 0;
const remainingCards = cards.length - currentIndex;
- // Compute rendered card content for both legacy and note-based cards
const cardContent = useMemo(() => {
if (!currentCard) return null;
- // Note-based card: use template rendering
- if (currentCard.noteType && currentCard.fieldValuesMap) {
- const rendered = renderCard({
- frontTemplate: currentCard.noteType.frontTemplate,
- backTemplate: currentCard.noteType.backTemplate,
- fieldValues: currentCard.fieldValuesMap,
- isReversed: currentCard.isReversed ?? false,
- });
- return { front: rendered.front, back: rendered.back };
- }
-
- // Legacy card: use front/back directly
- return { front: currentCard.front, back: currentCard.back };
+ return renderCard({
+ frontTemplate: currentCard.noteType.frontTemplate,
+ backTemplate: currentCard.noteType.backTemplate,
+ fieldValues: currentCard.fieldValuesMap,
+ isReversed: currentCard.isReversed ?? false,
+ });
}, [currentCard]);
return (