YPE-2479 - feat(ui): add onFootnotePress callback to BibleCard#238
Closed
Dustin-Kelley wants to merge 1 commit into
Closed
Conversation
Expose optional onFootnotePress on BibleCardProps and pass through to BibleTextView so hosts can handle footnotes externally (e.g. RN sheet). Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: 79a617b 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 |
Dustin-Kelley
commented
May 15, 2026
| @@ -0,0 +1,4 @@ | |||
| --- | |||
| "@youversion/platform-react-ui": patch | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
onFootnotePresstoBibleCardPropsand pass it through toBibleTextView(same pattern asBibleReader)FootnoteData@youversion/platform-react-uiTest plan
pnpm --filter @youversion/platform-react-ui test -- bible-card.test.tsxpnpm --filter @youversion/platform-react-ui typecheckpnpm --filter @youversion/platform-react-ui lintMade with Cursor
Greptile Summary
This PR adds an optional
onFootnotePresscallback toBibleCard, mirroring the identical pattern already established inBibleReader. When provided, it replaces the default footnote popover with a custom handler receivingFootnoteData; when omitted, behaviour is unchanged.bible-card.tsx: AddsonFootnotePress?: (data: FootnoteData) => voidtoBibleCardPropsand threads it through toBibleTextView, consistent withBibleReader's implementation.bible-card.test.tsx: Adds a newdescribeblock that rendersBibleCardwith footnote-containing HTML, clicks the footnote button, and asserts the callback receives the correctverseNumandreference..changeset/bible-card-footnote-press.md: Correct patch-level changeset entry for a non-breaking additive API change.Confidence Score: 5/5
Safe to merge; the change is a purely additive, optional prop that does not alter existing behaviour when omitted.
The new prop is optional and defaults to
undefined, so all existingBibleCardusages are unaffected. The implementation is a direct copy of the establishedBibleReaderpattern with no novel logic. The unit test correctly useswaitForto accommodateuseLayoutEffect-driven DOM mutations and asserts both call count and payload fields.No files require special attention.
Important Files Changed
onFootnotePressprop toBibleCardPropsand passes it toBibleTextView; follows the exact same pattern asBibleReader.describeblock covers the footnote press callback path; useswaitForcorrectly foruseLayoutEffect-driven DOM mutations.@youversion/platform-react-ui; correctly scoped for a non-breaking additive change.Sequence Diagram
sequenceDiagram participant Consumer participant BibleCard participant BibleTextView participant Verse.Html participant VerseFootnoteButton Consumer->>BibleCard: onFootnotePress (optional) BibleCard->>BibleTextView: onFootnotePress BibleTextView->>Verse.Html: onFootnotePress Verse.Html->>VerseFootnoteButton: onFootnotePress alt onFootnotePress provided VerseFootnoteButton-->>Consumer: onClick → onFootnotePress(FootnoteData) else onFootnotePress not provided VerseFootnoteButton-->>Consumer: shows default Popover endReviews (1): Last reviewed commit: "feat(ui): add onFootnotePress callback t..." | Re-trigger Greptile