-
-
Notifications
You must be signed in to change notification settings - Fork 54k
fix: Table issues by upgrade rc-table to 7.52.5
#54824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
👁 Visual Regression Report for PR #54824 Failed ❌
Warning There are more diffs not shown in the table. Please check the Full Report for details. Important There are 32 diffs found in this PR: 🔄
|
📝 WalkthroughSummary by CodeRabbit
Walkthrough将 Changes
Sequence Diagram(s)sequenceDiagram
participant Test as 测试调用者
participant imageDemoTest as imageDemoTest
participant FS as 文件系统(glob/read)
Note over imageDemoTest: 两种文件发现路径
alt options.only 存在
Test->>imageDemoTest: 调用并传入 options.only
imageDemoTest->>imageDemoTest: map 名称为显式路径 ./components/${component}/demo/${file}.tsx
imageDemoTest->>FS: 读取并验证显式文件列表
FS-->>imageDemoTest: 返回文件内容/存在状态
else options.only 不存在
Test->>imageDemoTest: 调用无 only
imageDemoTest->>FS: glob ./components/${component}/demo/**/*.tsx
FS-->>imageDemoTest: 返回所有 demo 文件
imageDemoTest->>imageDemoTest: 过滤出非 `_semantic` 的文件
end
imageDemoTest-->>Test: 返回待运行的 demo 文件列表并执行截图测试
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
✨ Finishing Touches
🧪 Generate 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @Wxh16144, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request primarily focuses on enhancing the stability and correctness of the Table component by upgrading its underlying rc-table dependency. This update brings several crucial bug fixes that improve table behavior, particularly concerning virtual scrolling, column fixed positioning, and the display of expandable columns.
Highlights
- Dependency Update: The
rc-tabledependency has been updated from version7.51.1to7.52.1. - Virtual Scroll Fix: Addresses an issue where
scroll.scrollToFirstRowOnChangedid not function correctly with virtual scrolling in the Table component. - Column Fixed Positioning: Resolves a bug preventing columns with
childrenfrom being correctly fixed to the right (fixed: 'right'). - Expandable Column Display: Fixes a problem where the expand column was not displayed when
expandable.fixedwas configured.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request updates the rc-table dependency from version ~7.51.1 to ~7.52.1. This is a minor version bump that incorporates several bug fixes for the Table component, as detailed in the pull request description. The change is confined to package.json and appears to be correct and beneficial. No issues were found with this change.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
size-limit report 📦
|
More templates
commit: |
Bundle ReportChanges will increase total bundle size by 784 bytes (0.02%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: antd.min-array-pushAssets Changed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
package.json (1)
151-151: 补充变更记录对齐若本次会进入下一个发版,请在中英文 changelog 的 Bugs 修复小节备注“Table: 升级 rc-table 至 v7.52.1,修复虚拟滚动翻页回到首行、含 children 的右侧固定列、expandable.fixed 展开列可见性问题”,并在 PR 描述中关联关闭
#54734、#51812。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
package.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (16)
- GitHub Check: test lib/es module (es, 1/2)
- GitHub Check: test lib/es module (es, 2/2)
- GitHub Check: test-react-latest (dom, 1/2)
- GitHub Check: build
- GitHub Check: test-react-legacy (17, 1/2)
- GitHub Check: test-react-latest (dom, 2/2)
- GitHub Check: test-react-legacy (16, 2/2)
- GitHub Check: test-react-legacy (17, 2/2)
- GitHub Check: lint
- GitHub Check: test-react-legacy (16, 1/2)
- GitHub Check: build preview
- GitHub Check: visual-diff snapshot (2/2)
- GitHub Check: visual-diff snapshot (1/2)
- GitHub Check: build
- GitHub Check: size
- GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
package.json (2)
151-151: 依赖升级与 PR 目标一致,LGTM只变更 rc-table 至
~7.52.1,与仓内其他 rc-* 版本的波浪号策略一致,未见破坏性改动入口。
151-151: 运行验证脚本以确认关键回归点、依赖去重与体积阈值
请在安装依赖后于本地或 CI 环境执行以下命令:#!/bin/bash set -euo pipefail echo "Resolved versions:" node -p "require('./node_modules/rc-table/package.json').version" node -p "require('./node_modules/rc-virtual-list/package.json').version" echo "Check duplicate installs:" npm ls rc-table || true npm ls rc-virtual-list || true echo "Deps lint:" npm run lint:deps echo "Bundle size:" npm run size-limit echo "Site tests (smoke regressions around Table):" npm run test:site echo "Optional visual regression (if CI allows):" npm run test:visual-regression || true echo "Peer matrix quick check:" npm run install-react-17 && npm run test:node npm run install-react-16 && npm run test:node || true
|
还有这一系列问题 #54741 (comment) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #54824 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 775 775
Lines 14087 14087
Branches 3742 3742
=========================================
Hits 14087 14087 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Signed-off-by: afc163 <[email protected]>
7.52.17.52.3
7.52.47.52.4
7.52.47.52.4
|
react-component/table#1332 😂 未能解决问题。 |
|
先看看本地能复现吗?实在复现不了,改快照生成逻辑 |
|
这个快照功能,有本地 debug 模式吗,起个无头浏览器,看下是不是显示就有问题 |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
没有鬼,肯定有差异存在! |
|
不止是看到结果(截图),看看能调试吗?看启动的浏览器,查样式 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/shared/imageTest.tsx (1)
282-284: 为 Options 新增 only:补充 JSDoc,明确用法并避免歧义建议把行内注释改为 JSDoc,明确既支持 "basic" 也支持 "basic.tsx";同时标注用途(仅跑指定 demo)。
- // 方便调试单个 demo 用 - only?: string[]; + /** 仅运行指定 demo(便于本地/CI 精确调试)。 + * 用法示例: + * - only: ["basic"] // 不带后缀 + * - only: ["basic.tsx"] // 带 .tsx 后缀亦可 + */ + only?: string[];
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
components/table/__tests__/__snapshots__/demo.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (2)
package.json(1 hunks)tests/shared/imageTest.tsx(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- package.json
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/naming.mdc)
).
**/*.{tsx,jsx}: Initialize prop names with 'default' + 'PropName' (e.g., 'defaultValue').
Use 'forceRender' for force rendering, and 'force' + 'SubComponentName' + 'Render' for sub component force rendering.
Name sub component render props as 'SubComponentName' + 'Render' (e.g., 'panelRender').
Name sub item render props as 'SubItemName' + 'Render' (e.g., 'cellRender').
Use 'dataSource' as the prop name for data sources.
Use 'open' for panel open state (popup & dropdown), and 'popupName' + 'Open' for additional popups (e.g., 'tooltipOpen'). Do not use 'visible'.
Use 'children' prop mainly for display content or option lists. For customizable wrapped components, consider using a 'component' prop if 'children' may have other usage in the future.
Use 'show' + 'PropName' for display-related prop names.
Use 'PropName' + 'able' for functional props.
Use 'disabled' for disabling components, and 'disabled' + 'SubComponentName' for disabling sub components.
Use 'extra' for extra props, and 'SubComponentName' + 'Extra' for sub component extra props (e.g., 'titleExtra').
Use 'icon' for main icon props. For multiple icons, use 'FunctionName' + 'Icon'. For function-specific icons, use 'functionName: { icon }'.
Use 'trigger' for trigger props, 'SubFunction' + 'Trigger' for sub function triggers, and 'xxxOnEventName' for time-point triggers (e.g., 'destroyOnHidden').
When a component uses another component's config, name the prop as the component (e.g.,
Use 'className' for the main class prop, and 'classes' for additional classes (e.g., <Button classes={{ inner: 'custom-inner' }} />).
Use 'preserveInvalidOnBlur' for the prop that prevents value modification on blur.
Event handler props should be named 'on' + 'EventName' (e.g., 'onClick').
Sub component event handler props should be named 'on' + 'SubComponentName' + 'EventName' (e.g., 'onSearchChange').
Prop event handler props should be named 'on' + 'PropName' + 'EventName' (e.g., 'onDragStart').
U...Files:
tests/shared/imageTest.tsx**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/project.mdc)
**/*.{ts,tsx}: 使用 TypeScript 和 React 书写
使用提前返回(early returns)提高代码可读性
属性名使用小驼峰(camelCase)
**/*.{ts,tsx}: 所有组件和函数必须提供准确的类型定义
避免使用any类型,尽可能精确地定义类型
使用接口而非类型别名定义对象结构
导出所有公共接口类型,方便用户使用
组件 props 应使用 interface 定义,便于扩展
组件 props 接口命名应为ComponentNameProps
为组件状态定义专门的接口,如ComponentNameState
复杂的数据结构应拆分为多个接口定义
组件的 ref 类型应该明确定义,使用React.ForwardRefRenderFunction
所有回调函数类型应明确定义参数和返回值
适当使用泛型增强类型灵活性
为泛型参数提供合理的默认类型和约束
避免过度使用泛型导致类型复杂化
在泛型参数上应用限制条件(constraints)确保类型安全
为复杂泛型提供类型别名以提高可读性
使用交叉类型(&)合并多个类型
使用 Partial、Pick<T, K>、Omit<T, K> 等工具类型修改现有类型
扩展原生 DOM 元素属性时,继承相应的内置类型
使用 type 定义联合类型和交叉类型
优先使用自带的工具类型,避免重复定义
使用字面量联合类型定义有限的选项集合
为复杂的枚举值提供类型守卫函数
避免使用enum,优先使用联合类型和as const
对于关键常量,使用as const断言确保类型严格
为联合类型中的每个值提供适当的注释
尽可能依赖 TypeScript 的类型推断
只在必要时使用类型断言(as)
使用类型守卫函数进行运行时类型检查
避免使用非空断言操作符(!)
使用instanceof和typeof进行类型守卫
为自定义类型创建类型谓词(type predicates)函数
为复杂的类型、函数、组件添加 JSDoc 注释
使用@deprecated标记已废弃的 API
在注释中提供使用示例
说明参数和返回值的含义与约束
在 interface 和重要类型定义上添加文档注释
使用@template标记泛型参数
使用条件类型处理复杂的类型逻辑
导出组件类型和接口
使用 React.FC 或明确的返回类型
避免使用 any,优先使用 unknown
组件 Props 使用 interface 定义
工具类型使用 type 定义
使用明确的命名约定
合理使用泛型提高复用性
导出类型时使用 export type
组件属性使用 JSDoc 注释说明用途Files:
tests/shared/imageTest.tsx**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/project.mdc)
**/*.tsx: 使用函数式组件和 hooks,避免类组件
组件名使用大驼峰(PascalCase)
合理使用 React.memo、useMemo 和 useCallback 优化性能Files:
tests/shared/imageTest.tsx🧠 Learnings (12)
📓 Common learnings
Learnt from: CR PR: ant-design/ant-design#0 File: .cursor/rules/demo.mdc:0-0 Timestamp: 2025-07-20T07:37:07.890Z Learning: Applies to components/*/demo/*.tsx : 避免过时 API,及时更新到新推荐用法Learnt from: CR PR: ant-design/ant-design#0 File: .cursor/rules/testing.mdc:0-0 Timestamp: 2025-07-20T08:12:29.083Z Learning: Applies to **/__tests__/**/*.test.tsx : 测试文件放在 __tests__ 目录,命名格式为:index.test.tsx 或 xxx.test.tsxLearnt from: CR PR: ant-design/ant-design#0 File: .cursor/rules/testing.mdc:0-0 Timestamp: 2025-07-20T08:12:29.083Z Learning: Applies to **/__tests__/**/*.{test.ts,test.tsx} : 使用 Jest 和 React Testing Library 编写单元测试📚 Learning: 2025-07-20T08:12:55.482Z
Learnt from: CR PR: ant-design/ant-design#0 File: .cursor/rules/typescript.mdc:0-0 Timestamp: 2025-07-20T08:12:55.482Z Learning: Applies to **/*.{ts,tsx} : 使用字面量联合类型定义有限的选项集合Applied to files:
tests/shared/imageTest.tsx📚 Learning: 2025-07-20T07:37:07.890Z
Learnt from: CR PR: ant-design/ant-design#0 File: .cursor/rules/demo.mdc:0-0 Timestamp: 2025-07-20T07:37:07.890Z Learning: Applies to components/*/demo/*.tsx : 每个 demo 聚焦展示一个功能点Applied to files:
tests/shared/imageTest.tsx📚 Learning: 2025-07-20T07:37:07.890Z
Learnt from: CR PR: ant-design/ant-design#0 File: .cursor/rules/demo.mdc:0-0 Timestamp: 2025-07-20T07:37:07.890Z Learning: Applies to components/*/demo/*.tsx : demo 代码实用且专注于单一功能Applied to files:
tests/shared/imageTest.tsx📚 Learning: 2025-07-20T07:37:07.890Z
Learnt from: CR PR: ant-design/ant-design#0 File: .cursor/rules/demo.mdc:0-0 Timestamp: 2025-07-20T07:37:07.890Z Learning: Applies to components/*/demo/*.{tsx,md} : demo 文件扩展名:基础 demo:.tsx,markdown 说明:.mdApplied to files:
tests/shared/imageTest.tsx📚 Learning: 2025-07-20T07:37:07.890Z
Learnt from: CR PR: ant-design/ant-design#0 File: .cursor/rules/demo.mdc:0-0 Timestamp: 2025-07-20T07:37:07.890Z Learning: Applies to components/*/demo/*.{tsx,md} : 每个组件演示包含 .md(说明文档)和 .tsx(实际代码)两个文件Applied to files:
tests/shared/imageTest.tsx📚 Learning: 2025-07-20T07:37:07.890Z
Learnt from: CR PR: ant-design/ant-design#0 File: .cursor/rules/demo.mdc:0-0 Timestamp: 2025-07-20T07:37:07.890Z Learning: Applies to components/*/demo/*.{tsx,md} : 基础文件命名如 basic.tsx、controlled.tsxApplied to files:
tests/shared/imageTest.tsx📚 Learning: 2025-07-20T08:12:29.083Z
Learnt from: CR PR: ant-design/ant-design#0 File: .cursor/rules/testing.mdc:0-0 Timestamp: 2025-07-20T08:12:29.083Z Learning: Applies to **/__tests__/**/*.test.tsx : 测试文件放在 __tests__ 目录,命名格式为:index.test.tsx 或 xxx.test.tsxApplied to files:
tests/shared/imageTest.tsx📚 Learning: 2025-07-20T07:37:07.890Z
Learnt from: CR PR: ant-design/ant-design#0 File: .cursor/rules/demo.mdc:0-0 Timestamp: 2025-07-20T07:37:07.890Z Learning: Applies to components/*/demo/*.tsx : TSX 代码风格:2空格缩进,箭头函数,驼峰命名Applied to files:
tests/shared/imageTest.tsx📚 Learning: 2025-07-20T07:37:07.890Z
Learnt from: CR PR: ant-design/ant-design#0 File: .cursor/rules/demo.mdc:0-0 Timestamp: 2025-07-20T07:37:07.890Z Learning: Applies to components/*/demo/*.tsx : 使用有意义的数据和变量Applied to files:
tests/shared/imageTest.tsx📚 Learning: 2025-07-20T08:12:29.083Z
Learnt from: CR PR: ant-design/ant-design#0 File: .cursor/rules/testing.mdc:0-0 Timestamp: 2025-07-20T08:12:29.083Z Learning: Applies to **/__tests__/**/*.test.tsx : 对 UI 组件使用快照测试 (Snapshot Testing)Applied to files:
tests/shared/imageTest.tsx📚 Learning: 2025-07-20T07:37:07.890Z
Learnt from: CR PR: ant-design/ant-design#0 File: .cursor/rules/demo.mdc:0-0 Timestamp: 2025-07-20T07:37:07.890Z Learning: Applies to components/*/demo/*.{tsx,md} : 文件名应简洁地描述示例内容Applied to files:
tests/shared/imageTest.tsx⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
- GitHub Check: size
- GitHub Check: test-react-legacy (17, 2/2)
- GitHub Check: test lib/es module (es, 2/2)
- GitHub Check: test lib/es module (es, 1/2)
- GitHub Check: test-react-legacy (16, 2/2)
- GitHub Check: test-react-legacy (16, 1/2)
- GitHub Check: test-react-legacy (17, 1/2)
- GitHub Check: build
- GitHub Check: test-react-latest (dom, 1/2)
- GitHub Check: build
- GitHub Check: visual-diff snapshot (2/2)
- GitHub Check: visual-diff snapshot (1/2)
- GitHub Check: lint
- GitHub Check: test-react-latest (dom, 2/2)
- GitHub Check: build preview
- GitHub Check: Analyze (javascript)
- GitHub Check: build
7.52.47.52.5





























中文版模板 / Chinese template
🤔 This is a ...
🔗 Related Issues
💡 Background and Solution
react-component/table@v7.51.1...v7.52.5
#51394
#42713
#29720
https://codesandbox.io/s/suiyemiangundongdegudingbiaotouhegundongtiao-antd4131-forked-jts6c?file=/index.js
https://codesandbox.io/p/devbox/sui-ye-mian-gun-dong-de-gu-ding-biao-tou-he-gun-dong-tiao-antd-4-13-1-forked-v2sglt
#31494
https://codepen.io/cjtcjt999/pen/YzoyeOg?editors=001
📝 Change Log
zh-cn.md
en-us.md