Skip to content

Data layer phase 2: Text in the host #425

Closed
5 of 5 issues completed
Closed

Description

@imnasnainaec

Phase 2 of the data layer plan.

WebView sees: Text from outline and segment pages. Releasable because: only text moves; analysis is untouched. Needs: #407 (done).

Scope

The host fetches and tokenizes the text, and the WebView renders from an outline and segment pages. It can run alongside Phase 1.

  • A BookService subscribes to USJ_Book for open books, runs extraction and tokenizing, and caches the tokenized book. It resegments per request from the boundary delta it's given, re-anchoring splits as reanchorSegmentation does today.
  • getBookOutline and getSegments (text only) feed the segment list, height prediction, the chapter list and the continuous view. Host marks record page-fetch latency.
  • A temporary getTokenizedBook gives the WebView whole tokenized books: for its reanchor passes and useBookIndexes until 4c, and for its whole-text read (the concordance and the catalog's "Word not in the text" and draft-wide Stale filters) until 5d. From 4a, segment pages and their phrase spans (3l) feed the token-level maps. The WebView stops fetching USJ.
  • onAnalysisChanged arrives here with its first producer: a Scripture edit names the whole book, and the WebView refetches.
  • A whole-text read in BookService reads every book, keeps a form-in-text index (the normalized forms the text holds), and reports progress and failed books through getTextReadStatus. Nothing calls it until 4a; then openSession starts it, 3j re-anchors each linked book as it arrives, and 5a and 5d answer from it.
  • These queries and the event are addressed by source project, since text needs no draft. They also accept a session from 3k, when analysis joins the segment pages; the source-project form is removed in 4c. Until 4c, boundary edits stay in the WebView draft, so the source-project form also takes the WebView's boundary delta: a boundary edit changes the request and the WebView refetches, and the import view sends none.

Done when: the WebView neither fetches nor tokenizes USJ, and no view walks the whole book except through getTokenizedBook.

Performance checkpoint

After What to check Baseline (large-loadable)
Phase 2 Book load, now split between host and WebView Open to settled 3,266 / 3,302 ms

Plan context

Decisions · The seam · Contract rules · Cross-book answers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions