From 31fa4b3f7717c5243e314732fa6e270fbd3b73f1 Mon Sep 17 00:00:00 2001 From: nmemmert Date: Wed, 12 Aug 2026 08:55:36 -0400 Subject: [PATCH] Show scripture text with drawable overlay in draw mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DrawCanvas now accepts a headerContent prop — when provided, a transparent canvas extends over the scripture text so you can draw directly on the verses, with ruled notebook space below for additional notes. Study page draw mode shows the full chunk passage this way instead of a compact unwritable strip. Reader page draw mode replaces the verse list with the same combined layout (all chapter verses + notebook canvas), hiding the verse list while active. Co-Authored-By: Claude Sonnet 4.6 --- src/pages/DrawCanvas.jsx | 39 +++++++++++++++++++++++++------------ src/pages/ReaderPage.jsx | 22 +++++++++++++++++---- src/pages/StudyPage.jsx | 42 ++++++++++++++++++---------------------- 3 files changed, 64 insertions(+), 39 deletions(-) diff --git a/src/pages/DrawCanvas.jsx b/src/pages/DrawCanvas.jsx index f7b54b4..86d7274 100644 --- a/src/pages/DrawCanvas.jsx +++ b/src/pages/DrawCanvas.jsx @@ -13,7 +13,9 @@ const INK_SIZES = [ // strokes: array of saved stroke objects // onStrokesChange: (newStrokes) => void // onDone: optional () => void — shows "Done" button when provided -export default function DrawCanvas({ strokes, onStrokesChange, onDone }) { +// headerContent: optional JSX rendered above the notebook area. +// The canvas extends over it so you can draw directly on the content. +export default function DrawCanvas({ strokes, onStrokesChange, onDone, headerContent }) { const { drawTool, setDrawTool, drawColor, setDrawColor, drawSize, setDrawSize } = useApp(); const canvasRef = useRef(null); @@ -200,17 +202,30 @@ export default function DrawCanvas({ strokes, onStrokesChange, onDone }) { )} - {/* Notebook canvas */} -
- {/* Red margin line */} -
+ {/* Draw surface: optional scripture header + ruled notebook, one canvas over both */} +
+ {/* Scripture content — canvas sits on top so you can draw directly on the text */} + {headerContent && ( +
+ {headerContent} +
+ )} + {/* Ruled notebook area */} +
+ {/* Red margin line — only in pure-notebook mode */} + {!headerContent && ( +
+ )} + {/* Single canvas spanning the entire area (scripture + notebook) */}
- {/* Verses */} -
+ {/* Verses — hidden when draw mode is active */} +

{readerBook?.name} {readerChapter} (BSB)

@@ -433,13 +433,27 @@ export default function ReaderPage() { })()}
- {/* Ink notebook — shown when Draw mode is active */} + {/* Draw mode — scripture text visible with canvas overlay + ruled notebook below */} {readerDrawMode && ( -
+
updateReaderPageInk(readerBookAbbrev, readerChapter, s)} onDone={() => setReaderDrawMode(false)} + headerContent={ + <> +
+ {readerBook?.name} {readerChapter} + BSB · draw on me +
+ {!readerLoading && readerVerses.map((v) => ( +

+ {v.number}.{' '} + {v.text} +

+ ))} + + } />
)} diff --git a/src/pages/StudyPage.jsx b/src/pages/StudyPage.jsx index 27083fc..3b65308 100644 --- a/src/pages/StudyPage.jsx +++ b/src/pages/StudyPage.jsx @@ -244,31 +244,27 @@ export default function StudyPage() { {selectedChunk ? (
{studyLayout === 'annotate' ? ( -
- {/* Compact scripture strip */} -
-
- Scripture · read-only - - {formatChunkReference(project, selectedChunkChapterIndex, selectedChunk, '–')} - -
-

- {selectedChunkVerses.map((verse) => ( - - {verse.chapter}:{verse.number} - {verse.text}{' '} + updateChunk(selectedChunk.id, { inkStrokes: s })} + onDone={() => setStudyLayout('stacked')} + headerContent={ + <> +

+ Scripture · draw on me + + {formatChunkReference(project, selectedChunkChapterIndex, selectedChunk, '–')} +
+ {selectedChunkVerses.map((verse) => ( +

+ {verse.chapter}:{verse.number}.{' '} + {verse.text} +

))} -

-
- {/* Notebook canvas */} - updateChunk(selectedChunk.id, { inkStrokes: s })} - onDone={() => setStudyLayout('stacked')} - /> -
+ + } + /> ) : (
{/* Scripture */}