Simplify sidebar navigation by removing the conditional Book and Close Book
items so users no longer need to manage a book left open in the background.
Because there is no longer a Book item to return to the reader, navigating
away from the reader to History or Custom Theme now flushes any pending
scroll position and closes the active or in-flight book. Opening the Settings
popup still keeps the book open behind the overlay, and clicking Files keeps
the current book open until a file is actually selected so cancelling the
file dialog preserves the current reading session.
This also fixes book-lifecycle edge cases exposed by closing on navigation:
- Cancel in-flight async loads in Book::close() and clear loading state so
closing mid-load does not jump back to the reader or stall the spinner.
- Emit willCloseBook before resetting the reader so AppCoordinator snapshots
final progress into HistoryModel and immediately clears UiState.lastFilePath.
- Mark Book as loading before clearing the outgoing reader when opening a new
file to prevent HistoryPage from flashing between books, and fall back to
History on load errors.
- Reset ScrollPageView and MangaPageView state when a book closes, and always
navigate to the reader on restoreReady so CLI-opened files are not hidden
behind a previously saved History page.
- Add coverage in BookTest and AppCoordinatorTest and document the behavior
in AGENTS.md.
Formalize the Asteria Qt text layout engine behavior and establish
comprehensive test coverage across all 94 Allium specification
obligations for two-phase layout, Knuth-Plass line breaking, and
reading session state management.
- Add `specs/text-layout-engine.allium` detailing layout lifecycle,
generation monotonicity, viewport metrics, and contrast safety.
- Implement structural equality operators (`operator==`) across layout
domain value types (`BoxStyle`, `InlineItem`, `BlockItem`,
`ContentChunk`, `KnuthPlass::Item`, positioned line/run elements,
and `BookPosition`) to enable deterministic assertion testing.
- Introduce `TextLayoutEngineSpecTest` verifying entity fields, value
equality, enum comparability, contract signatures, config defaults,
lifecycle state transitions, rules, and invariants.
- Register `TextLayoutEngineSpecTest` in `CMakeLists.txt` and update
test inventory in `AGENTS.md`.
Book metadata extraction previously handled author parsing naively by taking only the first raw dc:creator string, ignoring MARC relator roles, multi-creator ordering, deduplication, and structured author fallbacks.
Define the formal author attribution model in specs/book-author-parsing.allium and propagate the specification into a comprehensive test suite (AuthorAttributionTest) covering all 23 obligations across value equality, lifecycle state transitions, contract invariants, and surface exposure.
Implement AuthorAttribution, AuthorAttributionService, and BookMetadataSurface to fulfill:
- Dublin Core precedence over structured author elements
- MARC role code resolution (aut -> Author, edt -> Editor, trl -> Translator, ill -> Illustrator, custom capitalized)
- Grouping creators by resolved role in order of appearance with deduplication
- Fallback formatting for structured author fields (first, middle, last, nickname)
- Complete status lifecycle enforcement (unparsed to parsed)
Register AuthorAttributionTest in CMakeLists.txt and update AGENTS.md documentation.
Formalize the behavioral specification for off-thread Knuth-Plass text
chunk layout and virtualized QML rendering in specs/knuth-plass-rendering.allium,
and introduce a test suite covering all 66 specification obligations across
value types, state machine transitions, invariants, and surface contracts.
To satisfy the specification's precondition and invariant contracts:
- Validate and clamp initial restore chunk bounds when opening documents
in ReadingModel to ensure anchor chunks remain strictly within bounds.
- Guard scroll position updates against negative and out-of-bounds chunk
indices to honor the ScrollPositionChanged preconditions.
- Emit positionSaved on publisher color toggles to fulfill the
PositionPersisted contract without triggering unnecessary relayouts.
- Register KnuthPlassRenderingSpecTest in CMakeLists.txt and document the
spec and test hierarchy in AGENTS.md.
BookController was superseded by the Book class during a prior refactoring.
The old files were never removed and are not in CMakeLists.txt. Deleted:
- src/backend/BookController.h/cpp (not in build, calls non-existent AppState APIs)
- tests/BookControllerTest.cpp (not in CMake test targets)
Updated CLAUDE.md architecture documentation to reference Book instead of
BookController for all book management operations and tests.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>