Problem: Users want to read commentary on a verse without leaving the chapter they're reading. A full-page commentary view would break the reading flow. The commentary needs to appear alongside the Bible text.
Solution: A slide-in drawer panel on the right side of the reader that shows commentary for the selected verse. It includes tabbed access to all three commentary sources (Matthew Henry, John Gill, Kanttekeningen) and can be opened and closed without losing the reading position.
Not included: Inline commentary (embedded between verses) or split-screen mode. The drawer is an overlay that doesn't reflow the Bible text.
When a user wants commentary on a verse, they click the verse → context menu → "Commentary". A drawer slides in from the right showing the commentary text with tabs for switching between sources.
User flow:
Edge cases:
text_nl is null, shows "(Alleen beschikbaar in het Engels)" and falls back to English text\n, empty lines filtered)Drawer layout:
Header:
Tab bar:
Content:
Responsive:
Component: CommentaryDrawer.svelte at apps/web/src/lib/components/bible/CommentaryDrawer.svelte
Data flow:
readModal state to { type: 'commentary', verse }CommentaryDrawer mounts and fetches GET /api/commentaries/[bookId]/[chapter]/[verse]source into a MapAPI: GET /api/commentaries/[bookId]/[chapter]/[verse]
commentaries (Pro+)[{ source, text, textNl, verseId }]max-age=86400Query: getCommentaries(verseId) in commentaries.ts — selects from commentaries WHERE verse_id matches
Tab order: SOURCE_ORDER = ['matthew_henry', 'john_gill', 'kanttekeningen_sv']
Dutch fallback: When lang === 'nl' and textNl is populated → show Dutch. When textNl is null → show English with "(Alleen beschikbaar in het Engels)" note.
Uses: Reuses the Drawer layout component with variant="right" and width="400px".
Files:
apps/web/src/lib/components/bible/CommentaryDrawer.svelte — main componentapps/web/src/routes/api/commentaries/[bookId]/[chapter]/[verse]/+server.ts — API endpointapps/web/src/lib/server/queries/commentaries.ts — getCommentaries(), getCommentariesForChapter()apps/web/src/lib/stores/readModal.svelte.ts — drawer state managementCurrent: DONE Milestone: v2 Priority: Core — the primary way users access commentary
History:
text_nl column was introducedDependencies: