Implement Bible desk study layout

This commit is contained in:
2026-07-15 18:51:35 -05:00
parent 55f7014aea
commit f2b99cec3c
13 changed files with 1034 additions and 310 deletions
+25 -2
View File
@@ -23,14 +23,25 @@ export type TimelineEntry = {
detail?: string
}
export type VerseAnchor = {
book: string
chapter: number
startVerse: number
endVerse: number
reference: string
translationId: string
}
export type SessionNote = {
id: string
kind: 'draft'
kind: 'draft' | 'margin'
body: string
createdAt: string
updatedAt: string
reference?: string
translationId?: string
anchor?: VerseAnchor
markers?: string[]
}
export type StudySession = {
@@ -73,9 +84,15 @@ export type StudySettings = {
showDictionaryPanel: boolean
splitPercent: number
notesPinned: boolean
bibleColumnPercent: number
marginColumnPercent: number
studyStackPinned: boolean
activeStudyBook: StudyBook
themeMode: ThemeMode
}
export type StudyBook = 'notebook' | 'dictionary' | 'lexicon' | 'atlas' | 'commentary' | 'search'
export type WorkspaceSnapshot = {
schemaVersion: number
sessions: StudySession[]
@@ -130,6 +147,10 @@ export function defaultStudySettings(): StudySettings {
showDictionaryPanel: true,
splitPercent: 50,
notesPinned: false,
bibleColumnPercent: 40,
marginColumnPercent: 20,
studyStackPinned: true,
activeStudyBook: 'notebook',
themeMode: 'light',
}
}
@@ -204,12 +225,14 @@ function normalizeSessionNotes(session: Partial<StudySession>): SessionNote[] {
if (Array.isArray(session.notes) && session.notes.length) {
return session.notes.map((note) => ({
id: note.id || timelineId(),
kind: 'draft',
kind: note.kind === 'margin' ? 'margin' : 'draft',
body: note.body ?? '',
createdAt: note.createdAt ?? session.createdAt ?? new Date().toISOString(),
updatedAt: note.updatedAt ?? session.updatedAt ?? new Date().toISOString(),
reference: note.reference,
translationId: note.translationId ?? session.baseTranslation,
anchor: note.anchor,
markers: Array.isArray(note.markers) ? note.markers : [],
}))
}