Skip to content

Conversation

@FyreByrd
Copy link
Collaborator

@FyreByrd FyreByrd commented Jan 16, 2026

This issue was first discovered in multiple verses in the Nambikwara project:
Scriptoria: https://app.scriptoria.io/projects/567
ScriptureEarth: https://scriptureearth.org/data/nab/sab/nab/#/text

Certain verses, e.g. 1 Peter 3:1-2, were long enough that the automatic phrase division resulted in more than 26 phrases, causing the rendering method to fail when attempting to query the DOM with a non-existent phrase index due to being out of bounds of the 26 character array used to generate the phrase indicator used in the DOM.

The method to generate said phrase indicator has been updated to generate two-letter indicators once the initial single-letter ones have been exhausted.

i.e. 0-25 => a-z
26+ => aa, ab, ... zz

Summary by CodeRabbit

  • Improvements
    • Verse and phrase labels now use multi-letter identifiers (aa, ab, etc.), enabling correct indexing beyond 26 items.
    • Footnote markers now follow the same multi-letter scheme so annotations remain unique and consistent in long passages.

✏️ Tip: You can customize this high-level summary in your review settings.

@FyreByrd FyreByrd requested a review from chrisvire January 16, 2026 17:59
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

The phrase and footnote indexing in ScriptureViewSofria.svelte was changed from single lowercase letters (a–z) to a base-26-style scheme producing multi-letter sequences (a–z, aa, ab, ...) for div IDs, data-verse/data-phrase attributes, and footnote symbols.

Changes

Cohort / File(s) Summary
Phrase & Footnote Indexing
src/lib/components/ScriptureViewSofria.svelte
Added createLetterIndex(index) and replaced single-letter indexing with base-26-style multi-letter indices for phrase div IDs, data-verse/data-phrase attributes, and footnote caller symbols.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hop from a to z, then trail to aa,
Letters stacking softly as indices play,
Nimbly I number each phrase and each line,
Bounding through verses—one hop at a time! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: extending phrase index indicators to support indices above 26 using double letters, which directly addresses the core problem and solution described in the PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.



📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4322a47 and 9ca7ee9.

📒 Files selected for processing (1)
  • src/lib/components/ScriptureViewSofria.svelte
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/components/ScriptureViewSofria.svelte
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member

@chrisvire chrisvire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the issue. Just move that code into a function and good to go.

i.e. 0-25 => a-z
26+ => aa, ab, ... zz

Break index calculation into separate function
@FyreByrd FyreByrd force-pushed the fix/long-verse-phrases branch from 4322a47 to 9ca7ee9 Compare January 16, 2026 19:19
@FyreByrd FyreByrd merged commit ef62fff into main Jan 16, 2026
4 checks passed
@FyreByrd FyreByrd deleted the fix/long-verse-phrases branch January 16, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants