The reading session is not the interface
In tbook, separating state and rendering makes it possible to test resuming a book without opening a terminal.
tbook reads EPUBs in the terminal, with ANSI illustrations, search and bookmarks. A less visible part of the tool is the separation between reading state and the interface presenting it.
What belongs to the session
In internal/core, the Session structure maintains the book, chapter and persisted state. It provides operations such as GoTo, UpdateProgress, ToggleBookmark and Close. It does not import Bubble Tea: these operations can be exercised without starting the TUI.
Tests cover resuming a saved chapter, rejecting invalid chapters, persisting progress and bookmarks, and accumulating reading time. It is a small but useful boundary: changing a layout should not change navigation rules.
Precision is part of the contract
State stores chapter and percentage. That is not the same as storing an exact paragraph: if the width changes, rendering can change too. A layout-independent anchor is a question for a future version, not an existing feature.
The interface consumes the core
Bubble Tea handles keyboard input and layout; Glamour renders Markdown. EPUB images become ▀ blocks, with truecolor or a 256-colour fallback. This representation loses detail but keeps text and illustration in the same environment.
The technical case study links the code revision, executed tests and actual screenshots. As reviewed in October 2026, the suite passes, but the first release and a license file remain pending.