Problem: Bible study often reveals connections between passages. When a user has notes on both Genesis 1:1 and John 1:1, they may want to link those notes together to represent the thematic connection they've discovered.
Solution: Bidirectional links between notes. From the note editor, users can link the current note to any other note. Links are visible in both directions — if Note A links to Note B, Note B also shows a link to Note A.
Not included: Automatic link suggestions or graph visualization of linked notes. Links are manually created.
User flow:
Edge cases:
In the note editor:
DB table: note_links
id (PK), fromNoteId, toNoteId, createdAtfromNoteId and toNoteIdWHERE fromNoteId = X OR toNoteId = XAPI:
GET /api/notes/[id]/links — get all linked notes (bidirectional)POST /api/notes/[id]/links — create link ({ targetNoteId })DELETE /api/notes/[id]/links — remove link ({ targetNoteId })Query functions (notes.ts):
getNoteLinks(noteId, userId) — fetches linked note IDs via OR condition, then fetches those notes (filtered by userId for security)createNoteLink(fromNoteId, toNoteId) — inserts single directional rowdeleteNoteLink(fromNoteId, toNoteId) — deletes checking both directionsTier: Pro+ (noteCrossLinking: true)
Files:
apps/web/src/routes/api/notes/[id]/links/+server.ts — GET/POST/DELETEapps/web/src/lib/server/queries/notes.ts — link query functionsapps/web/src/lib/components/bible/NoteEditor.svelte — link UI in editorapps/web/src/lib/stores/notes.svelte.ts — noteLinks MapCurrent: DONE Milestone: v1 Priority: Medium — Pro differentiator
History:
Dependencies: