feat: support force rendering expanded rows - #1503
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Someone 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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Walkthrough新增 Changes展开行强制渲染
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Table
participant TableContext
participant RowInfo
participant BodyRow
participant BodyLine
participant ExpandedRow
Table->>TableContext: 写入 expandable.forceRender
TableContext->>RowInfo: 选择 forceRender
RowInfo->>BodyRow: 提供展开配置
RowInfo->>BodyLine: 提供展开配置
BodyRow->>ExpandedRow: forceRender 时预先渲染
BodyLine->>ExpandedRow: forceRender 时创建并隐藏
BodyLine->>ExpandedRow: 展开后移除隐藏样式
Suggested reviewers: Poem Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/ExpandRow.spec.jsx (1)
62-65: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win补充重新折叠后的隐藏断言。
当前仅验证首次展开;若
forceRender路径在折叠后未恢复display: none,测试不会捕获回归。
tests/ExpandRow.spec.jsx#L62-L65:再次点击第一行展开图标,并断言第一条展开行恢复隐藏。tests/Virtual.spec.tsx#L201-L205:再次点击展开图标,并断言虚拟展开行恢复隐藏。依据 PR 目标,强制渲染的内容应在未展开时保持隐藏。
🤖 Prompt for 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. In `@tests/ExpandRow.spec.jsx` around lines 62 - 65, Extend the expansion assertions in tests/ExpandRow.spec.jsx lines 62-65 by clicking the first row’s expand icon again and asserting its expanded row is hidden; apply the same additional collapse interaction and hidden-state assertion in tests/Virtual.spec.tsx lines 201-205. Ensure both force-render paths verify content remains hidden after collapsing.
🤖 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.
Nitpick comments:
In `@tests/ExpandRow.spec.jsx`:
- Around line 62-65: Extend the expansion assertions in tests/ExpandRow.spec.jsx
lines 62-65 by clicking the first row’s expand icon again and asserting its
expanded row is hidden; apply the same additional collapse interaction and
hidden-state assertion in tests/Virtual.spec.tsx lines 201-205. Ensure both
force-render paths verify content remains hidden after collapsing.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b021e53e-c774-4b76-af09-561b172fd7ff
📒 Files selected for processing (10)
README.mdREADME.zh-CN.mdsrc/Body/BodyRow.tsxsrc/Table.tsxsrc/VirtualTable/BodyLine.tsxsrc/context/TableContext.tsxsrc/hooks/useRowInfo.tsxsrc/interface.tstests/ExpandRow.spec.jsxtests/Virtual.spec.tsx
Related workThis PR overlaps with #1386. Thanks to @rubbishmaker for the earlier implementation. Compared with #1386, this PR:
I'm happy to rework or close this PR if maintainers prefer continuing from #1386. |
Summary
expandable.forceRenderRelated issue
Related to ant-design/ant-design#54798
Summary by CodeRabbit
expandable.forceRender配置项(默认值false)。expandable配置说明,补充forceRender的类型、默认值及用途。