Skip to content

feat(v0.3.1): Navigation & Polish — 6 features#7

Merged
steveanil merged 13 commits into
mainfrom
feat/v0.3.1
Mar 28, 2026
Merged

feat(v0.3.1): Navigation & Polish — 6 features#7
steveanil merged 13 commits into
mainfrom
feat/v0.3.1

Conversation

@steveanil
Copy link
Copy Markdown
Owner

@steveanil steveanil commented Mar 28, 2026

Summary

v0.3.1 "Navigation & Polish" patch release implementing all 6 remaining features from the roadmap:

  • MiniSearch index caching — Serializes search indexes to IndexedDB between sessions, eliminating cold-start rebuild latency (~31K verses per translation)
  • Reading time estimate — Displays "~N min read" in the chapter nav bar, calculated from verse word count and adjustable reading speed (100-400 wpm)
  • Navigation history trail — In-session reading history stack with breadcrumb strip at bottom of reader, Alt+← shortcut, and clickable history entries (depth cap 50, clears on tab close)
  • Paragraph mode toggle — Reader preference toggling between flowing prose paragraphs and verse-per-line layout. Pilcrow button in toolbar + settings page
  • Red letter mode — Words of Jesus rendered in red for WEB translation. Added wj offset extraction to USFX importer, patched WEB verse data (2,059 verses), wired to existing showRedLetters preference
  • Dictionary lookup on double-click — Double-clicking any word triggers a three-tier lookup cascade: Theographic entity → Easton's dictionary → fallback with "Search in Bible" link. Includes word normalization for inflected forms

New files

  • src/lib/search-config.ts — Shared MiniSearch config (extracted from search page + command palette)
  • src/lib/stores/navHistory.svelte.ts — Navigation history store (Svelte 5 runes)
  • packages/data-pipeline/src/add-wj-to-web.ts — Standalone script to patch WEB verses with wj data

Test plan

  • Open app, verify search index loads from cache on second visit (check console for cache hit logs)
  • Navigate to any chapter, verify "~N min" appears in header
  • Navigate between chapters, verify breadcrumb trail appears at bottom
  • Press Alt+← to go back in history
  • Toggle paragraph mode via pilcrow button in header
  • Switch to WEB translation, verify red letter text in Gospel chapters (e.g. John 3)
  • Switch to KJV, verify red letter gracefully disabled (no errors)
  • Double-click a person name (e.g. "Jesus") → entity card opens
  • Double-click a common word (e.g. "grace") → dictionary lookup
  • Double-click an unknown word → fallback with search link
  • Verify Settings page has all new controls (reading speed, paragraph mode, red letter)
  • Run pnpm run build — passes clean

Display "~N min read" in the reader header, calculated from actual word
count of loaded verses divided by a configurable reading speed (default
200 wpm, adjustable 100-400 in Settings).
…ebuild

On repeat visits, the full-text search index (~31K verses per translation)
is deserialized from IndexedDB via MiniSearch.loadJSON() instead of being
rebuilt from scratch. Cache is keyed by translation ID + verse count so it
auto-invalidates when data changes. Also clears cache after seeding.

- Add SearchIndexCache type to @codex-scriptura/core
- Add searchIndexes table (Dexie v8) with get/save/clear helpers
- Extract shared STOP_WORDS and MiniSearch options to src/lib/search-config.ts
- Update search page and CommandPalette to use cache-first index loading
- Invalidate cached indexes in seed.ts after translation seeding
…isplay

Add a `paragraphMode` boolean to ReaderOptions that controls whether
verses flow as inline prose paragraphs (paragraph mode on) or display
one verse per line (paragraph mode off, the default). The toggle is
accessible from the reader toolbar header (pilcrow icon) and the
Settings page. The preference is persisted in UserPreferences via Dexie.
…board shortcut

Store reading history as {book, chapter, scrollTop} tuples persisted to
Dexie Settings under 'navHistory' key. Display as a breadcrumb strip at
the bottom of the reader showing the last 5 visited locations. Support
Alt+ArrowLeft shortcut to pop the stack and restore previous position
including scroll offset. History is capped at 50 entries and cleared on
tab close via beforeunload.
Double-clicking (or double-tapping on mobile) any word in verse text
opens the entity detail panel with the best available match using a
three-tier lookup cascade:
1. Theographic entity (person, place, event) -> rich entity card
2. Easton's Bible Dictionary -> definition card
3. Fallback -> minimal card with "Search in Bible" link

Word normalization strips common suffixes (-ed, -ing, -s, -tion, etc.)
to match inflected forms against dictionary entries.
Extract <wj> markup from WEB USFX source as character offset ranges
stored in a new VerseRecord.wj field. Render those ranges in red when
showRedLetters is enabled (default true). Add settings toggle for the
feature with a "WEB only" hint. Gracefully degrades for KJV/OEB where
no wj data exists.
- Add paragraphMode to v4 migration reader object (missing required field)
- Restructure onMount in ReaderWorkspace to register keyboard listener
  synchronously so the cleanup can be returned (async onMount can't return
  a cleanup function in Svelte)
@steveanil steveanil merged commit 4a23aa1 into main Mar 28, 2026
1 check passed
@steveanil steveanil deleted the feat/v0.3.1 branch March 28, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant