Repository navigation
fix: close submenus on root Escape - #893
Conversation
|
@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. |
|
Caution Review failedThe pull request is closed. No actionable comments were generated in the recent review. Walkthrough新增无障碍关闭回调。非 Changes无障碍关闭流程
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Possibly related PRs
Merge Risk:
|
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
-
Check name Status Explanation Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled. Title check ✅ Passed 标题“fix: close submenus on root Escape”准确概括了根菜单按下 Escape 时关闭子菜单的主要变更。 Linked Issues check ✅ Passed PR 实现了问题 #43267的核心要求:当根菜单获得焦点并触发 Escape 时,通过 triggerAccessibilityClose 清空打开状态,从而关闭弹出子菜单。测试覆盖了鼠标打开子菜单后在根菜单触发 Escape 的场景。Out of Scope Changes check ✅ Passed 变更仅涉及 Menu.tsx、useAccessibility.ts 和对应测试。新增关闭回调、处理根菜单 Escape,以及验证子菜单关闭,均直接服务于问题 #43267。未发现无关代码变更。
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Tip
🎯 Customize your risk assessments
-
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
-
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
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.
小兔按下 Escape 键
打开的子菜单随之关闭
空数组更新菜单状态
原始键盘事件继续传递
根菜单恢复清晰状态
CodeRabbit Verify
- Run CodeRabbit Verify to test the changes in this pull request.
ℹ️ Recent review info
-
⚙️ Run configuration
-
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2ad9b3cb-6d36-4f5a-8c5c-a1e27c4d66be
📒 Files selected for processing (3)
-
src/Menu.tsx
src/hooks/useAccessibility.ts
tests/SubMenu.spec.tsx
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.
ℹ️ Recent review info
-
⚙️ Run configuration
-
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
2ad9b3cb-6d36-4f5a-8c5c-a1e27c4d66be
📒 Files selected for processing (3)
-
src/Menu.tsxsrc/hooks/useAccessibility.tstests/SubMenu.spec.tsx
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
|
Rebase please |
|
/rebase |
3baedee to
41236b0
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #893 +/- ##
=======================================
Coverage 99.72% 99.73%
=======================================
Files 26 26
Lines 738 745 +7
Branches 205 207 +2
=======================================
+ Hits 736 743 +7
Misses 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Rebased onto current master The root-Escape regression fails with the current-master runtime (one failure / 23 skipped) and passes after the rebase. Full current-head validation passes 13 suites / 147 tests / 20 snapshots, TypeScript, lint (0 errors / 11 existing warnings), ESM/CJS/declaration/Less compilation, and changed-file formatting. Dependencies were resolved from the declared ranges on Node 24.15.0 with legacy-peer-deps and lifecycle scripts disabled, without manifest/lockfile changes. Pushed with an expected-old-head lease, verified the remote SHA/signature and all three changed source blobs, and updated the verification section. No new Ant Design/native-browser integration run in this rebase. AI-assisted rebase and validation; source and outputs checked. |
Summary
Fixes ant-design/ant-design#43267
Verification
npm test -- --runInBand— 147 tests and 20 snapshots passed on rebased head41236b0556f84c069d92e3a99c28d7aa39e0e0ce(baseff8a0c4333fd856b522e6ac982ec5053307b8366)npm run tscnpm run compileand changed-file Prettier checknpm run lint— 0 errors (11 existing warnings)AI assistance disclosure: Codex was used to trace the Ant Design/rc-menu event path, build the regression test, implement the fix, and run verification. The reported behavior and test results were verified locally.
Summary by CodeRabbit
Bug 修复
Esc时,现可关闭所有已展开的子菜单。测试
Esc关闭子菜单的行为验证。