Note markers at the word they belong to, with a setting to keep them at the verse end #140

Open
opened 2026-10-30 17:41:49 +00:00 by claude-bot · 1 comment
Collaborator

From the owner's #13 phone check: in KJV Prov 11:15 both note markers sit at the end of the verse, though the notes are on "smart" and "suretiship".

Cause: the module puts both notes at the verse end, each naming its word in <catchWord>. diatheke shows them at the end too, so we match the module.

Owner's decision: a setting to choose between "keep all note markers at the end of the verse" and "put note markers on the exact word(s) they are linked to" (AndBible does the latter).

Plan:

  • In Settings › Display, a switch "Note markers at their words", on by default.
  • When it is on, a note with a catch word gets its marker after the closest earlier match of that word in the verse. If the word isn't found, the marker stays where the module puts it.
  • When it is off, the markers stay where the module puts them (the golden tests keep checking that).
  • Labels (a, b, …) stay in the module's note order, so the verse sheet and note sheet keep matching.

No mockup: the markers keep their look and only their place changes, and the setting reuses the Display page's Switch row.

From the owner's #13 phone check: in KJV Prov 11:15 both note markers sit at the end of the verse, though the notes are on "smart" and "suretiship". **Cause:** the module puts both notes at the verse end, each naming its word in `<catchWord>`. diatheke shows them at the end too, so we match the module. **Owner's decision:** a setting to choose between "keep all note markers at the end of the verse" and "put note markers on the exact word(s) they are linked to" (AndBible does the latter). **Plan:** - In Settings › Display, a switch "Note markers at their words", on by default. - When it is on, a note with a catch word gets its marker after the closest earlier match of that word in the verse. If the word isn't found, the marker stays where the module puts it. - When it is off, the markers stay where the module puts them (the golden tests keep checking that). - Labels (a, b, …) stay in the module's note order, so the verse sheet and note sheet keep matching. No mockup: the markers keep their look and only their place changes, and the setting reuses the Display page's Switch row.
Author
Collaborator

This is planned for v0.2 at the owner's request. An implementation was started and then stopped before anything was pushed. This is the design for when it is picked up:

  • sword (sword/src/filter/notes.rs, osis.rs): Note gets catch_word: Option<String>, the text of <catchWord> with its whitespace collapsed (None when missing or empty, and always None for ThML). PlacedNote.at keeps the module's place, so the golden tests stay unchanged.
  • Finding the word (core, core/src/bible/note.rs): a method on PlacedNote. Given the verse's display text, it returns the end byte of the last whole-word match of the catch word that ends at or before at.
    • The match ignores case, accepts any whitespace between the words of a phrase, and stays on char boundaries.
    • If there is no catch word or no match, it returns at.
    • Unit tests: the Prov 11:15 shape, a word that isn't in the verse, a repeated word, a case difference, "smart" inside "smarter", a phrase, and non-ASCII text.
  • Setting: NOTES_AT_WORD (notes.at_word, default "1") in core/src/settings.rs, carried in Options the way running is. Reader::read uses the moved place, and the marks are sorted by place if rich_marked needs that. Changing the setting re-renders at the same top verse, as RUNNING_TEXT does.
  • Labels: they stay in the module's note order, so the verse and note sheets still match.
  • Qt glue: a notesAtWord property and setNotesAtWord, like runningText.
  • QML: in DisplaySettings.qml, a Switch "Note markers at their words" after "Running text", with the line "Off: at the end of the verse, where the Bible has them".
  • German: "Anmerkungszeichen bei ihren Wörtern" and "Aus: am Versende, wo die Bibel sie hat".
  • e2e: a notes-at-word case, with the setting on and off.
  • Phone check: KJV Prov 11:15, where "a" should follow "smart" and "b" should follow "suretiship".
This is planned for v0.2 at the owner's request. An implementation was started and then stopped before anything was pushed. This is the design for when it is picked up: - **sword (`sword/src/filter/notes.rs`, `osis.rs`):** `Note` gets `catch_word: Option<String>`, the text of `<catchWord>` with its whitespace collapsed (`None` when missing or empty, and always `None` for ThML). `PlacedNote.at` keeps the module's place, so the golden tests stay unchanged. - **Finding the word (core, `core/src/bible/note.rs`):** a method on `PlacedNote`. Given the verse's display text, it returns the end byte of the last whole-word match of the catch word that ends at or before `at`. - The match ignores case, accepts any whitespace between the words of a phrase, and stays on char boundaries. - If there is no catch word or no match, it returns `at`. - Unit tests: the Prov 11:15 shape, a word that isn't in the verse, a repeated word, a case difference, "smart" inside "smarter", a phrase, and non-ASCII text. - **Setting:** `NOTES_AT_WORD` (`notes.at_word`, default `"1"`) in `core/src/settings.rs`, carried in `Options` the way `running` is. `Reader::read` uses the moved place, and the marks are sorted by place if `rich_marked` needs that. Changing the setting re-renders at the same top verse, as `RUNNING_TEXT` does. - **Labels:** they stay in the module's note order, so the verse and note sheets still match. - **Qt glue:** a `notesAtWord` property and `setNotesAtWord`, like `runningText`. - **QML:** in `DisplaySettings.qml`, a Switch "Note markers at their words" after "Running text", with the line "Off: at the end of the verse, where the Bible has them". - **German:** "Anmerkungszeichen bei ihren Wörtern" and "Aus: am Versende, wo die Bibel sie hat". - **e2e:** a `notes-at-word` case, with the setting on and off. - **Phone check:** KJV Prov 11:15, where "a" should follow "smart" and "b" should follow "suretiship".
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
schaefera/utStudyBIble#140
No description provided.