feat(flashcards): UX revamp with cross-deck review and gamification#135
Merged
feat(flashcards): UX revamp with cross-deck review and gamification#135
Conversation
Change ELEVEN_LABS_API_KEY to ELEVENLABS_API_KEY to match the deployment configuration in GitHub Actions workflows. Closes #129 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace hardcoded "spanish"/"latin" string matching with dynamic language name lookup. Now correctly detects translation direction for all supported languages including Icelandic. Closes #130 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add getExerciseFeedback() utility for language-specific success/failure messages - Update FillBlankExercise, MultipleChoiceExercise, and TranslationExercise to accept language prop and display localized feedback - Update ExercisesRegion to pass language prop to exercise components Feedback by language: - Spanish: ¡Correcto! / No del todo - Latin: Recte! / Non recte - Icelandic: Rétt! / Ekki alveg Closes #131 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add dark mode variants to NotificationSettings component (alerts, status boxes) - Add dark mode variants to PWAInstallBanner component - Add dark mode variants to Flashcards deck management page (25+ fixes) - Add dark mode variant to Flashcards practice page (mark element) - Replace text-sepia-* with semantic text-foreground/text-muted-foreground - Add E2E tests for multi-language exercise feedback Closes #133 (related diagnosis) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace min-h-screen with min-h-[100dvh] for dynamic viewport height - Remove redundant min-h-screen from nested mobile dashboard container - Update hub-container and classic-container CSS classes - Add pb-8 to mobile dashboard for proper bottom spacing The 100dvh unit uses dynamic viewport height which properly accounts for mobile browser chrome (address bar) appearing/disappearing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Schema changes: - Add language field to flashcard_decks (es, la, is, mixed) - Add gamification fields to user_profiles (streak_freezes_available, streak_freeze_used_at, gamification_enabled) - Add trigger to auto-populate deck language from course - Add trigger to award streak freeze every 7-day streak milestone API updates: - Update get_due_flashcards RPC with language filter parameter - Add get_due_counts_by_language RPC for dashboard stats - Add /api/flashcards/stats/due-by-language endpoint - Add /api/flashcards/stats/gamification GET/PATCH endpoints - Update practice API with mode=all and language filter support - Integrate XP awards into review endpoint (5 XP/card, 25 completion bonus) New review page (/flashcards/review): - 3D flip animation with CSS transforms - Touch swipe gestures (up to reveal, left/right to rate) - Dominant "Good" button with secondary rating options - XP gain animation overlay - Cross-deck review with language filtering via query params - Keyboard shortcuts (Space, 1-4, Esc) Dashboard updates: - Cross-deck "Review All Due" button with total due count - Language filter buttons showing per-language due counts - Gamification stats display (XP, streak, freezes) - Language badge on deck cards Profile page: - Gamification settings section with toggle - Stats display (XP, streak, level, freezes) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests: - Add 38 unit tests for flashcard service (MockScheduler, XP_AWARDS, cloze parsing) - Add E2E tests for flashcard review flows (flip animation, keyboard shortcuts, rating) Dashboard: - Add FlashcardCTA component showing due card count - Display on both mobile and desktop dashboard views - Links to cross-deck review when cards are due Reader/Library Fixes: - Fix language auto-select when loading readings (API now returns language field) - Add title input field to TextInputPanel for custom reading titles - Fix library service to transform timestamps (snake_case to camelCase) - Fix library service to return actual language instead of hardcoded 'es' - Add Icelandic language support to LibraryCard display 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Owner
Author
🧪 User Acceptance Testing (UAT) GuidePre-requisites
1️⃣ Flashcard Dashboard & Review Flow1.1 Cross-Deck Review
1.2 Single Deck Review
1.3 Keyboard Shortcuts
2️⃣ Dashboard Flashcard CTA
3️⃣ Gamification Toggle
4️⃣ Reader Language Auto-Select4.1 From Lesson
4.2 From Library
5️⃣ Reader Title Input
6️⃣ Library Timestamps & Language Display
📋 Test Coverage Summary
✅ Sign-off Checklist
|
- Replace Part IV "Technical Deep Dive" with "The Opportunity" - Add market size, underserved segments, timing factors - Add B2C/B2B customer segments with pricing - Add competitive advantage matrix - Add "What We Need" launch/scale roadmap - Keep Parts I-III: Problem, Demo, Roadmap 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The get_due_flashcards function references f.cloze_count but this column wasn't added to the flashcards table. This fix: 1. Adds cloze_count column to flashcards table 2. Creates index for efficient cloze card queries 3. Backfills existing cloze cards with correct count Without this, practice endpoint fails with: "column f.cloze_count does not exist" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changed XP gain animation from: - Centered, bouncing, large overlay blocking card view To: - Top-right corner toast-style notification - Smaller, pill-shaped badge with fade-in animation - No longer obstructs the next card 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Owner
Author
✅ UAT CompleteTests PerformedCross-Deck Review
Flashcard Review Flow
XP Animation
Gamification Elements
Fixes Cherry-Picked from UAT
Migrations Required
Ready to merge 🚀 |
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.
Summary
Major UX revamp of the flashcard system implementing Anki-like power-user efficiency with Duolingo-style gamification (toggleable).
Schema Changes
languagefield toflashcard_decks(es, la, is, mixed) with auto-inheritance from courseuser_profiles:streak_freezes_available,streak_freeze_used_at,gamification_enabledAPI Enhancements
mode=alland language filtering/api/flashcards/stats/due-by-languagefor language-grouped due counts/api/flashcards/stats/gamificationfor GET/PATCH gamification settingsNew Review Page (
/flashcards/review)Dashboard Updates
Profile Page
Test Plan
🤖 Generated with Claude Code