You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
YPE-2776 - feat(ui): show loading overlay when changing chapters in BibleReader (#259)
* YPE-2776 - feat(ui): show loading overlay when changing chapters in BibleReader
When changing chapters, BibleReader now keeps the previous chapter's text
mounted, dims it to 40% opacity, and floats a spinner over it after a short
delay — instead of pulsing stale text (confusingly reads as real content) or
flashing a blank spinner. Fast/cached switches stay instant since the dim and
spinner are gated behind a ~250ms delay.
- Lift usePassage into BibleReader.Content and pass passageState down so the
reader owns the loading treatment without touching BibleTextView. On refetch
it passes loading:false to suppress BibleTextView's pulse; first load keeps
BibleTextView's own centered spinner.
- Reset scroll to top on book/chapter change (instant); version-only swaps keep
scroll position.
- Single role=status live region for the overlay; LoaderIcon is decorative.
- Hoist useDelayedLoading out of bible-card.tsx into a shared lib util.
- Add deterministic unit test for the delay gate + an integration story
asserting stale text persistence, delayed dim+spinner, recovery, and scroll
reset.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(ui): address Greptile review on chapter-change loading overlay
- Center the loading spinner with sticky top-[50vh] (viewport-relative)
instead of top-1/2, which resolved to 50% of the tall passage container
and could strand the spinner off-screen when scrolled (e.g. on version
changes where scroll position is preserved).
- Drop redundant aria-live="polite"; role="status" already implies it.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* chore(ui): remove AI-generated comment slop from chapter loading overlay
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
BibleReader now keeps the previous chapter's text on screen while the next chapter loads, dimming it and floating a spinner over it (after a short delay) instead of pulsing stale text or flashing a blank spinner. Fast/cached chapter switches stay instant, the scroll position resets to the top on chapter change, and the `useDelayedLoading` helper is shared with BibleCard. No changes to BibleTextView.
0 commit comments