7.1 KiB
Manuscript Reader — Phase 1
For the subsequent automatic-update and Focus Reading navigation behaviour, see LiveUpdates.md. The original delivery evidence below describes the initial release.
The read-only Reader is available from Read manuscript in a book's Chapters list, each chapter's details, and the application Book menu. The installed PWA uses the same authenticated workspace. It requires no local Word installation.
Implementation and data contract
- GET
/manuscript/reader?bookId={id}&chapterId={id}; chapterId is optional and defaults to the first active chapter. ManuscriptReaderServiceseparates retrieval/projection from the Razor paragraph partial and navigation controls. It calls the existingIParagraphManuscriptRepository.Get(user, book)/dbo.ParagraphManuscriptget operation. That procedure checks active project access before any book metadata is fetched. Unknown/foreign books and cross-book chapter IDs return 404.- Only committed
BookParagraphManuscripts.Payloadis read. No preview, pending capture, live Word position, reconciliation operation, bootstrap or write method is invoked. A rejected transfer leaves this existing accepted snapshot visible. Position verification is intentionally not required for reading: it concerns live Word coordinates, not validity of saved prose. - Active chapters use existing
Chapter_ListByBookordering. Paragraphs use accepted heading windows and occurrence ordinal, retaining blank paragraphs and scene separators as well as prose. Canonical-zero section boundaries keep excluded sections outside chapter windows. Older or inconsistent boundary metadata falls back to explicit ChapterId assignments and the mapped heading; no boundaries are guessed. GUIDs remain in the projection for future reuse without appearing in the interface. - Only the selected chapter is rendered/sent to the browser. This phase reuses the existing whole-book JSON read on the server; large books still incur aggregate transfer/deserialization for each request. There is no browser preloading of the book, speculative caching, second manuscript store, new database object or schema migration.
- Razor encodes prose as ordinary HTML text. Paragraphs retain captured whitespace with
white-space: pre-wrap. Formatting absent from capture (emphasis, images, page layout and other Word objects) is not reconstructed. The captured opening chapter heading is retained verbatim without duplicating the title in the reading column. - GET-only controller, existing authentication, no-store responses and
X-Robots-Tag: noindex, nofollow, noarchive. Database/JSON/timeout errors produce a generic 503 page with retry, without payloads or exception messages. No offline manuscript storage is provided.
Timestamp meanings
Last successful chapter synchronisation comes directly from the selected chapter's persisted ChapterCheckpoints[].LastSuccessfulSyncUtc. The existing chapter validation contract records this after successful evidence acceptance, including unchanged-text validation. It is not a claim that the prose changed at that moment. If absent, the Reader explicitly says it is not recorded.
Accepted manuscript snapshot captured comes from persisted ParagraphManuscript.UpdatedUtc, set by bootstrap/full snapshot or chapter reconciliation. It is a book-snapshot capture time, not an invented chapter-specific sync time or the database row's UpdatedUtc (which also changes for preferences). Chapter-only unchanged validation may update its checkpoint without changing this capture time. All displayed times explicitly use UTC, to the second. A failed/pending transfer cannot supply either displayed value.
Verification
Run serially:
dotnet build PlotLine.slnx
dotnet run --no-build --project PlotLine.Tests/PlotLine.Tests.csproj
dotnet run --no-build --project PlotLine.Tests/PlotLine.Tests.csproj -- --chapter-sync
Focused Reader tests are also available with --manuscript-reader.
For browser checks, start the existing isolated fixture host (synthetic manuscript, no database connection):
PD_BROWSER_FIXTURE_URL=http://127.0.0.1:5249 dotnet run --no-build --project PlotLine.Tests/PlotLine.Tests.csproj -- --toolbar-browser-host
PD_BROWSER_FIXTURE_URL=http://127.0.0.1:5249 node PlotLine.Tests/Browser/manuscript-reader.cjs
The browser suite exercises the real controller and compiled Razor, three viewport widths (390/800/1440), all four application themes, browser and simulated installed-PWA modes, safe HTML-like text, DOM text selection, navigation/selector, empty state, UTC timestamps, focus/Escape, account/book isolation, private headers, GET-only routing and generic error/retry. PWA simulation does not constitute a Windows installed-app acceptance test. Tests use normal DOM Range selection; ElevenReader itself is not integrated or tested.
Results — 13 November 2026
- Solution build: passed, zero warnings/errors. Full executable regression harness: passed, including Reader and existing paragraph synchronisation workflows.
- Dedicated chapter synchronisation regression: passed.
- Chromium suite: passed all 24 viewport/theme/browser-or-PWA combinations, plus isolation and error/retry checks. Desktop and phone screenshots were visually inspected during development.
- Read-only live Development check: verified the effective database, retrieved first/middle/last chapters (537 paragraphs) from an existing accepted manuscript, refused an unrelated account, and confirmed the accepted revision and snapshot hash were unchanged. An earlier check traversed all 48 chapters. No author prose was exported or database state modified.
- Actual Word editing/saving and a real installed Windows PWA were unavailable on Atlas. The end-to-end scenario below remains unverified.
Windows Word-to-Reader acceptance still required
- On Windows, open the existing bound manuscript in Word using the current Companion; no new installer is required for Reader use.
- Add a small identifiable phrase within an existing chapter, save, and wait for a successful Companion acknowledgement. Record the acknowledged chapter and UTC time.
- On a separate browser/device, open the same book and choose Read manuscript, then the changed chapter. Refresh if already open. Confirm the exact phrase and paragraph position.
- Compare the chapter synchronisation timestamp with the successful acceptance (including seconds/UTC); the separately labelled snapshot capture time has the meaning described above.
- Drag-select multiple paragraphs and copy/paste them into a plain-text document. Optionally try the author's normal reading extension. Confirm paragraph order and literal angle-bracket text where present.
- Use previous/next and the chapter selector, then return. Repeat on mobile and the installed desktop PWA in the desired theme.
- Confirm Word text and Companion accepted revision remain unchanged by Reader navigation. Do not use the Reader to trigger sync; it has no mutation action.
Deployment
Normal development application deployment is needed to expose the new route and assets. No SQL migration, configuration change or Companion installer is needed. This implementation does not deploy or change Production.