Repository navigation
Serve book outlines and segment pages from the host (#436) - #464
Conversation
A Scripture edit now reloads the book at the view's next page fetch;
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
📝 Walkthrough
Merge Risk: 🔵 Low · up to
|
alex-rawlings-yyc
left a comment
There was a problem hiding this comment.
Added #451 to the description's list.
Retried: the outline and the opening pages now go through one attempt that retries on PAGE_RETRY_DELAYS_MS while the request is current, and the error panel shows only once those run out. After a boundary edit the current list stays up through the retries, but a final failure still shows the panel rather than leaving the list on the old boundaries with nothing refetching. One knock-on: a failure that will never succeed now takes about 21 s to reach the panel.
@alex-rawlings-yyc made 10 comments.
Reviewable status: 0 of 33 files reviewed, 9 unresolved discussions (waiting on alex-rawlings-yyc and imnasnainaec).
imnasnainaec
left a comment
There was a problem hiding this comment.
@imnasnainaec reviewed 34 files and all commit messages, and resolved 9 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on alex-rawlings-yyc).
Closes #436. Part of Phase 2 (#425).
Host.
bookServiceserves two new commands,interlinearizer.getBookOutlineandinterlinearizer.getSegments. Both are addressed by source project and book, and both take the WebView's boundary delta as JSON. The host segments the kept tokenized book by that delta, re-anchoring splits asreanchorSegmentationdoes, and keeps the result for the latest delta, so an outline and its pages segment the book once. The outline lists every segment's id, start, verse starts, heading, token and word-token counts and text length, without its text. A page is a run of whole segments at outline indexes. Both carry the book'stextVersion. Page requests reuse the kept book without reading the language tag again.WebView. The new
useSegmentPageshook fetches the outline and then the pages around the opening verse, and publishes them together. On a boundary edit it also fetches the pages around the range last shown, so the old list stays up until the new one is ready. Pages load into a store outside React state, one request per run of missing pages, and only the segment list re-renders when one arrives.SegmentListViewreads labels, chapters, merge eligibility and height prediction from the outline. Mounted segments come from their pages, with a placeholder at the predicted height until a page arrives.useBookIndexes, focus, the continuous strip and stale free-translation placement still use the locally segmented whole book, as the plan allows until #437, #450, #451 and #455.Behavior changes. A
textVersionmismatch between the host and the WebView's tokenized book reloads the book, so a Scripture edit now shows at the next outline or page fetch. #438 makes that immediate.Perf harness. The host times
getBookOutlineandgetSegments, withresegmentandserializesteps. The WebView recordsoutline-fetch,outline-parse,page-fetchandpage-parse. Opening the view samples the outline call with transport, and each page call on the host side.Verified.
This change is
Summary by CodeRabbit
New Features
Performance