Skip to content

fix: support keyboard activation for marks - #1090

Open
nrps9909 wants to merge 1 commit into
react-component:masterfrom
nrps9909:codex/mark-keyboard-accessibility
Open

fix: support keyboard activation for marks#1090
nrps9909 wants to merge 1 commit into
react-component:masterfrom
nrps9909:codex/mark-keyboard-accessibility

Conversation

@nrps9909

@nrps9909 nrps9909 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expose clickable mark labels with button semantics
  • support Enter and Space activation while preventing Space scrolling
  • remove disabled marks from sequential focus and guard mouse and keyboard activation

Verification

  • reproduced on the exact master base with two regression tests that failed because marks had no button semantics
  • 5 test suites, 123 tests, and 5 snapshots pass
  • TypeScript, focused ESLint, Prettier, full ESM/CJS/declaration/CSS build, and diff checks pass

Overlap audit

AI assistance disclosure: Codex was used to trace the interaction path, audit open PR overlap, write the implementation and regression tests, and run validation. The behavior and results above were verified directly on this exact commit.

Summary by CodeRabbit

  • 新功能

    • 支持通过键盘 Enter 或空格键选择滑块标记。
    • 标记项现具备更完善的键盘可访问性,并正确反映禁用状态。
  • 错误修复

    • 禁用的标记项不再响应点击或键盘操作。

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

@nrps9909 is attempting to deploy a commit to the afc163's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b7eaa646-d7c5-47d8-be56-211e1809a1b6

📥 Commits

Reviewing files that changed from the base of the PR and between 02260ea and b16bf86.

📒 Files selected for processing (2)
  • src/Marks/Mark.tsx
  • tests/marks.test.js

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

标记项现在支持 Enter 和 Space 键选择。组件新增按钮语义、焦点控制和禁用状态属性。禁用标记项不会响应点击或键盘操作。测试覆盖键盘选择和禁用行为。

Changes

标记项键盘可访问性

Layer / File(s) Summary
标记项可访问性与键盘交互
src/Marks/Mark.tsx
标记项新增 role="button"tabIndexaria-disabled。启用时,Enter 或 Space 键会触发 onClick。禁用时,点击和键盘操作均不会触发回调。
键盘交互与禁用状态测试
tests/marks.test.js
测试 Enter 和 Space 键选择标记,并验证 onChangeonChangeComplete 的值。测试禁用标记项的属性和无回调行为。

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to b16bf

This localized change adds keyboard activation and focus behavior for mark labels, with regression tests and build checks reported as passing; no actionable merge-blocking risk remains.

Poem

小兔按下 Enter,标记亮晶晶
Space 轻轻落下,值已被选定
禁用标记安静站立
焦点路径清晰可见
回调依次跳起舞
代码里长出一根胡萝卜

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了主要变更:为 slider marks 支持键盘激活。标题简洁、明确,并与代码和测试变更一致。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.68%. Comparing base (02260ea) to head (b16bf86).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1090      +/-   ##
==========================================
+ Coverage   98.66%   98.68%   +0.01%     
==========================================
  Files          15       15              
  Lines         751      758       +7     
  Branches      224      238      +14     
==========================================
+ Hits          741      748       +7     
  Misses         10       10              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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