Fix plan days with no chapters, add a way out of ink mode, harden ntfy reminders
Build and Push Docker Image / build-and-push (push) Failing after 19s
Build and Push Docker Image / build-and-push (push) Failing after 19s
Plans can no longer have more days than chapters (existing ones heal), and opening a plan never strands the Reader on an empty day. The Reader shows Done drawing while inking (Escape also exits). Reminders use the user's own timezone, send within a 3 hour grace window, and Settings has a Send test notification button. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ecb1c701fa
commit
297f2c7e84
14 files changed
+335
-58
No files matched your search
@@ -3,7 +3,7 @@
|
||||
import { useState, useEffect, useRef, useMemo, useDeferredValue } from 'react';
|
||||
import { useApp } from '../context/AppContext.js';
|
||||
import { bookOptions } from '../utils/bibleUtils.jsx';
|
||||
import { getPlan, getPlanSchedule, findDayIndexForRef, formatDayReadings, nextUnreadDayIndex, computeStreak } from '../utils/readingPlans.js';
|
||||
import { getPlan, getPlanSchedule, findDayIndexForRef, formatDayReadings, nextUnreadDayIndex, computeStreak, nearestReadingDay } from '../utils/readingPlans.js';
|
||||
import DrawCanvas from './DrawCanvas.jsx';
|
||||
import { READER_TRANSLATIONS } from '../hooks/useBibleReader.js';
|
||||
import { useBibleSearch } from '../hooks/useBibleSearch.js';
|
||||
@@ -162,11 +162,15 @@ export default function ReaderPage() {
|
||||
};
|
||||
const goToRef = (r) => goTo(r.book, r.chapter);
|
||||
|
||||
// Opens a day of the context plan on its first unread chapter.
|
||||
// Opens a day of the context plan on its first unread chapter (or the nearest day that has one).
|
||||
const goDay = (progressId, dayIndex) => {
|
||||
const info = planInfo(planProgress.find((p) => p.id === progressId), dayIndex);
|
||||
const progress = planProgress.find((p) => p.id === progressId);
|
||||
if (!progress) return;
|
||||
const schedule = getPlanSchedule(progress.planId);
|
||||
const day = schedule[dayIndex]?.length ? dayIndex : nearestReadingDay(schedule, dayIndex);
|
||||
const info = day >= 0 ? planInfo(progress, day) : null;
|
||||
if (!info) return;
|
||||
setReaderPlan({ progressId, dayIndex });
|
||||
setReaderPlan({ progressId, dayIndex: day });
|
||||
const target = info.refs.find((r) => !info.readSet.has(`${r.book}.${r.chapter}`)) ?? info.refs[0];
|
||||
if (target) goToRef(target);
|
||||
};
|
||||
@@ -232,7 +236,7 @@ export default function ReaderPage() {
|
||||
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.isContentEditable) return;
|
||||
if (e.key === 'ArrowLeft') readerGoToPreviousChapter();
|
||||
else if (e.key === 'ArrowRight') readerGoToNextChapter();
|
||||
else if (e.key === 'Escape') { if (sheet) closeSheet(); else setReaderSelectedVerse(null); }
|
||||
else if (e.key === 'Escape') { if (sheet) closeSheet(); else if (readerDrawMode) setReaderDrawMode(false); else setReaderSelectedVerse(null); }
|
||||
};
|
||||
window.addEventListener('keydown', handleKey);
|
||||
return () => window.removeEventListener('keydown', handleKey);
|
||||
@@ -336,6 +340,7 @@ export default function ReaderPage() {
|
||||
onBookmarks={() => openSheet('bookmarks')}
|
||||
bookmarkCount={bookmarkEntries.length}
|
||||
onSettings={() => openSheet('settings')}
|
||||
onDoneDrawing={readerDrawMode ? () => setReaderDrawMode(false) : undefined}
|
||||
/>
|
||||
)}
|
||||
{!chromeVisible && (
|
||||
|
||||
Reference in new issue
Block a user