Skip to content

Library: nested collapsible section picker for grouped works (Bhagavad Gītā) - #135

Merged
anantham merged 2 commits into
mainfrom
feat/fable-gita-library
Jul 28, 2026
Merged

Library: nested collapsible section picker for grouped works (Bhagavad Gītā)#135
anantham merged 2 commits into
mainfrom
feat/fable-gita-library

Conversation

@anantham

Copy link
Copy Markdown
Owner

The library detail modal gains an expandable chapter→verse tree for grouped works (chapterNumber = group*1000 + item). Detected cheaply from metadata; lazy verse-index fetch only for grouped novels; every ordinary novel unchanged. Enables the whole-Gita 'pick any verse' experience. 24 tests, red-proofed, tsc clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_0117Ksuo6oeSBw4iTq3yzfYi

…hagavad Gītā)

A groupable novel encodes chapterNumber = group*1000 + item (Gītā verse
2.47 → 2047). The library detail modal now detects this cheaply from the
version's chapterRange (from >= 1000 AND spanning multiple groups) and
renders an expandable chapter→verse tree — chapters named in Sanskrit
with English subtitles and verse ranges, expanding to a lazy verse grid,
with expand-all/collapse-all — so a reader can open any verse directly
instead of a flat 700-item list. Every ordinary novel renders exactly as
before (Aithihyamala 1..126 stays flat; a single-chapter slice stays
flat).

The verse index is fetched lazily from session.json only for a confirmed
grouped novel and cached by URL (LFS-pointer guarded); the picker
component is pure over an injected chapter list, fully testable offline.
onStartReading gains an optional startChapterNumber that overrides the
saved resume point in both cached and streaming hydration paths.

24 new tests (grouping logic + component); groupability detection
red-proofed; 48 tests green across touched suites; tsc clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117Ksuo6oeSBw4iTq3yzfYi
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexicon-forge Ready Ready Preview, Comment Jul 28, 2026 11:33am

…reconcile

P2: groupability now requires an explicit metadata.grouping.scheme ===
'chapter-verse' marker instead of range inference (a web novel numbered
1001-2000+ would have been misclassified and Gita-labelled). isGroupable-
Chapters stays as a secondary safety assert. A marker-less 1001+ novel
renders FLAT (red-proofed).

P1: picking a verse outside the first streamed batch (e.g. Gita 2.47 when
only ch1 is streamed initially) no longer silently opens/persists chapter
1. Post-import reconcile loads the full chapter set and navigates to +
persists the picked verse; unresolvable picks surface a warning rather
than parking on the wrong verse (red-proofed: picked ch-2047 opens 2047,
not 1001).

Full suite 8,682 / 0 failed; build green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117Ksuo6oeSBw4iTq3yzfYi
@anantham

Copy link
Copy Markdown
Owner Author

Both codex findings adjudicated & fixed (red-proofed): P2 — groupability now gated on an explicit metadata.grouping marker, not range inference; a marker-less 1001+ web novel renders flat. P1 — picking a verse outside the first streamed batch reconciles after full import and opens the RIGHT verse (2.47), never silently ch1. Full suite green.

@anantham
anantham merged commit 67e338a into main Jul 28, 2026
2 of 3 checks passed
@anantham
anantham deleted the feat/fable-gita-library branch July 28, 2026 11:32
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