Skip to content

fix(ui): improve BackTop accessibility and click handling#87

Merged
wyf027 merged 4 commits into
mainfrom
codex/backtop-a11y-click-2026-07-08
Jul 7, 2026
Merged

fix(ui): improve BackTop accessibility and click handling#87
wyf027 merged 4 commits into
mainfrom
codex/backtop-a11y-click-2026-07-08

Conversation

@wyf027

@wyf027 wyf027 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a default aria-label for BackTop so the arrow glyph is not the accessible name
  • preserve caller onClick handlers while keeping the built-in scroll-to-top behavior
  • allow callers to prevent the built-in scroll with event.preventDefault()
  • add BackTop tests and align docs with the actual visibilityHeight default

Validation

  • GitHub Actions CI / quality passed for head aa9aac43b482a6d0621ffe807ee1710e1e23f624 in run 28882494903.
  • Passed steps: npm run lint:ui, npm run typecheck:ui, npm run test:ui, npm run build:ui, npm run build:docs.
  • Test run included new src/components/navigation/BackTop/BackTop.test.tsx coverage for visibility threshold, accessible labelling, click preservation, and preventDefault().
  • Not run locally: the Codex shell executor is currently failing with Failed to create unified exec process: No such file or directory.

Notes

  • codebase-memory-mcp graph tools were not exposed in this session, so this run used repository files through GitHub as the AGENTS.md fallback.
  • This branch starts from current main at 41f28b8caf69b827972396c0a7450ff195373070 and avoids the still-open FloatButton PR fix(ui): label float button from tooltip #86.

@ecc-tools

ecc-tools Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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,
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Wrap the scroll event in act

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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-tools

ecc-tools Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@wyf027
wyf027 merged commit 0500d70 into main Jul 7, 2026
1 check passed
@wyf027
wyf027 deleted the codex/backtop-a11y-click-2026-07-08 branch July 7, 2026 19:13
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.

1 participant