Switch Bible from the reading pane (#70) #72
No reviewers
Labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
schaefera/utStudyBIble!72
Loading…
Reference in a new issue
No description provided.
Delete branch "phase1/switch-bible"
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?
Closes #70.
What
Blast radius
Tier: trunk
Trunk paths touched:
core/src/worker*,core/src/bible*,qt/src/reading_model.rs,qt/src/installer.rs,qml/Main.qml,qml/pages/ReadingPane.qml,tools/e2e/. Leaf:qml/pages/BibleChooser.qml,qml/pages/StarterPage.qml,core/src/starter*,po/, docs.Testing tier: standard (no data format change; reading-thread and Back behaviour changed)
Gate / rollback: revert this merge. No data format changes, so nothing to restore; the saved module name is the same field as before. History entries made by earlier builds of this PR still work, because Back maps them.
Main.qml'sonAddBiblesRequestedis the one line part 2b (#10) will point at its module manager.Proof
cargo make(fmt, clippy, tests, deny, audit): green.cargo make app-docker: all steps pass (PSS 150.7 MB normal, 156.5 MB slow, of 165).cargo make e2e-docker: 19 passed + 4 in the slow profile, on the KJV-only folder (CI layout) and on the full module folder. CI onba0d125: rust, audit, app, e2e, click all green.a_book_the_bible_lacks_goes_to_the_nearest_book_it_has_with_a_noticefails with the lookup bypassed. Earlier switch tests and e2eswitch-bible,switch-bible-back,switch-bible-red-letterseach FAILED with their defect (FAIL lines recorded in earlier PR body revisions) and pass now.back_stays_in_the_bible_being_read_and_survives_a_kill(fails with oldjump.rs: "Back never changes the open Bible, left: Some(KJV)") andan_entry_of_a_bible_that_is_gone_is_placed_in_the_open_one(fails: "that place is not in this Bible"). e2eswitch-bible-back(jump in KJV, switch to KJV2, Back) fails with the old code: "Back changed the Bible ('KJV 5 0.152')".add-bibleandadd-bible-failboth FAIL with the "+" not wired ("no 'utsb: starter download ' (x1) after 10 s") and pass with it, twice, in other orders, on both folders.ba0d125):a_conf_without_a_bible_open_is_not_installed_so_the_first_run_can_repair_itandrefresh_sees_a_module_installed_since_and_keeps_the_ticks. Fail-before for these two is by reading the diff only; both pass in CI.Review
Reviewer: fresh-context
code-review, two rounds.da19fab): 1 medium (a switch to a module lacking the book's text loaded blank chapters, and saved it) and 1 low (fixed pixel size in the chooser). Both fixed in3a81fc8with the test above; I replied in review 250; re-review 251 (medium, da19fab..3a81fc8) found nothing.0b56e8d) had no high or medium findings and 3 lows, all fixed inba0d125(comment 1784): (1) with the add page open and the last Bible gone, Main.qml now turns it into the first-run page; (2) a conf without a readable Bible no longer counts as installed on first run, so Download repairs it; (3) newStarter::refreshruns on every install Done event, so the ticks are current. Delta review 253 (medium, 0b56e8d..ba0d125): no findings.ba0d125and confirmed by 253), 0 left open.ba0d125d1c: the first run scored 40 because it was given only a summary of round 1 and could not see review 249/251's file lists; this run had every report.Review-Confidence: 85
Deductions:
Missed defect: none found
Reason: Trunk files were reviewed at HIGH, every finding was fixed, and CI is green on
ba0d125; the only gap is the untested Main.qml last-Bible branch.Audit checks:
3a81fc8,0b56e8dandba0d125all exist on the branch (git log). The review 253 range 0b56e8d..ba0d125 covers the only commit after the last full pass, so nothing is unreviewed after the last review. 252 covered 3a81fc8..0b56e8d. Review 249 plus 251 cover origin/main..3a81fc8.3a81fc8(core/src/bible/reader.rs, worker.rs, switch.rs) are in 251's list.3a81fc8, with a test that fails with the lookup bypassed, and 251 confirmed the fix. 252's three lows were fixed inba0d125and 253 confirmed them. No deferrals were used. Every finding has file:line and a failure scenario.ba0d125is its head.ba0d125shows rust, audit, app, e2e and click all success.Confidence by part
worker,jump.rs,switch.rs): high. Tests fail without the change; two reviews; CI green.bible/anchor.rs,reader.rs): medium. Covered by tests and the round-1 review, but not in the listed files of the round-2 reviews.starter.rs,installer.rs, StarterPage): high. Core tests and e2e fail without the change.Phone
da19fab) was installed on the Plinius: it starts, restores, and the Bible button is laid out. adb has no input tool, so the agent did not drive switching.🤖 Generated with Claude Code
Owner feedback from the phone: the "on the phone, try" step "Install a second Bible from the starter page" can't be done. The starter page only appears when no Bible is installed, so on a phone that already has Bibles there is no way to add one.
Planned change, in this PR after the review round:
Part 2b (module manager, #10) will later point the "+" at the full manager.
🤖 Generated with Claude Code
Review level: HIGH (single pass, fresh context). Commit
da19fabd01. Range origin/main...HEAD (phase1/switch-bible). Blast radius: trunk, standard tier.Files reviewed: core/src/worker.rs, worker/session.rs, session/jump.rs, session/switch.rs, bible.rs, bible/anchor.rs, bible/installed.rs, bible/locale.rs, qt/src/reading_model.rs, qml/pages/ReadingPane.qml, BibleChooser.qml, tools/e2e/lib.sh, cases/switch-bible*.sh, docs/07, CLAUDE.md, po (checked present).
Findings outside the diff: none.
Checked and found sound: the place after a switch across versifications (nearest verse plus notice), the saved module restore after kill and after uninstall (open_reader falls back with a notice), Back opening the module an entry left from (entries of removed modules skipped and kept), stale Scrolled during a load (guarded by
loading), the chooser re-reading the folder on each open, the list work on the worker thread, and the po entries.Findings:
resolveandhas_verse_in, since both only consult the v11n. The chapters load with empty rows (Reader::read maps unreadable verses to empty strings) and no notice, and the choice is saved. The user sees blank chapters, and a restart reopens the blank module. Check the module's data for the target place (or that its first rows are non-empty) and fall back to the nearest book that has text with the existing notice, or say the module lacks the book.font.pixelSize: 12for the language line ignores the user's text-size setting and the system scale; use a relative font size.@ -0,0 +28,4 @@return vec![Event::Error(tr("Can't open %1: %2").replace("%1", module).replace("%2", &e.to_string()))];}};let Some((place, row, fraction)) = resolve(&r, &from) else {medium: resolve/has_verse_in only consult the versification. A module on KJV v11n that lacks this book's data (NT-only or OT-only) opens at blank chapters with no notice, and the choice is saved. Check the module has text at the place, else the nearest book with text plus the notice.
@ -0,0 +83,4 @@elide: Text.ElideRightvisible: text !== ""opacity: 0.7font.pixelSize: 12low: fixed pixelSize ignores the text-size setting; use a relative size.
Answers to review 249, fixed in
3a81fc8.@ -0,0 +30,4 @@}};let none = |r: &Reader| vec![Event::Error(tr("%1 doesn't have this place.").replace("%1", r.module_name()))];let Some((asked, row, fraction)) = resolve(&r, &from) else { return none(&r) };Fixed in
3a81fc8(reply to the medium finding). NewReader::nearest_with_text(place): a book counts as present if its 1:1 has text; otherwise the nearest book that has (earlier on a tie) is opened at chapter 1 with the existing notice, and the module with no text at all is refused with the existing error before anything is adopted or saved. Proof: new worker testa_book_the_bible_lacks_goes_to_the_nearest_book_it_has_with_a_notice(KJV Gen 1 -> TR, which is NT-only on the KJV versification) fails with the lookup bypassed and passes now;a_book_the_bible_has_keeps_the_verse_and_says_nothing(John 3:16 -> TR) guards the normal case.cargo makegreen.@ -0,0 +83,4 @@elide: Text.ElideRightvisible: text !== ""opacity: 0.7text: sheet.reading.bibleLanguage(row.index)Fixed in
3a81fc8(reply to the low finding). The hard-coded pixel size is gone; the language line now uses the Label's default font like the lines above it, still dimmed.cargo make app-dockergreen (lint, -Werror build, clang-tidy, PSS 150/157 MB of 165).Level: MEDIUM (re-review of fixes). Commit:
3a81fc8. Range: da19fab..3a81fc8 (PR #72, base main).Files reviewed: core/src/bible/reader.rs, core/src/worker.rs, core/src/worker/session/switch.rs, qml/pages/BibleChooser.qml (plus context in core/src/bible/place.rs, sword/src/v11n.rs, sword/src/module.rs).
Both first-review findings are fixed correctly:
Findings outside the diff: none. I did not run the build, tests or e2e cases.
Done in this push, two commits:
"+" in the Bible chooser (comment above): opens the starter page as "Add Bibles", installed modules shown as installed, downloads through the same runner with progress/error/Retry, closing leaves the open Bible alone, new Bibles in the chooser without restart. e2e
add-bibleandadd-bible-fail; both FAIL without the "+" wired. PSS with the page open is in docs/07.Back history, owner's rule: "Back history always stays in the Bible being read. When you switch Bibles, every Back entry is moved into the new Bible: mapped to its versification with the existing nearest-verse rule, or the nearest book with text. A switch pushes no entry of its own. Pressing Back never changes the open Bible."
I did it by mapping when Back pops an entry, not by rewriting at the switch. The effect is the one you described (each entry lands in the open Bible at the nearest verse, else nearest book with text), it needs no new saved state so it survives a kill the same way, and a switch there and back keeps the original exact fractions. Your run (KJV Gen 1:1, Go to Exodus 8, switch to BSB, Back) now lands on BSB Gen 1:1 and never reopens KJV. Removed: reopening other Bibles from Back and skipping entries of a removed Bible. An entry that cannot be placed at all is kept with an error. Proof: core test
back_stays_in_the_bible_being_read_and_survives_a_killand e2eswitch-bible-backboth FAIL with the old code (Back changed the Bible ('KJV 5 0.152')), pass now. docs/04 F6 says so. The PR body's what-list and try-list are updated.Phone: not touched, since you are using it.
🤖 Generated with Claude Code
claude-review, level HIGH, commit
0b56e8d, range 3a81fc8..HEAD (po/ and lock files excluded).Files reviewed: core/src/worker.rs, core/src/worker/session/jump.rs (plus switch.rs and resolve in session.rs for context), core/src/starter.rs, core/src/starter/tests.rs, core/src/tasks/progress.rs, qt/src/installer.rs, qml/Main.qml, qml/pages/ReadingPane.qml, qml/pages/StarterPage.qml, qml/pages/BibleChooser.qml, tools/e2e/lib.sh, tools/e2e/cases/{add-bible,add-bible-fail,switch-bible-back}.sh, docs/04-features.md, docs/07-platform-constraints.md.
No high or medium findings. Back maps each entry into the open Bible when it is taken, so an entry is never left in or reopened in another Bible. This also holds after a kill and after several switches. An entry the open Bible lacks goes to the nearest book with text, and an unplaceable one is kept.
Findings outside the diff / low:
installedis read only in begin(). When an install finishes while the add page is open, the ticks are stale until the page is reopened. This is harmless because the progress view hides the choice, but a language switch is not re-checked either.Answer to review 252 (
0b56e8d). No high or medium findings. All three lows are fixed inba0d125; CI on it is green (rust, audit, app, e2e, click).onNoBibleChangednow turns a starter page already on top into the first-run page:adding = false,closable = false,installer.begin(false). Not reachable today (no removal UI), so there is no e2e for it; it is a 4-line branch that part 2b (#10) will make reachable, and I checked it by reading only.a_conf_without_a_bible_open_is_not_installed_so_the_first_run_can_repair_it: with the oldbeginthe KJV conf madeis_installedtrue andcan_installfalse, so it fails there; it passes now.installedstale after an install finishes (low): fixed. NewStarter::refresh(sword_dir)re-reads the folder and keeps the ticks; the installer calls it on everyDoneevent. Testrefresh_sees_a_module_installed_since_and_keeps_the_ticks(does not compile withoutrefresh; passes now). The language-switch case needs nothing:begin/choose already reset it and the progress view hides the choice, as the review said.cargo makeand the e2e/app jobs in CI pass onba0d125. Phone untouched. PR stays a draft.🤖 Generated with Claude Code
claude-review, level MEDIUM, delta review.
Commit:
ba0d125d1cRange: 0b56e8dd968618c97243e8d2670ae9ea77498831..ba0d125 (fixes to review 252)
Files reviewed: core/src/starter.rs, core/src/starter/tests.rs, qt/src/installer.rs, qml/Main.qml, qml/pages/StarterPage.qml (context), plus the earlier-reviewed set (core/src/worker.rs, core/src/worker/session/jump.rs, core/src/tasks/progress.rs, ReadingPane.qml, BibleChooser.qml, tools/e2e/*, docs/04, docs/07) unchanged in this range.
Findings: none high or medium, none low. All three lows from review 252 are fixed correctly:
WIP: Switch Bible from the reading pane (#70)to Switch Bible from the reading pane (#70)Merge gate (claude-review), head
ba0d125d1c.3a81fc8with a test that fails with the lookup bypassed; re-review 251 found nothing. Reviews 252 and 253 have no high or medium findings.ba0d125. I read that commit (the only one after the last review round): the diff matches delta review 253.Not merging.