Treat verse 0 as an ordinary verse; remove liveScrRef stickiness guard#134
Conversation
|
Warning Review limit reached
Next review available in: 39 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughRemoves verse-0 "stickiness" from InterlinearNavContext so liveScrRef always passes through rawScrRef, expands InterlinearizerLoader's activeScrRef to resolve any non-matching reference to the nearest preceding segment start (not just verse-0), updates related documentation, and adjusts/adds corresponding tests. ChangesVerse-0 navigation semantics
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Devin has a bug and some flags on this pr: https://app.devin.ai/review/sillsdev/interlinearizer-extension/pull/134 |
8b4cc27 to
b7403fb
Compare
A chapter's pre-verse-1 superscription is a real, focusable verse-0 segment, but `liveScrRef` held a stickiness guard that swallowed any same-chapter `verseNum: 0` reference naming the verse already shown. That guard was added (b9dec18, "fix verse-0 echo nav") before verse 0 was a parsed verse, to absorb the host's spurious post-verse-nav chapter echo. It could not distinguish that echo from a genuine external `<` (previous-verse) from verse 1 — both are same-chapter, verse 0, and markerless on the global selector path — so it also ate the intentional `<`, leaving the extension stuck on verse 1 instead of moving to the superscription. Verified in a live session (probe logging liveScrRef/rawScrRef) that the host no longer emits the spurious echo: exactly one delivery per navigation, never an unsolicited trailing verse 0. With the echo gone the guard defended against nothing, so remove it. Verse 0 now passes through verbatim; the host's `<` from verse 1 lands on the chapter's superscription (the loader resolves verse 0 to the superscription segment, else to verse 1). The internal-nav marker machinery is retained — it still classifies internal/external navigations for the recenter fade. Only its former role inside the verse-0 guard is gone. Tests: collapse the two sticky-behavior tests into one pass-through regression test; flip the mid-reveal fade test to expect the curtain to re-engage for a verse-0 navigation arriving during fade-in (verse 0 is now an ordinary mid-reveal move). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b7403fb to
f223dbc
Compare
This comment was marked as resolved.
This comment was marked as resolved.
|
The behavior is fine for me in the Psalms, so I think this is valid to act on: src/components/InterlinearNavContext.tsx:248 |
And perhaps see if a new test or two could target this regression concern. |
|
I believe the most recent commit suffices to simplify the logic. I had done a bit of testing on my own and found that the host was no longer sending echoes. I didn't tell you because I got distracted working on the other PR and I also wanted to see if you could find any issues with the host that I didn't see |
The host's next-verse button emits verseNum + 1 without clamping, so bumping forward from a chapter's last verse delivered a verse past the chapter's end; the loader only resolved verse-0 refs, and the segment window's anchor fallback jumped to the start of the book. Any unmatched verse now resolves to the nearest preceding segment start in its chapter, so the view holds at the chapter's end (and a verse inside a merged multi-verse segment resolves to its owning segment).
With verse-0 stickiness gone the two refs held the same object at every read, so one ref now serves both the duplicate-delivery identity guard and the mid-reveal prev comparison. The loader's activeScrRef owns the only raw→active mapping, which needs the loaded book anyway.
alex-rawlings-yyc
left a comment
There was a problem hiding this comment.
@alex-rawlings-yyc made 1 comment.
Reviewable status: 0 of 6 files reviewed, 1 unresolved discussion (waiting on alex-rawlings-yyc and imnasnainaec).
imnasnainaec
left a comment
There was a problem hiding this comment.
@imnasnainaec reviewed 6 files and all commit messages, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on alex-rawlings-yyc).
A chapter's pre-verse-1 superscription is a real, focusable verse-0 segment,
but
liveScrRefheld a stickiness guard that swallowed any same-chapterverseNum: 0reference naming the verse already shown. That guard was added(b9dec18, "fix verse-0 echo nav") before verse 0 was a parsed verse, to absorb
the host's spurious post-verse-nav chapter echo. It could not distinguish that
echo from a genuine external
<(previous-verse) from verse 1 — both aresame-chapter, verse 0, and markerless on the global selector path — so it also
ate the intentional
<, leaving the extension stuck on verse 1 instead ofmoving to the superscription.
Verified in a live session (probe logging liveScrRef/rawScrRef) that the host
no longer emits the spurious echo: exactly one delivery per navigation, never
an unsolicited trailing verse 0. With the echo gone the guard defended against
nothing, so remove it. Verse 0 now passes through verbatim; the host's
<fromverse 1 lands on the chapter's superscription (the loader resolves verse 0 to
the superscription segment, else to verse 1).
The internal-nav marker machinery is retained — it still classifies internal/external navigations for the recenter fade. Only its former role
inside the verse-0 guard is gone.
Tests: collapse the two sticky-behavior tests into one pass-through regression
test; flip the mid-reveal fade test to expect the curtain to re-engage for a
verse-0 navigation arriving during fade-in (verse 0 is now an ordinary mid-reveal move).
This change is
Summary by CodeRabbit