[Good first issue] 用方向键操作发现页的「更多」菜单,Esc 后回到原卡片

Open Beginner friendly
#231 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bun, react, typescript

Research direction

Start with packages/ui/src/components/discover/CandidateCard.tsx around the linked menu, then read the existing menu tests in packages/ui/src/components/discover/DiscoverView.test.tsx. Run bun test packages/ui/src/components/discover/DiscoverView.test.tsx and use its test candidates to check focus movement, Escape behavior, and that mouse and keyboard activation still affect the current candidate.

Written by the indexing model from the issue text.

Description

accessibility area:desktop good first issue

在发现页,用键盘聚焦某个候选标的的「更多」按钮并激活。菜单展开后焦点仍在按钮上,按 ↓ 也没有移到菜单项。在离线组件中手动聚焦第一项再按 Esc,菜单会关闭,但焦点落回页面的 body,用户要重新寻找刚才的候选。候选卡菜单

用键盘走通这条路径即可验收

  1. 聚焦一张卡片的「更多」,用 Enter 或空格打开,焦点进入第一项。
  2. 用 ↑、↓ 在「对比」「自选」之间移动。按 Esc 关闭,焦点回到同一张卡片的「更多」,也没有执行任何操作。
  3. 鼠标点击以及键盘激活菜单项时仍对当前标的生效。可在现有发现页测试中断言 document.activeElement,使用测试候选即可。已有菜单测试

可运行 bun test packages/ui/src/components/discover/DiscoverView.test.tsx。欢迎对 React 或键盘无障碍感兴趣的朋友评论 /claim 认领。

Dominant language
TypeScript
Stars
206
Forks
37
Avg merge
1d 1h
Merged PRs (30d)
26

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ydflow/Trail

All issues in ydflow/Trail

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.