fix: quality-adjusted SM-2 first intervals and review UX freeze#10
Conversation
- sm2.py: first review now gives 4-day interval for Easy (quality>=4) and 2-day for Hard (quality==3) instead of always 1; Forgot unchanged - test_sm2.py: replace fixed-interval test with separate Easy/Hard cases - use-review.ts: fix query key mismatch — invalidate snippetKeys.due with clerkId to match useDueSnippets, not Supabase UUID; keep supabaseUserId for review log invalidation - review-session.tsx: track submittingRating (1|3|5|null) per click; wrap mutateAsync in try/catch so errors show an inline banner instead of silently freezing - review-card.tsx: spinner replaces label on the active rating button while request is in-flight; idle buttons dim to 40% (not 50%)
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughChanges update the SM-2 spaced repetition algorithm to use quality-based scheduling on first-memory success, update corresponding tests, and enhance the review card UI to display which rating is being submitted with improved error handling in the submission flow. Changes
Sequence DiagramsequenceDiagram
participant User
participant ReviewSession
participant ReviewCard
participant API as API/Mutation
User->>ReviewSession: Click rating button
activate ReviewSession
ReviewSession->>ReviewSession: Set submittingRating state
ReviewSession->>ReviewCard: Pass submittingRating prop
activate ReviewCard
ReviewCard->>ReviewCard: Render loader for active rating<br/>Show "Saving…" text
ReviewCard-->>ReviewSession: (visual feedback)
deactivate ReviewCard
ReviewSession->>API: mutateAsync (submit review)
activate API
alt Success
API-->>ReviewSession: Success response
ReviewSession->>ReviewSession: Advance session index/done
else Failure
API-->>ReviewSession: Error response
ReviewSession->>ReviewSession: Store submitError message
ReviewSession->>ReviewCard: Error banner renders
end
ReviewSession->>ReviewSession: Reset submittingRating (finally)
deactivate API
deactivate ReviewSession
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Review rate limit: 2/3 reviews remaining, refill in 20 minutes. Comment |
Summary by CodeRabbit
Release Notes
New Features
Improvements