fix(ui): improve BackTop accessibility and click handling#87
Conversation
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ded05bc9d
ℹ️ 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".
| Object.defineProperty(window, 'scrollY', { | ||
| configurable: true, | ||
| value, | ||
| }) |
There was a problem hiding this comment.
In this jsdom test environment, dispatching the native scroll event here is outside React Testing Library's act, so the setVisible update from BackTop's window listener is not flushed before the immediate role queries. I verified npm run test:ui -- BackTop: the body remains <div /> and all four new tests fail; wrap this dispatch/call sites in act(...) or wait for the button before asserting.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in aa9aac43: setScrollY now wraps the scroll dispatch in Testing Library act(...). The follow-up CI / quality run 28882494903 passed, including Test UI.
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
Summary
aria-labelfor BackTop so the arrow glyph is not the accessible nameonClickhandlers while keeping the built-in scroll-to-top behaviorevent.preventDefault()visibilityHeightdefaultValidation
CI / qualitypassed for headaa9aac43b482a6d0621ffe807ee1710e1e23f624in run28882494903.npm run lint:ui,npm run typecheck:ui,npm run test:ui,npm run build:ui,npm run build:docs.src/components/navigation/BackTop/BackTop.test.tsxcoverage for visibility threshold, accessible labelling, click preservation, andpreventDefault().Failed to create unified exec process: No such file or directory.Notes
codebase-memory-mcpgraph tools were not exposed in this session, so this run used repository files through GitHub as the AGENTS.md fallback.mainat41f28b8caf69b827972396c0a7450ff195373070and avoids the still-open FloatButton PR fix(ui): label float button from tooltip #86.