Skip to content

feat: show saved notes in the Bible Reader - #511

Open
abharms wants to merge 87 commits into
mainfrom
codex/YPE-6784-reader-note-indicators
Open

abharms wants to merge 87 commits into
mainfrom
codex/YPE-6784-reader-note-indicators

Conversation

@abharms

@abharms abharms commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Show saved Notes on Reader verses and open every overlapping Note from its indicator.
Cards show passage, text, visibility, localized relative age, and optional color.
Standalone BibleTextView callers can handle indicator taps.

Implements YPE-6784. Prerequisites
#497,
#506, and
#508 have merged.

Designs: Desktop composer
and Saved Notes.

Behavior

  • Load every Notes page for the chapter and Bible version. Handle ranges, gaps,
    multiple overlapping Notes, account changes, access loss, and superseded reads.
    Preserve settled data on transient refresh failures and clear private Notes when access is lost.
  • Show rounded indicator backgrounds behind verse numbers and open all overlapping Notes.
    Match native styling: gray at 25% opacity over highlights and blue at 55% opacity otherwise.
    Custom indicators retain precedence and keyboard focus when their representation changes.
  • Keep the requested web composer behavior: existing swatches checked once per color,
    count badge, persistent history during editing, three-line editor cap, modal scrolling,
    six-line saved previews with More, and Cancel/Save with Save disabled until a change.
  • Preserve existing highlight colors when no replacement is chosen. Send explicit
    color: null for a clear choice and preserve that choice across interrupted-save recovery.
  • Publish successful creates directly into matching chapter snapshots so the badge
    and reopened history update immediately, without a post-create Notes request.
    The initial paged read finishes all pages across successive saves and merges those confirmed Notes once.
    Subsequent complete reads are authoritative, including removals. There is no separate
    retained-create list, polling, or new timer.
  • Refresh the currently displayed chapter's highlights after successful creates,
    updates, or deletes. Updates/deletes also refresh Notes. Mark inactive matching
    scopes stale. Keep current highlight paint during refresh and on failed or identical responses.
  • Use the API client's resolved installation identity for access-denial cleanup.
    Consolidate this unreleased feature into one changeset; remove unused swatch inputs,
    the separate Reader renderer wrapper, and duplicate test steps.

Verification

  • Core: 425 tests passed (3 opt-in tests skipped); Hooks: 229 passed;
    UI: 686 passed; sample-app routing: 4 passed.
  • The full workspace test run passes on the updated branch (all 7 Turbo tasks).
  • All 32 Notes and renderer browser journeys pass in Chromium. Indicator geometry
    also passes in WebKit for one- and two-digit verse numbers in both Scripture
    directions, preserving the 24px hit target.
  • The sample-app Notes smoke passes, including the newly saved indicator and
    reopened history with an unchanged mocked Notes list.
  • Regressions cover two successive saves while the initial paged read is pending,
    completion and failure of that read,
    authoritative later removals, and mutation refresh after chapter/Bible-version changes.
  • Production build, UI typecheck, lint, formatting, and diff checks pass.
  • The updated native indicator colors pass the saved-Notes browser journey in Chromium and WebKit.

Browser journeys use mocked API responses and do not establish current live-service behavior.

Remaining live checks

  • Keep this PR draft pending a current-head live Save check. Earlier live checks
    established text-filled saves and persistence; a passage-only save last returned
    HTTP 400 and still needs API deployment/retesting. No placeholder text workaround was added.
  • Explicit clear serialization is covered in the browser. Live inherited-highlight
    removal still needs verification; the linked GitLab contract currently requires a fresh organization sign-in.
  • More uses shared showMore from
    platform-localization #119
    synced by localization sync #521, now included from main.
    No locale bundle was hand-edited.

Saved-note edit/delete controls and Tags UI remain deferred to
YPE-6785.

Confidence Score: 5/5RetriggerView in Greptile

The reviewed changes appear safe to merge; the previous verse-number contrast issue is fixed.

Summary

Adds saved Notes indicators, overlapping-note history, and account-scoped chapter reads. Successful creates update matching cached chapters, while mutations refresh highlights.

  • Chapter Notes finish loading and stay in step with saved Note changes.
  • Saved Notes mark Bible verses and open from their verse numbers.
  • Saved Notes appear as cards in the composer or a reader drawer.
  • Highlight swatches stay in palette order with one button per color.

Reviews (15) · Last reviewed commit: "fix(ui): preserve note number contrast o..." · Reviewed by Greptile

platform-localization-pr-bot Bot and others added 30 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>
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
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
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
Allow corrected create fields and retain known blank content after a definitive HTTP rejection, while preserving recovery from earlier uncertain writes.

Ref: YPE-6783
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
Limit the Reader note input to three text lines plus its padding and scroll
longer drafts inside the input. Preserve content-based sizing where supported
and resize on text changes in other browsers, without timers or subscriptions.

Extend the existing composer preview into a browser regression for growth,
overflow, caret scrolling, persistent history, and shrinking after clearing.
Verify all Notes journeys in Chromium and Firefox, focused WebKit journeys,
UI typecheck, lint, formatting, and the package build.
@abharms

abharms commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

@greptileai review

@abharms

abharms commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: c9ca36f2ce

ℹ️ 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".

@abharms
abharms marked this pull request as ready for review December 3, 2026 22:42
@abharms
abharms requested review from bmanquen and camrun91 December 3, 2026 22:43
@abharms
abharms marked this pull request as draft December 3, 2026 22:54
camrun91
camrun91 previously approved these changes Dec 3, 2026
@abharms
abharms marked this pull request as ready for review December 4, 2026 19:59
@abharms
abharms marked this pull request as draft December 4, 2026 20:35
@abharms
abharms marked this pull request as ready for review December 4, 2026 22:52
Comment thread packages/ui/src/components/verse.tsx Resolved

This branch has not been deployed

No deployments
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.

3 participants