feat(study/spaced-repetition): note review scheduling + calendar integration#63
Open
Arpan420 wants to merge 7 commits into
Open
feat(study/spaced-repetition): note review scheduling + calendar integration#63Arpan420 wants to merge 7 commits into
Arpan420 wants to merge 7 commits into
Conversation
Implements the Associations study module (issue #28): an interactive mind-map surface where users create topics, connect them, and label the meaning of each connection, plus AI generation of a starter map from notes. What changed: - lib/mind-maps: types/Zod schemas, row converters, storage guard (hasMindMapStorage), shared auth+ownership API guard, note context loader, and Gemini generation (generateAssociationMap). - API under app/api/mind-maps: CRUD for maps, nodes, and edges, plus a /generate route that builds a map from selected notes. All routes are auth/storage/ownership guarded; ids generated with crypto.randomUUID(). - components/mind-map: custom SVG canvas (no new dependency) with pan/drag/connect/label/delete; node position = center; AI-suggested edges render as dashed accent lines. - app/associations/associations-client.tsx: library / generate / editor view-state workspace with the method explainer and a note picker. - Server page rewritten from the StudyMethodPage scaffold to load maps + notes; study overview flips Associations to live. - drizzle/0012_warm_gravity.sql: migration creating mind_map, mind_map_node, mind_map_edge (additive; not yet applied to any environment). Why: gives learners a visual associations surface backed by the existing Gemini setup, reusing the quizzes/flashcards generation patterns. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a Cheat Sheet study feature at /study/cheat-sheet: the existing Notes workspace on the left (reused, fully editable) beside a new hand-written cheat-sheet library on the right. No AI involved by design. - New cheat_sheet table (slim note clone) + migration 0013 - lib/cheat-sheets records + storage probe, reusing lib/notes helpers - /api/cheat-sheets GET/POST and [id] PATCH/DELETE, mirroring notes routes - Workspace/list client reusing NoteSurface editor - Extract shared label helpers to lib/notes/labels.ts - Flip study card to Live Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add an independent collapse/expand toggle to each list sidebar so the editor can take nearly the full panel width. Collapsing shrinks a rail to a slim strip with expand + new shortcuts (never a stuck state). - New shared CollapsedRail component (components/ui) - Wire collapse state into notes and cheat-sheet workspaces Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…gration Replace the spaced-repetition scaffold with a working long-term review feature. Users enroll existing notes, which are scheduled on an expanding interval ladder (1d, 3d, 7d, 14d, 30d, 60d) anchored to enrollment. Each note's next review surfaces on the calendar. The study session is read-only (no editing): it renders the note's markdown, runs a study timer, shows trackers (next review, last reviewed, review count, total time), takes a self-rating (Again/Hard/Good/Easy) that adjusts the next interval, and prompts a quiz for embedded notes. Isolated and additive like the cheat-sheet feature; the only pre-existing file touched besides schema is the calendar page, which merges review events. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Closes #26
Adds a Spaced repetition study technique at /study/spaced-repetition. You enroll existing notes into a long-term review schedule; each note's next review is surfaced on the Calendar. The study session is read-only: it renders the note, runs a study timer, shows trackers (next review, last reviewed, review count, total study time), takes a self-rating, and prompts a quiz for embedded notes.
Scheduling
Reviews advance on a fixed expanding interval ladder of 1, 3, 7, 14, 30, and 60 days, anchored to when a note is enrolled. After each session you self-rate and the next interval adjusts: Again resets to the start, Hard repeats the current interval, Good advances one step, Easy advances two.
Note: this is intentionally not FSRS. It is a simple, predictable ladder rather than a per-note memory model that tracks stability/difficulty/retrievability. The scheduling logic is isolated in lib/spaced-repetition/scheduling.ts so it can be swapped for FSRS later without touching the UI, API, or calendar code.
Spaced Rep Flow
Users add study material to the workflow, the system schedules follow-up reviews at increasing intervals, and review timing updates as you progress through repetitions, framed as a long-term aid rather than a one-time timer.
Verification (just pnpm db:migrate)
New spaced_rep_entry table and migration applied. Type-check and lint clean; production build passes. Manual UI testing pending.