Repository navigation
feat(core): add Notes API client - #497
Conversation
🦋 Changeset detectedLatest commit: a3597ed 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 |
abharms
left a comment
There was a problem hiding this comment.
Two specific test coverage highlights:
|
|
||
| const first = await client.getNotes(filters, 'reader'); | ||
| expect(first).toEqual({ data: [], next_page_token: cursor }); | ||
| const last = await client.getNotes({ ...filters, page_token: first.next_page_token }, 'reader'); |
There was a problem hiding this comment.
praise: The pagination test follows a continuation token from an empty filtered page. That catches a subtle case where callers could otherwise stop early and miss notes.
| expect(await client.getNote(created.id, 'reader')).toEqual(note); | ||
| const updated = await client.updateNote(created.id, update, 'writer'); | ||
| expect(updated).toEqual({ ...note, ...update }); | ||
| expect(await client.getNote(updated.id, 'reader')).toEqual(updated); |
There was a problem hiding this comment.
praise: The CRUD workflow clears nullable fields and reads the note back while checking that content remains intact. That verifies the distinction between clearing a field and leaving it unchanged.
|
|
||
| const passageId = z.string().check(z.refine((value) => value.trim().length > 0)); | ||
| const title = z.optional(z.nullable(z.string())); | ||
| const color = z.optional(z.nullable(z.string().check(z.regex(/^[0-9a-f]{6}$/)))); |
There was a problem hiding this comment.
issue (blocking): uppercase colors from the API reject the whole notes page
NoteSchema reuses this lowercase-only regex, but the API can return colors in any case (see schemas/highlight.ts:4-6). One note with FF0000 makes getNotes throw for the whole page.
| const color = z.optional(z.nullable(z.string().check(z.regex(/^[0-9a-f]{6}$/)))); | |
| const color = z.optional(z.nullable(z.string().check(z.regex(/^[0-9a-f]{6}$/i)))); |
There was a problem hiding this comment.
Fixed in 84eef22. Notes responses now accept six hex digits in either case and preserve the returned color. Writes still require lowercase, as documented in the Notes API contract.
Verification evidence
- The mocked pagination test returned an uppercase color after an empty page with a cursor. It failed before the fix and passed after it. A malformed color is still rejected, and the write test verifies uppercase input does not reach HTTP.
pnpm testpassed; no live casing check was run.
Written by Coding Agent on behalf of Cam.
There was a problem hiding this comment.
Verified at 84eef22: responses accept either case, and the pagination test covers an uppercase color.
|
|
||
| const NotePassageInputSchema = strictObject({ | ||
| /** Bible version identifier, sent on the wire as `bible_id`. */ | ||
| version_id: z.int32(), |
There was a problem hiding this comment.
suggestion (non-blocking): reject non-positive version IDs
z.int32() accepts -1, so getNotes({ version_id: -1 }) sends ?bible_id=-1. Use BibleVersionIdSchema here and in GetNotesOptionsSchema (line 84), like the highlights and search clients.
There was a problem hiding this comment.
Fixed in 84eef22. Note list and write passage inputs reject non-positive version IDs before HTTP and retain the API’s signed 32-bit bound. Configured version filters are unchanged.
Verification evidence
pnpm testpassed, including the Notes workflow that rejects a negative list ID and a zero update passage ID before either reaches HTTP. The negative list ID reached the HTTP mock before the fix.
Written by Coding Agent on behalf of Cam.
There was a problem hiding this comment.
Verified: list and write inputs reject 0 and negatives before any request.
| /** OIDC scopes that must not be stored in the data-exchange permission cache. */ | ||
| const OIDC_SCOPES = new Set(['openid', 'profile', 'email', 'offline_access']); | ||
| /** OAuth scopes that must not be stored in the data-exchange permission cache. */ | ||
| const NON_PERMISSION_SCOPES = new Set([ |
There was a problem hiding this comment.
suggestion (non-blocking): test that every AuthenticationScopes value is in this set
A scope added later but missed here would be stored as a data-exchange permission.
There was a problem hiding this comment.
Fixed in 84eef22. The scope lookup is exhaustive over the public authentication scope type, so adding a scope without classifying it fails typecheck.
Verification evidence
pnpm --filter @youversion/platform-core typecheckandpnpm testpassed. The callback test supplies all current authentication scopes and checks that only the separate highlights grant is saved to the permission cache.
Written by Coding Agent on behalf of Cam.
There was a problem hiding this comment.
Verified: adding a scope to AuthenticationScopes without listing it here fails typecheck. That covers it.
|
|
||
| /** Lists one page of notes. An empty page can still have a `next_page_token`. */ | ||
| async getNotes(options: GetNotesOptions = {}, lat?: string): Promise<Collection<Note>> { | ||
| const { version_id, passage_id, page_size, page_token } = GetNotesOptionsSchema.parse(options); |
There was a problem hiding this comment.
nitpick (non-blocking): invalid input throws a raw ZodError with a JSON message
HighlightsClient throws readable errors such as "Version ID must be a positive integer".
There was a problem hiding this comment.
I’m keeping the schema validation errors here. Search and Bible clients also surface them directly, and callers retain the field paths. I’d leave message formatting to a shared SDK convention rather than add a Notes-only wrapper.
Verification evidence
- At 84eef22, source inspection confirmed that
NotesClient,searchVerses, and the Bible chapter client validate caller input with schema.parse(). The Notes tests inpnpm testpassed, including invalid inputs rejected before HTTP.
Written by Coding Agent on behalf of Cam.
There was a problem hiding this comment.
Fair. The search and Bible chapter clients also throw raw schema errors, so this can wait for a shared convention.
bmanquen
left a comment
There was a problem hiding this comment.
2 non-blocking comments inline.
| /** Six lowercase hex digits without `#`. */ | ||
| color: z.optional(z.nullable(z.string().check(z.regex(/^[0-9a-f]{6}$/)))), |
There was a problem hiding this comment.
suggestion (non-blocking): lowercase write colors instead of rejecting uppercase
Responses now keep the API's case, so updateNote(id, { color: note.color }) throws when the API returned 44AA44. Lowercasing before the check still sends lowercase on the wire. The test at notes.test.ts:140 would need to flip.
| /** Six lowercase hex digits without `#`. */ | |
| color: z.optional(z.nullable(z.string().check(z.regex(/^[0-9a-f]{6}$/)))), | |
| /** Six hex digits without `#`, sent lowercase. */ | |
| color: z.optional(z.nullable(z.string().check(z.toLowerCase(), z.regex(/^[0-9a-f]{6}$/)))), |
There was a problem hiding this comment.
Fixed in 10dd292. Create and update accept either hex color case and send lowercase to the API. Responses still preserve the original case, so callers can pass a returned color back into a write.
Verification evidence
- The mocked Notes lifecycle failed on uppercase input before the fix. It now verifies lowercase POST and PATCH payloads when given uppercase input, including a color returned by GET. The invalid-color and nullable-field cases still pass.
pnpm test: 1,184 passed, 2 opt-in live Search tests skipped. No live Notes retest.
Written by Coding Agent on behalf of Cam.
| .string() | ||
| .check( | ||
| z.refine( | ||
| (id) => id.trim().length > 0 && id !== '.' && id !== '..', |
There was a problem hiding this comment.
todo (non-blocking): test the . and .. note ID guard
URLs drop dot segments, so without this check deleteNote('..') sends DELETE to /v1/. Nothing fails if it is removed. Add to the pre-request test:
await expect(client.deleteNote('..', 'writer')).rejects.toThrow('Note ID');
await expect(client.getNote('.', 'reader')).rejects.toThrow('Note ID');There was a problem hiding this comment.
Added regression coverage in 10dd292. The existing guard is unchanged.
Verification evidence
- The mocked client test checks that GET with
.and DELETE with..reject as invalid note IDs. A handler covering the whole fixture host verifies neither sends an HTTP request.pnpm testpassed, including all 10 Notes tests.
Written by Coding Agent on behalf of Cam.
There was a problem hiding this comment.
1 change needed before approval, the rest are optional. I relabeled the earlier comments to match.
changes needed before approval
packages/core/src/notes.ts:97:NotesClientskips the app's Bible version filter (see the inline comment).
optional (nit)
packages/core/src/schemas/note.ts: add JSDoc to theNotefields and exported types.packages/core/src/client.ts: add JSDoc and tests forgetWithStatusandpatch, and exportApiResponseor mark the method@internal.packages/core/src/__tests__/notes.test.ts: cover the untested validators (nullpage_token, blank IDs, badpage_size,language_tag,tags, emptycontent).NotesClientmethod JSDoc, changeset wording, PATCH mock branching, README refetch note,statusenum, andGetNotesOptionsSchemaplacement (see the inline comments).scopesJSDoc inYouVersionAuthButton.tsxanduseYVAuth.ts, and the test count in the PR description.
| ), | ||
| ); | ||
|
|
||
| export const NoteSchema = object({ |
There was a problem hiding this comment.
optional (nit): Most Note fields and exported type aliases have no JSDoc, so the published .d.ts has no field docs. Add a short /** ... */ to each field and type, like schemas/highlight.ts.
There was a problem hiding this comment.
Added field and exported-type JSDoc, including nullable fields, timestamp format, and malformed-passage handling.
Verification evidence
- Revision: cf1d29e, including the preceding documentation/test commit.
- Inspected the emitted Core declarations to confirm the docs survive the build.
- Local workspace checks:
env -u INTEGRATION_TESTS YVP_APP_KEY=test-key YVP_API_HOST=api.youversion.com pnpm testpassed 1,188 tests (366 Core, 200 Hooks, 622 UI); two opt-in live Search cases skipped. Core typecheck and tree-shaking checks passed. No live Notes retest on this revision.
Written by Coding Agent on behalf of Cam.
| } | ||
|
|
||
| /** Sends a GET request and returns its status alongside the decoded body. */ | ||
| async getWithStatus<T>( |
There was a problem hiding this comment.
optional (nit): getWithStatus and patch ship on the public ApiClient, but ApiResponse is not exported and the methods have no full JSDoc or client.test.ts tests. Export ApiResponse and match the sibling JSDoc, or mark getWithStatus @internal with stripInternal.
There was a problem hiding this comment.
Kept the transport methods public, exported ApiResponse from Core, and added full method JSDoc and direct transport coverage.
Verification evidence
- Revision: cf1d29e, including the preceding documentation/test commit.
client.test.tsverifies GET status plus decoded body, query/header forwarding, and PATCH JSON with explicit nulls.- Local workspace checks:
env -u INTEGRATION_TESTS YVP_APP_KEY=test-key YVP_API_HOST=api.youversion.com pnpm testpassed 1,188 tests (366 Core, 200 Hooks, 622 UI); two opt-in live Search cases skipped. Core typecheck and tree-shaking checks passed. No live Notes retest on this revision.
Written by Coding Agent on behalf of Cam.
| await expect(client.getNote(updated.id, 'reader').catch(getHttpStatus)).resolves.toBe(404); | ||
| }); | ||
|
|
||
| it('rejects invalid writes, pagination, and missing auth before sending a request', async () => { |
There was a problem hiding this comment.
optional (nit): Some validators have no test, so removing them still passes (null page_token, blank IDs, page_size 0 or 1.5, bad language_tag, bad tags, empty content). Add these inputs to this pre-request test with requests === 0.
There was a problem hiding this comment.
Added the requested boundary coverage through NotesClient, including null cursors, blank IDs, page-size bounds, invalid language/tags/content, unknown write keys, and invalid response IDs.
Verification evidence
- Revision: cf1d29e, including the preceding documentation/test commit.
- The pre-request validation checks assert zero HTTP requests; null cursors are omitted from the query. All 13 Notes tests passed.
- Local workspace checks:
env -u INTEGRATION_TESTS YVP_APP_KEY=test-key YVP_API_HOST=api.youversion.com pnpm testpassed 1,188 tests (366 Core, 200 Hooks, 622 UI); two opt-in live Search cases skipped. Core typecheck and tree-shaking checks passed. No live Notes retest on this revision.
Written by Coding Agent on behalf of Cam.
| } | ||
|
|
||
| /** Creates a note using the caller's `request_id` for idempotent retries. */ | ||
| async createNote(data: CreateNote, lat?: string): Promise<Note> { |
There was a problem hiding this comment.
changes needed before approval: NotesClient skips the app's version filter, so with excludedVersionIds = [3034] a colored note on version 3034 still sends POST /v1/notes, while HighlightsClient refuses it before the network. CONTEXT.md says an unusable version is refused on every surface. Call assertUsableVersion in createNote, updateNote, and getNotes with a 0-request test, or record the Notes exception in CONTEXT.md and the core README.
There was a problem hiding this comment.
Notes now uses the shared version guard for a supplied list version ID or a create/update passage reference, following Cameron’s clarification. Excluded IDs return 403 before HTTP; language filtering uses the same metadata check. This does not filter historical notes on unscoped reads or inspect an unchanged passage on a color-only update.
Verification evidence
- Revision: cf1d29e, including the preceding documentation/test commit.
- The new regression failed before the fix. The passing client test covers exclusions, allowlists, language restrictions including missing language, and list/create/update boundaries. All 13 Notes tests passed.
- Local workspace checks:
env -u INTEGRATION_TESTS YVP_APP_KEY=test-key YVP_API_HOST=api.youversion.com pnpm testpassed 1,188 tests (366 Core, 200 Hooks, 622 UI); two opt-in live Search cases skipped. Core typecheck and tree-shaking checks passed. No live Notes retest on this revision.
Written by Coding Agent on behalf of Cam.
| this.client = client; | ||
| } | ||
|
|
||
| /** Lists one page of notes. An empty page can still have a `next_page_token`. */ |
There was a problem hiding this comment.
optional (nit): These methods have one-line JSDoc with no @param, @returns, @throws, or required scope. Match the HighlightsClient JSDoc style.
There was a problem hiding this comment.
Expanded Notes method JSDoc with parameters, returns, failures, required scopes, cursor behavior, and omission versus null. Also clarified OAuth scopes versus data-exchange permissions in useYVAuth and YouVersionAuthButton.
Verification evidence
- Revision: cf1d29e, including the preceding documentation/test commit.
- Inspected emitted Core, Hooks, and UI declarations after the build.
- Local workspace checks:
env -u INTEGRATION_TESTS YVP_APP_KEY=test-key YVP_API_HOST=api.youversion.com pnpm testpassed 1,188 tests (366 Core, 200 Hooks, 622 UI); two opt-in live Search cases skipped. Core typecheck and tree-shaking checks passed. No live Notes retest on this revision.
Written by Coding Agent on behalf of Cam.
| '@youversion/platform-core': minor | ||
| --- | ||
|
|
||
| Add `NotesClient` to list, get, create, update, and delete a user's notes through the regular `/v1/notes` API. |
There was a problem hiding this comment.
optional (nit): The changeset mentions only NotesClient. Also mention the new read_notes and write_notes scopes and any public ApiClient additions.
There was a problem hiding this comment.
Expanded the changeset to cover Notes auth scopes, public ApiClient additions, the UI re-export, supplied-input version filtering, and malformed-passage tolerance.
Verification evidence
- Revision: cf1d29e, including the preceding documentation/test commit.
- Source inspection of
.changeset/quiet-notes-client.mdagainst the public exports and changed behavior. - Local workspace checks:
env -u INTEGRATION_TESTS YVP_APP_KEY=test-key YVP_API_HOST=api.youversion.com pnpm testpassed 1,188 tests (366 Core, 200 Hooks, 622 UI); two opt-in live Search cases skipped. Core typecheck and tree-shaking checks passed. No live Notes retest on this revision.
Written by Coding Agent on behalf of Cam.
| }), | ||
| http.patch(resourceUrl, async ({ request }) => { | ||
| expect(request.headers.get('authorization')).toBe('Bearer writer'); | ||
| const fields = stored?.color === create.color ? { color: note.color } : update; |
There was a problem hiding this comment.
optional (nit): Branching on stored?.color === create.color in the PATCH mock hides which request each step checks. Two sequential server.use(http.patch(...)) handlers would make each step explicit.
There was a problem hiding this comment.
Replaced the PATCH mock’s stored-color branch with explicit sequential handlers so each update checks its own request.
Verification evidence
- Revision: cf1d29e, including the preceding documentation/test commit.
- The CRUD workflow still verifies clearing nullable fields, preserving omitted content, and reading the saved result. All 13 Notes tests passed.
- Local workspace checks:
env -u INTEGRATION_TESTS YVP_APP_KEY=test-key YVP_API_HOST=api.youversion.com pnpm testpassed 1,188 tests (366 Core, 200 Hooks, 622 UI); two opt-in live Search cases skipped. Core typecheck and tree-shaking checks passed. No live Notes retest on this revision.
Written by Coding Agent on behalf of Cam.
| await notes.updateNote(note.id, { title: 'Morning reflection' }, accessToken); | ||
| ``` | ||
|
|
||
| Keep the filters unchanged when paging. A page can be empty and still have a |
There was a problem hiding this comment.
optional (nit): A note's color also shows up in GET /v1/highlights. Add one sentence telling apps that cache highlights to refetch after they change a colored note.
There was a problem hiding this comment.
Added guidance to refetch cached highlights after creating, updating, or deleting a colored passage note.
Verification evidence
- Revision: cf1d29e, including the preceding documentation/test commit.
- Source inspection of the Core README against developer-hub PR WIP: feat!: YPE-4113 #320. This is integration guidance, not automatic cache invalidation.
- Local workspace checks:
env -u INTEGRATION_TESTS YVP_APP_KEY=test-key YVP_API_HOST=api.youversion.com pnpm testpassed 1,188 tests (366 Core, 200 Hooks, 622 UI); two opt-in live Search cases skipped. Core typecheck and tree-shaking checks passed. No live Notes retest on this revision.
Written by Coding Agent on behalf of Cam.
| passage: z.optional(z.nullable(NotePassageSchema)), | ||
| language_tag: z.optional(z.nullable(z.string())), | ||
| tags: z.optional(z.nullable(z.array(z.string()))), | ||
| status, |
There was a problem hiding this comment.
optional (nit): A strict status enum means a new API status would fail the whole getNotes page. Strict is fine since the API lists it as closed, or use a lenient response schema.
There was a problem hiding this comment.
Keeping strict private/public parsing, as Cameron agreed. Those are the only statuses in the regular API contract, and we have no evidence of another live value. We are not adding speculative skip behavior.
Verification evidence
- Revision: cf1d29e, including the preceding documentation/test commit.
- Source inspection of the OpenAPI status enum and response schema. An undocumented status still rejects the response; client parsing is not a substitute for server authorization.
- Local workspace checks:
env -u INTEGRATION_TESTS YVP_APP_KEY=test-key YVP_API_HOST=api.youversion.com pnpm testpassed 1,188 tests (366 Core, 200 Hooks, 622 UI); two opt-in live Search cases skipped. Core typecheck and tree-shaking checks passed. No live Notes retest on this revision.
Written by Coding Agent on behalf of Cam.
| next_page_token: z.optional(z.nullable(z.string())), | ||
| }); | ||
|
|
||
| export const GetNotesOptionsSchema = object({ |
There was a problem hiding this comment.
optional (nit): docs/adding-a-core-endpoint.md keeps query schemas private on the client class. Move GetNotesOptionsSchema into notes.ts and keep only the exported type.
There was a problem hiding this comment.
Moved the private query schema into notes.ts and kept GetNotesOptions available through the public type export.
Verification evidence
- Revision: cf1d29e, including the preceding documentation/test commit.
- Core typecheck and build passed; the query validators reuse the passage-field schemas.
- Local workspace checks:
env -u INTEGRATION_TESTS YVP_APP_KEY=test-key YVP_API_HOST=api.youversion.com pnpm testpassed 1,188 tests (366 Core, 200 Hooks, 622 UI); two opt-in live Search cases skipped. Core typecheck and tree-shaking checks passed. No live Notes retest on this revision.
Written by Coding Agent on behalf of Cam.
* chore: sync react localization from platform-localization (#478) chore: sync react localization Co-authored-by: camrun91 <16566029+camrun91@users.noreply.github.com> * fix(core): sanitize planted footnote content in Bible HTML (#486) * 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 (#489) * 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 (#500) * 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 (#485) * 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 (YPE-6573) (#488) * 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 (#497) * 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): preserve newer selection after native Share (YPE-6812) (#494) * fix(ui): label reader sign-in menu trigger (YPE-6810) (#492) * 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 (#490) * 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): support Bible reader interactions in iframes (YPE-6410) (#491) * 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 * fix(ui): handle reader host callback exceptions (YPE-6811) (#493) * chore(ui): align declaration build with strict checks (YPE-6464) (#503) chore(ui): align declaration build with strict checks Refs: YPE-6464 * chore: enable additional TypeScript safety checks (#505) * 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 (#506) * 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> * test(ui): wait for host isolation colors to settle Amp-Thread-ID: https://ampcode.com/threads/T-01a22d50-d764-7577-a16d-dcc6f7081eba * fix(core): address Notes and serializer review feedback Amp-Thread-ID: https://ampcode.com/threads/T-01a22d5e-80f8-71c4-80b9-80b0e2702720 * fix(ui): preserve failed verse actions and guard browser stories Keep built-in Copy and Share fallback retryable until copying succeeds, and ignore stale clipboard completions after selection changes. Restrict chapter-picker native keyboard helpers to Vitest browser runs. Amp-Thread-ID: https://ampcode.com/threads/T-01a22d5e-80f8-71c4-80b9-80b0e2702720 * fix(ui): invalidate verse actions on prompt takeover and unmount Amp-Thread-ID: https://ampcode.com/threads/T-01a22d5e-80f8-71c4-80b9-80b0e2702720 --------- Signed-off-by: Austin <abharms@gmail.com> Co-authored-by: platform-localization-pr-bot[bot] <294853593+platform-localization-pr-bot[bot]@users.noreply.github.com> Co-authored-by: camrun91 <16566029+camrun91@users.noreply.github.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Austin <abharms@gmail.com> Co-authored-by: Amp <amp@ampcode.com>
* chore: sync react localization from platform-localization (#478) chore: sync react localization Co-authored-by: camrun91 <16566029+camrun91@users.noreply.github.com> * fix(core): sanitize planted footnote content in Bible HTML (#486) * 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 (#489) * 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 (#500) * 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 (#485) * 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 (YPE-6573) (#488) * 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 (#497) * 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): preserve newer selection after native Share (YPE-6812) (#494) * fix(ui): label reader sign-in menu trigger (YPE-6810) (#492) * 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 (#490) * 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): support Bible reader interactions in iframes (YPE-6410) (#491) * 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 * fix(ui): handle reader host callback exceptions (YPE-6811) (#493) * chore(ui): align declaration build with strict checks (YPE-6464) (#503) chore(ui): align declaration build with strict checks Refs: YPE-6464 * chore: enable additional TypeScript safety checks (#505) * 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 (#506) * 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> * feat(ui): add Reader note saving Ref: YPE-6783 * fix: recover Reader Notes after interrupted authorization 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 * fix: preserve Reader Notes through authorization 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 * fix: preserve Reader sessions and highlight refresh 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 * fix: preserve Reader draft recovery and auth compatibility 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 * fix: preserve Reader auth and passage ownership 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 * fix: preserve Reader drafts and OAuth attempt ownership 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 * fix: isolate Reader authorization handoffs 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 * fix: recover Reader note edits after a lost response 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 * fix: retry Notes writes after definite rejections Allow corrected create fields and retain known blank content after a definitive HTTP rejection, while preserving recovery from earlier uncertain writes. Ref: YPE-6783 * fix: retry corrected Notes payloads after a 413 Release an unresolved create payload after a size rejection. Retain the request UUID and preserve recovery when the note ID is already known. Ref: YPE-6783 * fix(ui): preload destination highlights (YPE-6783) * docs: clarify legacy auth recovery (YPE-6783) * test(ui): await destination passage before save refresh (YPE-6783) * test(ui): await settled highlight colors (YPE-6783) * chore: sync react localization * fix(ui): announce note highlight color names * fix(ci): verify imported localization provenance * fix(ui): expose action labels and record Notes QA evidence * chore: remove pilot reports and obsolete localization support Keep QA evidence in Jira, the PR, and BrowserStack. Restore the main localization ownership policy and remove superseded sync changesets now that PR507 is merged. SDK implementation and locale catalogs are unchanged. * fix: harden Reader Notes authorization and integration * fix: refresh OAuth tree-shaking sentinel * refactor: narrow reader notes auth and test scope * test: remove redundant notes browser scenarios * refactor: reuse oauth cleanup and reader scope checks * fix(ui): align notes composer with save design * test(ui): wait for clipboard retry action visibility * fix(ui): accept normalized note save responses 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. * fix(ui): preserve verse action compatibility for notes 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. * fix(ui): recover note drafts after validation rejections * chore: sync react localization * fix(ui): name the note visibility selector accessibly * chore(demo): remove preloaded verse marker * fix(ui): toggle note visibility directly * docs(demo): update verse marker smoke instructions * fix(ui): align reader notes actions and authorization * test(ui): wait for custom action popover visibility --------- Signed-off-by: Austin <abharms@gmail.com> Co-authored-by: platform-localization-pr-bot[bot] <294853593+platform-localization-pr-bot[bot]@users.noreply.github.com> Co-authored-by: camrun91 <16566029+camrun91@users.noreply.github.com> Co-authored-by: Cameron Pak <cameronandrewpak@gmail.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: abharms <16394621+abharms@users.noreply.github.com>
Adds a typed
NotesClientso Core SDK integrators can manage a signed-in user's notes without calling REST directly. Includes Notes OAuth scopes, filtered pagination, idempotent creates, partial updates, and app version-filter checks for supplied version IDs and passages.Lists skip malformed records without losing valid notes or pagination. Malformed passages preserve the note; invalid envelopes and single-note responses still reject.
Verified: 1,190 local workspace tests passed; two opt-in live Search tests skipped. Core typecheck, focused lint/format checks, and dependency builds passed. Tests cover malformed records, exact gapped PATCH bodies, and 401/403 propagation across all five operations.
Live: Nine checks passed on a test account against production
/v1/notes: 847 existing records decoded across 10 pages; gapped create/GET/PATCH and overlap filters, same-ID retry, title clearing, and cleanup with final GET 404 passed. Profile-only list/get/update/delete returned 403; existing notes were never edited.Limits: Core and regular
/v1/notesonly, no Notes UI. Cross-account isolation, a confirmed existing Bible App gapped-note fixture, insufficient-scope create, and cross-client reads remain unverified live.Implements the Core scope of YPE-6781.


Confidence Score: 5/5
The PR appears safe to merge; no blocking issues were found.Summary
Adds
NotesClientfor signed-in users to list, fetch, create, update, and delete notes.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR Caller[App] --> Notes[NotesClient] Notes --> Checks[Check input and supplied Bible version] Checks --> HTTP[ApiClient with access token] HTTP --> API[Notes API] API --> Parse[Check response and map passage fields] Parse --> CallerReviews (7) · Last reviewed commit: "chore: refresh combined core bundle budg..." · Reviewed by Greptile