Repository navigation
fix(ui): preserve focus at high zoom - #485
Conversation
🦋 Changeset detectedLatest commit: 7e4f97f 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 |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
a6cb659 to
61d39c4
Compare
61d39c4 to
7a40486
Compare
camrun91
left a comment
There was a problem hiding this comment.
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-0inversion-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.tsgives 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?
camrun91
left a comment
There was a problem hiding this comment.
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:
- The chapter focus reveal is still proven only with
focus({ preventScroll: true }). - Some new built-in scroll code has no test that fails without it.
- The chapter trigger ring and padding fixes have no test.
- One unit test name does not match what it checks.
- 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.
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.
camrun91
left a comment
There was a problem hiding this comment.
Approving. Nothing needs changes before approval.
optional (nit)
packages/ui/src/lib/scroll-reveal.ts:4: only the unit test uses thealign: '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: thecalc(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:revealFocusedVersionscrolls 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.
* 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>
Summary
Fixes the high-zoom and cross-browser focus failures tracked by YPE-6465 without unrelated layout changes.
scrollIntoViewis unavailableYPE-6672 (Safari sign-in heading clipping) could not be reproduced, so this PR intentionally does not change that layout.
Verification
pnpm exec turbo build --forcepnpm typecheckpnpm lintpnpm test: 1,197 passed, 2 skipped (UI: 57 files, 643 tests)7e4f97f: Chromium integration tests plus the complete Linux Firefox and WebKit Shadow DOM runners, including isolated recovery groups.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.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.
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