Skip to content

feat(ui): save notes from the Reader (YPE-6783) - #508

Merged
abharms merged 57 commits into
mainfrom
codex/YPE-6783-reader-save-notes
Dec 2, 2026
Merged

abharms merged 57 commits into
mainfrom
codex/YPE-6783-reader-save-notes

Conversation

@abharms

@abharms abharms commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Reader Save Notes — YPE-6783

Add Save to the Reader’s default verse actions. The Notes composer captures the exact selected passage, including gaps, with optional note text, Private/Public visibility, and highlight color. Each selected range displays its full reference, such as “John 1:2, John 1:4.” Successful saves clear the selection and refresh highlights for the displayed chapter.

Custom verseActionItems lists keep their existing actions and order. Set includeSave on BibleReader.Root to append Save when Notes are available. The published BuiltInVerseAction, VerseActionPopoverItem, and BibleReaderVerseActionItem types remain unchanged. The demo includes Save alongside its custom marker action.

Readers with built-in auth request Notes authorization when needed. Signed-in users missing write_notes go directly to OAuth; signed-out users first see the sign-in introduction. Host-controlled and disabled auth retain their existing ownership boundaries.

Drafts survive cancellation, declined authorization, recoverable failures, and OAuth redirects. Sign-out or account replacement invalidates owned drafts, and stale callbacks cannot resume another account’s action. Retries reuse the draft UUID; when a create response is lost, the Reader recovers the original note before reconciling later edits through an update. Successful API responses may normalize note content.

The composer uses the SDK’s centered dialog with a bookmark/passage header, privacy toggle, and filled note field. The privacy toggle supports pointer, Enter, and Space activation and is disabled while saving. Discard confirmation uses the existing dialog and button primitives. Visual reference: Figma Notes section; a dedicated discard design has not been verified.

This is an additive minor release scoped to note creation. Saved-note indicators, lists, editing, deletion, and tags remain deferred.

Validation

Validated at fe2b3fe:

  • Workspace build, lint, and type checks passed.
  • Workspace unit suite: 1,308 passed; 3 opt-in tests skipped.
  • All 15 Notes browser journeys passed, including custom-list Save opt-in, full-range reference titles, permission loss while editing, draft recovery, and account invalidation.
  • Full-app mocked Notes smoke passed: OAuth callback routing, decline, signed-in scope upgrades, custom actions with Save, competing highlight intent, token-service recovery, exact create payload, stale callbacks, same-account re-sign-in, sign-out, navbar scopes, and narrow layout.
  • Earlier checks verified existing consumer exhaustive maps/string guards against the built declarations and selected Reader workflows in Firefox and WebKit. Those cross-browser checks were not rerun for fe2b3fe.

Live API limitation

Passage-only saves send empty content. The last verified live request returned HTTP 400 (content: String should have at least 1 character); the API-owned fix still needs deployment and live retesting. No placeholder workaround was added. Mocked tests do not establish live passage-only support.

Earlier live text-filled saves passed composer close, exact passage/color persistence, and highlight refresh. BrowserStack run TR-17 records three passed cases linked to YPE-6783. These results came from local Chromium execution and exclude the blocked passage-only case.

Confidence Score: 5/5RetriggerView in Greptile

The latest change appears safe to merge and keeps the existing custom-action check intact.

Summary

Adds Reader note creation with captured verse selections, account-bound authorization, retained drafts, and retry recovery.

  • The Bible Reader saves selected verses as Notes with optional text and color.
  • Reader sign-in keeps Notes drafts tied to the account that authorized them.
  • The Reader Notes example and CI now cover the mocked save flow.

Reviews (38) · Last reviewed commit: "test(ui): wait for custom action popover..." · Reviewed by Greptile

platform-localization-pr-bot Bot and others added 15 commits November 24, 2026 10:30
chore: sync react localization

Co-authored-by: camrun91 <16566029+camrun91@users.noreply.github.com>
* fix(core): sanitize planted footnote content in Bible HTML

Co-Authored-By: Cameron Pak <cameronandrewpak@gmail.com>

* fix(core): address review on footnote sanitization

Sanitize footnote content in an inert template, drop non-HTML-namespace
elements, sanitize generated footnote content for idempotency, document the
sanitization contract, and consolidate tests.

Co-Authored-By: Cameron Pak <cameronandrewpak@gmail.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* refactor(ui): organize Bible reader modules (YPE-6808)

