feat: support expand all control in expandable column header - #1505
feat: support expand all control in expandable column header#1505nikzanda wants to merge 3 commits into
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
@nikzanda is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
Walkthrough新增展开全部行功能。该功能支持默认或自定义图标、批量展开与收起、可展开行过滤、受控状态同步,以及自定义展开列表头。README 文档同步更新。 Changes展开全部行支持
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Table
participant useExpand
participant useColumns
participant renderExpandAllIcon
Table->>useExpand: 获取展开全部状态和处理器
useExpand-->>Table: 返回 expandAllInfo
Table->>useColumns: 传递 expandAllIcon 和 expandAllInfo
useColumns->>renderExpandAllIcon: 渲染展开全部图标
renderExpandAllIcon->>useExpand: 触发展开或收起全部行
useExpand-->>Table: 更新 expandedRowKeys
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
22bede1 to
ef33496
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1505 +/- ##
==========================================
+ Coverage 99.05% 99.07% +0.02%
==========================================
Files 45 45
Lines 1374 1413 +39
Branches 413 425 +12
==========================================
+ Hits 1361 1400 +39
Misses 13 13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/utils/expandUtil.tsx`:
- Around line 57-64: Update the expand-all control in the rendered component
from a span to a native button with type="button", preserving its className and
onClick behavior. Add an aria-label that reflects the current expanded state and
bind aria-expanded to expanded. Extend the interaction tests to verify Tab focus
and activation via Enter and Space.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3313343f-3c8c-4313-babe-050aa6c7b4e7
📒 Files selected for processing (8)
README.mdREADME.zh-CN.mdsrc/Table.tsxsrc/hooks/useColumns/index.tsxsrc/hooks/useExpand.tssrc/interface.tssrc/utils/expandUtil.tsxtests/ExpandRow.spec.jsx
|
@afc163 @zombieJ, the implementation is now complete and this PR is ready for review. It includes the expand-all API, controlled and uncontrolled behavior, When you have time, could you please review the proposed API and implementation? I’m happy to make any adjustments needed before proceeding with the Ant Design integration for ant-design/ant-design#8791. Thanks! |
Summary
Add an opt-in expand/collapse-all control to the expandable column header.
This is intended to support the use case described in ant-design/ant-design#8791.
The implementation is ready for maintainer review. The corresponding Ant Design integration will follow once the API is accepted and released.
API
expandable.showExpandAllto enable the header control.expandable.expandAllIconto customize its rendering.expandable.onExpandAllto observe expand/collapse-all actions.expandable.columnTitleto be a render function receiving the generated expand-all control.Behavior
rowExpandableare affected.expandedRowKeysare supported.expandedRowRendertables.Testing
Added regression coverage for:
rowExpandablefilteringexpandedRowKeysexpandAllIconcolumnTitleValidation:
yarn test tests/ExpandRow.spec.jsxyarn tscyarn lintSummary by CodeRabbit