feat(ui): add onFootnotePress callback to BibleCard#244
Open
Dustin-Kelley wants to merge 3 commits into
Open
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: 63ec262 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 |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Dustin Kelley <141975656+Dustin-Kelley@users.noreply.github.com>
Bump changeset to minor for new public API prop and assert notes payload in BibleCard onFootnotePress test. Co-authored-by: Cursor <cursoragent@cursor.com>
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 forward it to the internalBibleTextView@youversion/platform-react-uiTest plan
pnpm test bible-card.test.tsxinpackages/uiMade with Cursor
Greptile Summary
This PR adds an optional
onFootnotePresscallback toBibleCard, mirroring the existing pattern fromBibleReader, and threads it through to the internalBibleTextView. When provided, the callback replaces the built-in popover with a consumer-controlled handler receivingFootnoteData(verseNum, notes, verseHtml, reference).bible-card.tsx: AddsonFootnotePress?: (data: FootnoteData) => voidtoBibleCardProps, destructures it inBibleCard, and forwards it toBibleTextView.bible-card.test.tsx: New describe block renders a passage with a raw footnote span, waits for the footnote button, clicks it, and asserts the fullFootnoteDatapayload includingverseNum,reference, and thenotesarray content..changeset/bible-card-footnote-press.md: Changeset correctly marked asminorfor the new optional public API addition.Confidence Score: 5/5
Safe to merge — the change is additive and opt-in, with no modifications to existing behavior.
The new prop is optional and strictly additive: existing consumers who do not pass
onFootnotePresscontinue to get the built-in Popover unchanged. The prop is already exported viaFootnoteDatain the package's public index, the test exercises the full click-to-callback path with payload assertions, and the changeset is correctly labeledminor.No files require special attention.
Important Files Changed
onFootnotePressprop toBibleCardPropsand forwards it toBibleTextView; change is minimal and follows the existingBibleReaderpattern exactly.waitFor+userEventto verify the footnote button click callsonFootnotePresswith the fullFootnoteDatapayload includingnotescontent.minorbump for the new optional public API prop.Sequence Diagram
sequenceDiagram participant Consumer participant BibleCard participant BibleTextView participant VerseHtml as Verse.Html participant BibleTextHtml participant VerseFootnoteButton Consumer->>BibleCard: render with onFootnotePress BibleCard->>BibleTextView: passageState + onFootnotePress BibleTextView->>VerseHtml: html + onFootnotePress VerseHtml->>BibleTextHtml: transformedHtml + onFootnotePress BibleTextHtml->>BibleTextHtml: useLayoutEffect extracts footnote anchors BibleTextHtml->>VerseFootnoteButton: portal per anchor with onFootnotePress Note over VerseFootnoteButton: onFootnotePress present → plain button (no Popover) Consumer->>VerseFootnoteButton: click footnote button VerseFootnoteButton->>Consumer: "onFootnotePress({ verseNum, notes, verseHtml, reference })"Reviews (3): Last reviewed commit: "fix(ui): address greptile review feedbac..." | Re-trigger Greptile