Skip to content

feat(study): Cheat sheet writing — split-view notes + hand-written cheat sheets#62

Open
Arpan420 wants to merge 5 commits into
developfrom
cheat-sheet
Open

feat(study): Cheat sheet writing — split-view notes + hand-written cheat sheets#62
Arpan420 wants to merge 5 commits into
developfrom
cheat-sheet

Conversation

@Arpan420

Copy link
Copy Markdown
Collaborator

Closes #27

SUMMARY
Implements the Cheat Sheet writing study method at /study/cheat-sheet. It's a split view: your existing Notes workspace on the left (reused as-is, fully editable) sits beside a new hand-written cheat-sheet library on the right — "two notes pages together."
Cheat-sheet writing is the study technique where you condense the material yourself, so there is deliberately no AI anywhere in this feature (no generation, no file-upload parsing). The right-hand editor has the same abilities as the notes editor (headings, lists, code, math, images) because it reuses the same NoteSurface editor.

WHAT'S INCLUDED
• New cheat_sheet table — a slim clone of note (no embedding / sourceType / file columns), so cheat sheets never appear in the Notes list or any AI/embedding filter. Migration drizzle/0013_dark_xorn.sql.
• API /api/cheat-sheets (GET/POST) and /api/cheat-sheets/[id] (PATCH/DELETE), mirroring the Notes routes — auth + ownership + class-ownership checks, { error } responses, 503 storage guard.
• Library UX — create / rename / duplicate / delete multiple named cheat sheets, optionally filed under a class, with optimistic updates and toasts.
• Collapsible list rails — each side's list can collapse to a slim strip so the editor gets nearly the full panel width; the two rails collapse independently.
• Marked the study card Live.

ARCHITECTURE AND REUSE
Follows the existing Associations / mind-map precedent for a persisted study feature (own table + hasCheatSheetStorage() probe + records module + page hydrates a client). Reuses NoteSurface, the lib/notes document/markdown helpers, and normalizeNoteWriteContent. Shared label/timestamp helpers were extracted to lib/notes/labels.ts (behavior-preserving) so both workspaces share one copy.

REVIEWER SETUP — RUN THE MIGRATION
This adds a table. After checkout, run:
pnpm db:migrate
Without it, the page degrades gracefully to a "storage not ready" message (the hasCheatSheetStorage() probe) rather than crashing.

NOTE ON THE SHARED NOTES COMPONENT
The left panel reuses the real NotesWorkspace, so the new collapse toggle also appears on the standalone /notes page. It's purely additive (off by default) — an enhancement there, not a regression. Can be gated behind a prop if we'd prefer it scoped to the split view only.

TESTING
• pnpm build (full typecheck) and pnpm lint are clean.
• Migration generated and applied locally.
• Manually tested in the browser.

BASE BRANCH
Targets mind-map (this branch was cut from it and reuses its study/notes patterns). Retarget to develop once mind-map merges.

OUT OF SCOPE (v1)
• Drag-and-drop reorder / multi-select on the cheat-sheet list (Notes keeps them).
• Resizable divider between panels (fixed 50/50 for now).

Arpan420 and others added 5 commits June 8, 2026 21:19
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>
@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
task-master Ready Ready Preview, Comment Jun 14, 2026 5:40pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Study Module: Cheat sheet writing workspace and study guide page

1 participant