Core layout: bible and worker modules, Window unit-tested #17
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
schaefera/utStudyBIble!17
Loading…
Reference in a new issue
No description provided.
Delete branch "phase1/core-layout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #11
Now also carries #18 (merged into this branch as
9677417): chapter and book headings in the module's language, book names and chapter words as data files, a typedLocale, and no scroll bar. #18 has its own What / Proof / Review; its last commit has the trailersReview-Confidence: 80andReview-Tier: trunk.And #19 (merged as
c77d170): versification tables as an ini file read by a shared ini reader, and a quiet "· · ·" break between chapters, none above the Bible's first chapter. #19 has its own What / Proof / Review; its last commit hasReview-Confidence: 100andReview-Tier: trunk.The sections below describe only this PR's own commits.
What
This PR's own commits change no behaviour. They restructure the code before PR 3 (picker, history, Back, Jump):
core/src/reader.rsbecomesbible/(Placeand navigation as methods,Anchor,Chapter,Reader).worker.rsis split intoworker/{session,window,debounce}.rs. The loaded-chapter logic is now a pureWindowtype with unit tests that need no module data.db/mod.rsbecomesdb.rs, andv11n_data.rsbecomesv11n/data.rs.## Code layoutsection with the five rules, and its blast-radius paths are updated.Blast radius
Tier: trunk
Trunk paths touched:
sword/src/v11n*,core/src/db*,core/src/worker*,core/src/bible*(wascore/src/reader.rs),qt/src/reading_model.rs(import only),tools/mem-check/run.sh(comment only). #18 and #19 addqml/pages/ReadingPane.qmland the reading model's heading role.Gate / rollback: revert this merge. It moves code only, with no schema or data change (#18 and #19 have none either).
Budgets: unchanged. mem-check gives start-up 84 ms and peak PSS 146382 kB (budget 165000 kB); #16 gave 83 ms and 148340 kB. With #18: 147565 kB, start-up 130 ms (noise range 80–130). With #19: 146923 kB, 126 ms.
Proof
cargo make(fmt, clippy, tests with coverage, release check, deny, audit; run with SWORD_TEST_REQUIRED=1): all pass. sword runs 16+7+3+3 tests and core runs 31. Coverage is 94.17% of regions (floor 93.97%). With #18: 40 core tests, 94.78%. With #19: 94.96%.cargo make app-docker: exit 0. mem-check results:have < MARGIN + nchanged tohave < MARGINinWindow::trim,cargo test -p utsb-core window::fails atwindow.rs:145. Reverted, it passes 2/2.worker::tests::keeps_a_margin_of_verses_around_the_top_versepasses unchanged after the switch toWindow, so the Slid/Dropped event stream is the same as before.RUSTDOCFLAGS="-D warnings" cargo doc -p utsb-core(with and without--document-private-items): clean.git grepfor the old paths (outsidedocs/superpowers): empty.Review
Reviewer: a fresh-context Sonnet agent, asked for
code-reviewat high. It reviewed by that method directly, comparing old and new code side by side. It found 0 bugs and raised 3 nits:Windowis built for one versification.window::MARGIN, is plain text on purpose, because a link to a private item fails rustdoc-D warnings.Review-Confidence: 90/100. Every changed trunk file was opened and compared side by side, and the new Window test fails when the trim condition is mutated. The only gaps are two nits that gave no line number.
Confidence by part
v11n/data.rs,db.rs,bible/*,debounce.rs): high. The bodies are verbatim apart from the switch to method syntax.worker/window.rsandSession::slide: medium-high. This is the one real restructure, and verse counts are now cached per chapter. The unchanged integration test and mem-check both pass. Read this part if you read only one.Merge with "Create merge commit".
🤖 Generated with Claude Code
Each chapter opens with a heading ("Chapter N", "Psalm N" in Psalms) and each book with its name, as ListView sections on a new "reference" role. The top-verse report looks past a heading to the first verse below; a restore with a fraction lands on the verse, not the heading. The scroll indicator is gone: the list is only the loaded chapters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>