YPE-1143: Mitigate BibleCard UI page shifting#177
Conversation
Replace static loading text with a spinning loader icon when book title is not yet available. This improves the user experience by providing a more visually clear indication that content is being fetched.
made it possible for the Bible text view to animate in height so that changes aren't jarring in the Bible card whenever it loads fully.
Add a pulse animation to the BibleTextView when content is loading. This improves the user experience by providing visual feedback during data fetching.
Refactors the `AnimatedHeight` component to use `offsetHeight` for more accurate height calculations. Also updates the Tailwind transition timing function to `ease-out` for a smoother animation.
🦋 Changeset detectedLatest commit: f345af0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…er loading state - Add role="status" and aria-label="Loading" to LoaderIcon for accessibility - Update bible-card and verse tests to use getByRole queries instead of CSS class selectors - Fix verse story to properly await loading assertion Amp-Thread-ID: https://ampcode.com/threads/T-019ca029-6aeb-73f2-970f-b06ef26ca45f Co-authored-by: Amp <amp@ampcode.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@greptileai, please review this PR |
Greptile SummaryThis PR successfully mitigates UI page shifting in Key improvements:
Technical implementation:
All changes follow project conventions, respect package boundaries, maintain unified versioning, and include proper test coverage. Confidence Score: 5/5
Important Files Changed
Last reviewed commit: fa2afe8 |
Adjusted the `BibleCard` component's styling to remove an unnecessary gap between the header and the main content, and added a bottom margin to the header section for better visual separation.
Only render `VerseUnavailableMessage` if `currentError` exists. Previously, it would also render if `fetchedError` existed, leading to an incorrect UI state.
|
@greptileai, based on your latest review, please go and update your initial review. ty ty ty |
|
@mic-mart would you be willing to review this PR if no one else can get to it? |
mic-mart
left a comment
There was a problem hiding this comment.
Overall
Nice work — this is a solid, well-tested approach to mitigating layout shift. The patterns here (stale-while-revalidate display, delayed spinner, ResizeObserver-based height animation) are all industry-standard best practices. Performance looks good: ResizeObserver avoids layout thrashing, animate-pulse is CSS-only, and timer cleanup is correct. Accessibility is in good shape with role="status", aria-label, and motion-reduce:transition-none.
A few optional suggestions inline — all non-blocking nits.
- Initialize AnimatedHeight with 'auto' instead of 0 to prevent flash-from-zero on mount - Add aria-busy attribute to verse wrapper during refetch for assistive tech - Add aria-hidden to LoaderIcon inside version picker button to prevent duplicate announcements Amp-Thread-ID: https://ampcode.com/threads/T-019cb0c7-af0a-7229-8a84-4345c6625fdc Co-authored-by: Amp <amp@ampcode.com>
|
@mic-mart ready for re-review or for final review |
mic-mart
left a comment
There was a problem hiding this comment.
LGTM! Thanks for nit-picking so quickly. ![]()
More info can be found in https://lifechurch.atlassian.net/browse/YPE-1143
Plz watch video demo first (1min)
Supporting SMOL video
CleanShot.2026-02-27.at.11.31.53.mp4