---
phase: 6
plan: 06-03
type: execute
wave: 3
depends_on:
- 06-01
- 06-02
files_modified:
- ReadViewDemo/ReadViewDemo/ViewController.swift
- Sources/RDReaderView/EPUBUI/RDEPUBReaderController.swift
- Sources/RDReaderView/EPUBUI/RDEPUBTextContentView.swift
- Sources/RDReaderView/EPUBCore/RDEPUBReadingModels.swift
autonomous: true
requirements:
- LAYOUT-01
- LAYOUT-02
- LAYOUT-03
---
# Phase 6-03: Geometry Verification and Diagnostics
Expose concrete demo diagnostics for the new geometry and selection overlay path, then verify that page geometry, restore, search, and selection remain compatible on real sample books.
- The demo can report geometry and selection evidence for a native reflowable page.
- Offset-based restore and page lookup continue to resolve the same content after geometry and overlay changes.
- Any geometry regression is visible in simulator logs or the demo status text.
execute
Add a geometry diagnostic hook to `RDEPUBReaderController` or `RDEPUBTextContentView` that reports the active page index, the selected absolute offset range, and the geometry summary for the current native page. Keep the diagnostic format deterministic so the demo can surface it in startup logs.
- Sources/RDReaderView/EPUBUI/RDEPUBReaderController.swift
- Sources/RDReaderView/EPUBUI/RDEPUBTextContentView.swift
- Sources/RDReaderView/EPUBCore/RDEPUBReadingModels.swift
- Sources/RDReaderView/EPUBTextRendering/RDEPUBTextLayoutFrame.swift
- A runtime call can produce a geometry summary string for the current native page.
- The summary includes the selected absolute range or an explicit no-selection state.
- The summary is deterministic enough to compare across rebuilds on the same sample book.
execute
Extend `ReadViewDemo/ViewController.swift` startup validation so the native reflowable sample output includes the new geometry summary alongside the existing pagination and restore diagnostics. Keep the TXT and fixed/interactive matrix paths intact.
- ReadViewDemo/ReadViewDemo/ViewController.swift
- Sources/RDReaderView/EPUBUI/RDEPUBReaderController.swift
- Sources/RDReaderView/EPUBTextRendering/RDEPUBTextBookBuilder.swift
- Sources/RDReaderView/EPUBCore/RDEPUBReadingModels.swift
- The simulator startup log includes a geometry/selection summary for at least one native reflowable sample.
- The existing sample validation matrix still reports the native, fixed/interactive, and TXT paths.
- Font or theme changes still preserve the same href and absolute-offset semantics in the restore diagnostic output.
- Build and launch `ReadViewDemo` in the simulator.
- Open a native reflowable sample, select text, and confirm the geometry summary matches the overlay selection.
- Change font size or theme and confirm restore diagnostics still report stable href and offset behavior.
- Geometry and overlay behavior are visible in the demo.
- Selection, restore, and sample validation remain compatible after the phase 6 changes.
- The phase produces reusable diagnostics for later phases without requiring a second demo shell.