Skip to content

feat(ui): render footnote sheets with native text - #205

Draft
Dustin-Kelley wants to merge 5 commits into
v2.0from
cursor/native-footnote-content-5e5b
Draft

Dustin-Kelley wants to merge 5 commits into
v2.0from
cursor/native-footnote-content-5e5b

Conversation

@Dustin-Kelley

@Dustin-Kelley Dustin-Kelley commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Why

A footnote marker tap already opens a native sheet. The body of that sheet was a second WebView around the web FootnoteContent component. YPE-5832 / RNV2-5 asks for that body to be native when plain text can keep the formatting people actually see.

Sample notes are USFM spans, not links or lists. fqa and fq are italic alternate readings, fk and fl are medium italic, fp starts a new paragraph, and verse HTML carries sup markers plus words-of-Jesus and small-caps spans. The passage sanitizer already unwraps anchors. Option A ships. packages/ui/src/dom/footnote-content.tsx stays on disk and is no longer registered, so RNV2-10 can delete it. There is no runtime switch.

Native
Native footnote
Webview
Webview footnote

Scope

  • parseFootnoteHtml and footnoteMarker in packages/ui/src/lib/footnote-html.ts
  • Native FootnoteContent in packages/ui/src/native/footnote-content.tsx, registered for the existing FootnoteContent impl
  • BibleTextView, BibleCard, and BibleReader still own the sheet and onFootnotePress. Those three sheets no longer show the Android WebView loader.
  • serifFace in packages/ui/src/theme/fonts.ts
  • Minor changeset for both packages

Scripture in BibleTextView stays in the DOM. Highlights and the pickers are unchanged.

Tradeoffs

A WebView body would have kept every browser default, including tags the fixtures never show. The run parser covers the spans in the John fixtures and the tags the sanitizer allows for emphasis, breaks, and superscripts. Tables in a note would flatten to text.

Card is not used. Its fill would paint a second surface on the sheet.

Italics use Untitled Serif. Registered Inter faces have no italic cut, and the serif fallback does. The verse quote uses that serif at the host fontSize, or 20 when the host omits it. Notes stay at the small type step.

.fr locators are bold, and words of Jesus use the wj token. The web popup stylesheet does not apply those rules, because they live on the reader root. The quote stays closer to the chapter.

When reference is missing, the heading is the verse number. There is no native string for the web "Verse N" label, and locale files in this repo are generated. Reader payloads include reference.

A very long note sizes with the sheet and can clip at the screen. An inner scroll view would make everyday short notes tall.

Blast Radius

Anyone who taps a footnote marker in Bible Text View, Bible Card, or Bible Reader gets this body. A consumer onFootnotePress still replaces the sheet entirely. Public props are unchanged. The unused DOM footnote file is the only leftover for RNV2-10.

Verification

pnpm exec jest in packages/ui passed for footnote-html.test.ts, footnote-content.test.tsx, bible-text-view.test.tsx, and bible-card.test.tsx (65 tests). One host test presses the marker and reads the word footnote from <p>footnote</p>. Component tests check light and dark wj color, italic understood, a 22px verse, and a 20px default.

tsc --noEmit -p packages/ui/tsconfig.test.json passed. oxlint on the touched files passed.

An iOS or Android device was not run. Clipping on a very long note, and live API HTML beyond the John fixtures, are unproven on a phone.

Open in Web Open in Cursor 

cursoragent and others added 5 commits September 22, 2026 15:50
Turn note and verse HTML into paragraphs of text runs so a native
sheet can keep italics, bold locators, and superscripts.

Co-authored-by: Dustin Kelley <Dustin-Kelley@users.noreply.github.com>
YPE-5832 / RNV2-5. Marker taps still open the existing native sheet.
The sheet body uses themed text instead of the footnote WebView.

Co-authored-by: Dustin Kelley <Dustin-Kelley@users.noreply.github.com>
The web sheet leaves reader classes plain, raises the verse marker, and uses 12px notes. Spaces on both sides of a tag now collapse so verses do not show a double space.

Co-authored-by: Cursor <cursoragent@cursor.com>
System text size was scaling the sheet larger than the webview, and a nested text shift left the marker on the baseline. Lock font scaling and raise the marker with an inline view.

Co-authored-by: Cursor <cursoragent@cursor.com>
The native sheet replaced it, so the DOM wrapper and the webview-only props it required are gone.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants