Skip to content

fix(ui): preserve focus at high zoom - #485

Merged
abharms merged 23 commits into
feat/after-thanksgiving-mergefrom
codex/YPE-6465-zoom-fixes
Nov 24, 2026
Merged

abharms merged 23 commits into
feat/after-thanksgiving-mergefrom
codex/YPE-6465-zoom-fixes

Conversation

@abharms

@abharms abharms commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes the high-zoom and cross-browser focus failures tracked by YPE-6465 without unrelated layout changes.

  • reveals focused chapter and version rows within their list scroll regions, including Linux Firefox
  • preserves smooth chapter expansion while honoring reduced-motion preferences
  • avoids retriggering consumer/page scroll when a host callback changes identity and preserves compatibility when scrollIntoView is unavailable
  • keeps version-list scroll ownership ref-based and removes scroll containers from sequential keyboard navigation
  • keeps reader-settings, Toolbar Close, and sign-in focus rings keyboard-only and inset so constrained panels do not clip them
  • verifies picker viewport containment and page-level horizontal overflow in narrow layouts

YPE-6672 (Safari sign-in heading clipping) could not be reproduced, so this PR intentionally does not change that layout.

Verification

  • pnpm exec turbo build --force
  • pnpm typecheck
  • pnpm lint
  • pnpm test: 1,197 passed, 2 skipped (UI: 57 files, 643 tests)
  • Full Storybook CI workflow passed on 7e4f97f: Chromium integration tests plus the complete Linux Firefox and WebKit Shadow DOM runners, including isolated recovery groups.
  • Six temporary mutations were detected by the strengthened checks: chapter ring color, trigger padding, chapter/version panel overflow, pending-reveal cleanup, and oversized-row alignment.

Linux Firefox leaves a focused book row partly clipped without the bounded accordion reveal. The settings story re-queries the current dialog while waiting for visibility, avoiding an early portal-node snapshot.

The browser journeys verify constrained layouts and native keyboard traversal. They do not set browser zoom to 200%; WebKit is proxy coverage for Safari, so exact Safari 200% behavior remains a manual verification item.

Review scope

Required: chapter-picker reveal behavior, version-picker focus/scroll ownership and viewport fit, reader-settings focus, sign-in action focus, and the consumer compatibility guards added for those paths.

Permitted: focused tests and the UI patch changeset.

Non-goals: documentation expansion, API changes, broad picker redesign, enums for the local alignment union, or speculative Safari sign-in layout work.

Jira: https://lifechurch.atlassian.net/browse/YPE-6465

Confidence Score: 5/5 · The changes appear safe to merge.RetriggerView in GreptileConfidence Score: 5/5

The changes appear safe to merge.

Summary

Improves keyboard focus and scrolling in constrained picker, reader-settings, and sign-in panels. The latest update makes the settings browser test check the current dialog while waiting for it to appear.

  • The chapter picker keeps focused books visible and avoids unwanted reveals.
  • The version picker keeps focused rows visible without moving its header.
  • Reader settings and sign-in actions keep keyboard focus rings inside their panels.

No new actionable issues were found in the changes since the previous review.

Reviews (24) · Last reviewed commit: "test(ui): query the current settings dia..." · Reviewed by Greptile

@changeset-bot

changeset-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7e4f97f

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 Patch
vite-react Patch
@youversion/platform-core Patch
@youversion/platform-react-hooks 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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 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-11-24T19:08:49.098038Z 7e4f97f 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.

@abharms
abharms force-pushed the codex/YPE-6465-zoom-fixes branch from a6cb659 to 61d39c4 Compare November 18, 2026 03:12
@abharms
abharms force-pushed the codex/YPE-6465-zoom-fixes branch from 61d39c4 to 7a40486 Compare November 18, 2026 03:17
@abharms
abharms marked this pull request as draft November 18, 2026 03:24
@abharms
abharms marked this pull request as ready for review November 18, 2026 15:29
@abharms abharms self-assigned this Nov 18, 2026
@abharms
abharms requested a review from camrun91 November 18, 2026 20:23

@camrun91 camrun91 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.

Thanks for this! Focus at high zoom is a real problem, and most of the fix works well. CI is green and the Storybook journeys pass. I have 6 changes that are needed before approval. They are inline. There are also some optional nits:

  • Nit: The three focus guards in bible-chapter-picker.tsx (lines 191, 206, 274) only fail tests as a group. Please add a test for each guard.
  • Nit: No test covers the outer-container reveal or the root min-h-0 in version-list.tsx (lines 231, 240).
  • Nit: The new story checks only look for "inset" in boxShadow, and they read it before the transition ends. Please wait for the transition and check the ring width and color.
  • Nit: The tests use fixed 250 ms sleeps that depend on the private 200 ms delay. Please use fake timers or a named, shared constant.
  • Nit: scroll-reveal.ts gives wrong values if a container has a border or a horizontal scrollbar, and it has no unit test.
  • Nit: The chapter accordion has no minimum height, but the version list has one. At very high zoom, can it shrink so that the expand reveal does nothing?

@abharms
abharms requested a review from camrun91 November 19, 2026 16:36

@camrun91 camrun91 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.

Thank you for the updates. Most items from the last review are now fixed: reduced motion, the ring contrast on the font buttons, Close, Decline, and Confirm, tests that passed on base, the scroll-reveal math with its unit test, the version-list padding, and fake timers instead of sleeps. The version scroll-region reveal is now proven with a real Tab in Firefox, which confirms your Firefox note. CI, lint, typecheck, unit tests, and Storybook in Chromium and Firefox pass.

Some changes are still necessary before approval. They are inline. In summary:

  1. The chapter focus reveal is still proven only with focus({ preventScroll: true }).
  2. Some new built-in scroll code has no test that fails without it.
  3. The chapter trigger ring and padding fixes have no test.
  4. One unit test name does not match what it checks.
  5. A theme-settings assertion now skips in WebKit.

For item 2, the panel.scrollTop > 0 check in bible-version-picker.shadow-isolation.stories.tsx (near line 414) cannot tell overflow-y: auto from the old hidden, so it does not prove the popover change.

The nits are inline too.

Comment thread .changeset/calm-focus-at-zoom.md Resolved
@cameronapak
cameronapak changed the base branch from main to feat/after-thanksgiving-merge November 24, 2026 16:23
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.
@abharms
abharms requested a review from camrun91 November 24, 2026 19:13

@camrun91 camrun91 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.

Approving. Nothing needs changes before approval.

optional (nit)

  • packages/ui/src/lib/scroll-reveal.ts:4: only the unit test uses the align: 'start' option. Both real callers use 'nearest', so you can drop it or keep it.
  • packages/ui/src/components/bible-version-picker/version-list.tsx:164: the calc(2.8125rem+34.5px) min row size is hand-computed from font sizes, so it can drift if typography changes.
  • packages/ui/src/components/bible-version-picker/version-list.tsx:231: revealFocusedVersion scrolls only the inner list. At high zoom the popover can scroll too, but Firefox and WebKit CI pass, so this is only worth a look during the manual Safari check.

@abharms
abharms merged commit 38b654e into feat/after-thanksgiving-merge Nov 24, 2026
35 checks passed
@abharms
abharms deleted the codex/YPE-6465-zoom-fixes branch November 24, 2026 19:36
cameronapak added a commit that referenced this pull request Nov 30, 2026
* 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>
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