* refactor(ui): extract reader settings lifecycle and toolbar (#495)

* refactor(ui): extract reader settings lifecycle and toolbar (YPE-6815)

* fix(ui): address reader settings review feedback
* feat(ui): re-export passage and versions hooks

Amp-Thread-ID: https://ampcode.com/threads/T-01a20e73-4446-71f0-950a-3054df5492c7

* chore(ci): remove packed UI consumer check

* docs(ui): clarify shared provider import guidance

Amp-Thread-ID: https://ampcode.com/threads/T-01a20e73-4446-71f0-950a-3054df5492c7

* docs: address hook re-export review nits

Amp-Thread-ID: https://ampcode.com/threads/T-01a20e73-4446-71f0-950a-3054df5492c7

---------

Co-authored-by: Amp <amp@ampcode.com>
* fix(ui): preserve focus at high zoom

* fix(ui): harden zoom focus coverage

* refactor(ui): simplify zoom focus handling

* test(ui): cover zoom focus behavior

* test(ui): focus reader close before asserting

* fix(ui): address zoom review findings

* test(ui): compare pointer focus styles

* test(ui): respect focus-visible heuristics

* test(ui): use native focus traversal

* fix(ui): scope focus preservation

* fix(ui): preserve sign-in focus contrast

* test(ui): await close focus transition

* refactor(ui): centralize picker scroll geometry

* fix(ui): keep picker focus visible in constrained panels

* fix(ui): preserve the expanded book trigger in compact panels

* test(ui): reach reader settings close with native keys

* fix(ui): honor reduced motion in chapter reveal

* fix(ui): address focus and scroll review feedback

* fix(ui): reveal focused chapters in Firefox

Keep focused book triggers fully visible within the built-in accordion on Linux Firefox. Wait for the settings dialog opening animation before asserting visibility in WebKit.

* test(ui): query the current settings dialog while opening
* feat(core): add content library video APIs

* refactor(core): simplify video schema ownership

* fix(core): harden content library contracts

* fix(core): validate video response boundaries

* fix(core): distinguish no-content responses

* fix(core): scope no-content status handling

* fix(core): distinguish empty response bodies

* test(core): isolate Content Library smoke coverage

* feat(core): keep content library APIs compatible with v3

* fix(core): align content library rollout contracts (YPE-6573)

* fix(core): accept empty video filters and trim search bundles (YPE-6573)

* fix(core): address content library review feedback (YPE-6573)

* docs(core): clarify video APIs and live validation (YPE-6573)

* fix(core): use stable Content Library routes (YPE-6573)
* feat(core): add Notes API client

Amp-Thread-ID: https://ampcode.com/threads/T-01a2095d-25a9-72c5-a0fb-baa79c35e05a

* fix(core): address Notes API review feedback

Amp-Thread-ID: https://ampcode.com/threads/T-01a2095d-25a9-72c5-a0fb-baa79c35e05a

* fix(core): normalize Notes write colors

* fix(core): address Notes API contract review

* fix(core): enforce Notes version filters and tolerate malformed passages

* fix(core): isolate malformed Notes list records

Amp-Thread-ID: https://ampcode.com/threads/T-01a2095d-25a9-72c5-a0fb-baa79c35e05a

* chore: refresh combined core bundle budget

Amp-Thread-ID: https://ampcode.com/threads/T-01a2095d-25a9-72c5-a0fb-baa79c35e05a

---------

Co-authored-by: Amp <amp@ampcode.com>
* fix(ui): label reader sign-in menu trigger (YPE-6810)

* test(ui): capture Linux WebKit dialog visibility failures

* test(ui): stress WebKit visibility diagnostics

* test(ui): check settings visibility after keyboard focus

Assert dialog opening state after Enter and visibility on the Close button after native Tab, alongside the focus-ring checks. Remove temporary WebKit diagnostics and repeated CI groups.
* fix(ui): handle reader clipboard failures (YPE-6809)

* fix(ui): report clipboard failures and retry failed shares

* fix(ui): keep clipboard warnings visible while scrolling

* fix(ui): ignore stale clipboard action results
* fix(ui): retain iframe verse selection and anchors (YPE-6410)

* test(ui): cover iframe highlight painting and reset

* fix(ui): complete iframe reader text and focus handling
chore(ui): align declaration build with strict checks

Refs: YPE-6464
* chore(ui): align declaration build with strict checks

Refs: YPE-6464

* chore: enable additional TypeScript safety checks

Refs: YPE-6832
* feat(ui): customize verse actions and indicators

Refs: YPE-6782
Signed-off-by: Austin <abharms@gmail.com>

* test(ui): wait for verse layout in browser journeys

Refs: YPE-6782
Signed-off-by: Austin <abharms@gmail.com>

* fix(ui): keep configured verse actions reachable

Make exiting actions inert and keep the visible verse indicator inside its pointer target.

Refs: YPE-6782
Signed-off-by: Austin <abharms@gmail.com>

* fix(ui): keep verse callbacks scoped to the displayed passage

Refs: YPE-6782
Signed-off-by: Austin <abharms@gmail.com>

* fix(ui): preserve verse action focus and warning visibility

Signed-off-by: Austin <abharms@gmail.com>

* fix(ui): restore focus after rejected verse action dismissal

Refs: YPE-6782
Signed-off-by: Austin <abharms@gmail.com>

---------

Signed-off-by: Austin <abharms@gmail.com>
@changeset-bot

changeset-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fe2b3fe

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@youversion/platform-react-ui Minor
@youversion/platform-core Minor
@youversion/platform-react-hooks Minor
vite-react Patch

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

Preserve the draft on browser Back and clean up a partially persisted automatic token refresh. Keep the composer within narrow viewports and simplify the shared action and highlight paths.

Ref: YPE-6783
Keep note handoffs bound to their initiating Reader and authorization attempt. Preserve focus, existing verse actions, and a recoverable draft across OAuth failures and navigation.

Ref: YPE-6783
Keep OAuth recovery bound to the initiating draft and restore focus around the Notes composer. Refresh highlights for the passage on screen and preserve existing host sign-in behavior.

Ref: YPE-6783
@abharms
abharms force-pushed the codex/YPE-6783-reader-save-notes branch from 18244d4 to 24e6dd4 Compare November 27, 2026 16:23
Keep host-controlled toolbar scopes, restore legacy startup token rotation, and retain the captured draft through a verified failed callback. Verify the workflow with isolated browser fixtures and native Safari.

Ref: YPE-6783
Keep verified legacy auth tokens available, discard drafts for ended sessions, restore selection during host takeover, and gate highlight writes to the rendered passage.

Ref: YPE-6783
Retain clean-canceled drafts across navigation, allow matching-chapter highlight intents, and keep verified auth state bound to its active account and handoff.

Ref: YPE-6783
@abharms

abharms commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator Author

@greptileai review

@abharms

abharms commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T02:49:59.629169Z 12992c9 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1f0a017475

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Resume Notes on the verified configured callback, supersede an older pending highlight action, and keep account-bound requests and drafts tied to the right session. Preserve standalone swatch outlines under host styling.

Ref: YPE-6783
Retry the original create payload, then reconcile the current draft against the recovered note ID using the verified writer token. Keep that ID and draft after a failed update.

Ref: YPE-6783

@bmanquen bmanquen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 blocking issue inline.

@abharms
abharms marked this pull request as draft December 1, 2026 14:57
Reconcile current draft fields against the original submitted fields rather than the API response. Trust validated successful updates while retaining the resource-ID check. Existing Notes journeys cover trimmed update content and normalized create line endings.
camrun91
camrun91 previously approved these changes Dec 1, 2026
Keep the published built-in action union and explicit custom action lists unchanged. Save remains in the default actions, so Notes can ship as a minor addition. Preserve both sample demonstrations with a default/custom action toggle.
@abharms
abharms requested a review from bmanquen December 1, 2026 16:52
@abharms
abharms marked this pull request as ready for review December 1, 2026 16:52

@bmanquen bmanquen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 blocking issues inline.

@abharms
abharms merged commit 1d4eaef into main Dec 2, 2026
50 checks passed
@abharms
abharms deleted the codex/YPE-6783-reader-save-notes branch December 2, 2026 14:01
cameronapak pushed a commit that referenced this pull request Dec 2, 2026
Bring in Reader Notes (#508) and the localization sync (#512). The Bible
screen keeps the redesigned layout and adds main's Notes, custom actions,
and verse markers. The Notes smoke now signs in and out through the
Profile screen, which replaced the old header navbar.

Signed-off-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a23228-868c-7460-985b-7a4c2fc0984b
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.

4 participants