Skip to content

Conversation

@Wxh16144
Copy link
Member

@Wxh16144 Wxh16144 commented Sep 1, 2025

中文版模板 / Chinese template

🤔 This is a ...

  • 🆕 New feature
  • 🐞 Bug fix
  • 📝 Site / documentation improvement
  • 📽️ Demo improvement
  • 💄 Component style improvement
  • 🤖 TypeScript definition improvement
  • 📦 Bundle size optimization
  • ⚡️ Performance optimization
  • ⭐️ Feature enhancement
  • 🌐 Internationalization
  • 🛠 Refactoring
  • 🎨 Code style optimization
  • ✅ Test Case
  • 🔀 Branch merge
  • ⏩ Workflow
  • ⌨️ Accessibility improvement
  • ❓ Other (about what?)

🔗 Related Issues

💡 Background and Solution

react-component/table@v7.51.1...v7.52.5

🔢 序号 📝 Issue ❌ 修复前 ✅ 修复后
1 #54734 https://stackblitz.com/edit/vc5pseur?file=package.json https://stackblitz.com/edit/vc5pseur-fc3asbbm?file=package.json
2 #54741 https://stackblitz.com/edit/55a15r2v?file=src%2Fdemo.tsx,src%2Fstyle.css,package.json https://stackblitz.com/edit/bcag1j3u?file=package.json,package-lock.json
3 #31494 https://codesandbox.io/p/sandbox/zealous-snowflake-4bwwy?file=%2Findex.js%3A112%2C2 https://codesandbox.io/p/devbox/young-currying-5n47sd?file=%2Fpackage.json%3A8%2C1&workspaceId=ws_Y4dvm83bxuSojh3Pw1yD9H
4 #53781 https://stackblitz.com/edit/react-dv9t58x9-4kxhajmh?file=demo.js Chrome 最新版本(139)已修复
5 #53711 https://codesandbox.io/p/sandbox/ji-ben-yong-fa-antd-5-21-4-forked-pgf3f3 Chrome 最新版本(139)已修复
6 #34009 https://codesandbox.io/p/sandbox/wonderful-roman-256r76?file=%2Findex.tsx%3A14%2C17 新版本浏览器没问题,旧版本不解决了
7 #53829
#51394
#42713
#29720
https://codesandbox.io/p/devbox/ji-ben-yong-fa-antd-4-24-12-forked-qr9ygh
https://codesandbox.io/s/suiyemiangundongdegudingbiaotouhegundongtiao-antd4131-forked-jts6c?file=/index.js
https://codesandbox.io/p/sandbox/ji-ben-yong-fa-antd-4-24-12-forked-4663n8
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
8 #41818 https://stackblitz.com/edit/react-varhnk?file=demo.tsx https://stackblitz.com/edit/zhwpvgml?file=src%2FApp.tsx,package.json
9 #51034 https://codepen.io/vcxldk/pen/xxvbMoR https://stackblitz.com/edit/zhwpvgml-wfqisgrs?file=src%2FApp.tsx,package.json
10 #51290 https://codesandbox.io/p/sandbox/ji-ben-yong-fa-antd-5-21-4-forked-znmjgj https://codesandbox.io/p/devbox/ji-ben-yong-fa-antd-5-21-4-forked-tlppqd?file=%2Fpackage.json%3A10%2C28&workspaceId=ws_Y4dvm83bxuSojh3Pw1yD9H
11 #50049 https://codesandbox.io/p/sandbox/ant-design-react-18-forked-k7rtrw https://codesandbox.io/p/devbox/ant-design-react-18-forked-8rxz35?workspaceId=ws_Y4dvm83bxuSojh3Pw1yD9H
12 #52463
#31494
https://codesandbox.io/p/sandbox/84lz8y?file=%2Fsrc%2FApp.tsx
https://codepen.io/cjtcjt999/pen/YzoyeOg?editors=001
https://codesandbox.io/p/devbox/antd-table-forked-rcdq54?file=%2Fpackage.json%3A5%2C23&workspaceId=ws_Y4dvm83bxuSojh3Pw1yD9H
13 #47353 https://codesandbox.io/p/sandbox/elated-feistel-pfm9tp https://codesandbox.io/p/devbox/elated-feistel-forked-zs6zvv?workspaceId=ws_Y4dvm83bxuSojh3Pw1yD9H
Before ❌ After ✅
图片 图片

📝 Change Log

zh-cn.md

- 🐞 修复 Table 设置 `scroll.y` 或者 `sticky` 时表头列宽度被挤压或渲染闪烁的问题。[#54824](https://github.com/ant-design/ant-design/pull/54824) [@afc163](https://github.com/afc163)
  | Before ❌   | After ✅ |
  | ---------- | --------- |
  | <img width="400" alt="图片" src="https://github.com/user-attachments/assets/48109e0a-bc90-4897-8454-e2a5f14e9d8c" /> | <img width="400" alt="图片" src="https://github.com/user-attachments/assets/67f59ccc-98a2-445f-9eb9-abd0526a3892" /> |

- 🐞 修复 Table 在虚拟滚动时,`scroll.scrollToFirstRowOnChange` 配置不生效的问题。[#54734](https://github.com/ant-design/ant-design/issues/54734) [@Wxh16144](https://github.com/Wxh16144)
- 🐞 修复 Table 的列配置了 `children` 时,无法 `fixed: 'right'` 的问题。[#51812](https://github.com/ant-design/ant-design/issues/51812) [@ryantang247](https://github.com/ryantang247)
- 🐞 修复 Table 配置 `expandable.fixed` 时,展开列没有显示的问题。[@inottn](https://github.com/inottn)

en-us.md

- 🐞 Fix Table header width compression issues and render flickering issues when `scroll.y` or `sticky` is set. [#54824](https://github.com/ant-design/ant-design/pull/54824) [@afc163](https://github.com/afc163)
  | Before ❌   | After ✅ |
  | ---------- | --------- |
  | <img width="400" alt="图片" src="https://github.com/user-attachments/assets/48109e0a-bc90-4897-8454-e2a5f14e9d8c" /> | <img width="400" alt="图片" src="https://github.com/user-attachments/assets/67f59ccc-98a2-445f-9eb9-abd0526a3892" /> |
- 🐞 Fix Table `scroll.scrollToFirstRowOnChange` not working with virtual scroll. [#54734](https://github.com/ant-design/ant-design/issues/54734) [@Wxh16144](https://github.com/Wxh16144)
- 🐞 Fix Table columns with `children` not working with `fixed: 'right'`. [#51812](https://github.com/ant-design/ant-design/issues/51812) [@ryantang247](https://github.com/ryantang247)
- 🐞 Fix Table expand column not being displayed when `expandable.fixed. [@inottn](https://github.com/inottn)
Language Changelog
🇺🇸 English check in the PR description
🇨🇳 Chinese 有好几个 fix,写在 PR 描述中了

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2025

👁 Visual Regression Report for PR #54824 Failed ❌

🎯 Target branch: master (23a2b5e)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎
📊 Summary: 🔄 32 changed

Expected (Branch master) Actual (Current PR) Diff
list-vertical.dark.png list-vertical.dark.png list-vertical.dark.png list-vertical.dark.png
list-vertical.dark.png list-vertical.dark.png list-vertical.dark.css-var.png list-vertical.dark.css-var.png
table-fixed-columns-header.compact.png table-fixed-columns-header.compact.png table-fixed-columns-header.compact.png table-fixed-columns-header.compact.png
table-fixed-columns-header.compact.png table-fixed-columns-header.compact.png table-fixed-columns-header.compact.css-var.png table-fixed-columns-header.compact.css-var.png
table-fixed-columns-header.dark.png table-fixed-columns-header.dark.png table-fixed-columns-header.dark.png table-fixed-columns-header.dark.png
table-fixed-columns-header.dark.png table-fixed-columns-header.dark.png table-fixed-columns-header.dark.css-var.png table-fixed-columns-header.dark.css-var.png
table-fixed-columns-header.default.png table-fixed-columns-header.default.png table-fixed-columns-header.default.png table-fixed-columns-header.default.png
table-fixed-columns-header.default.png table-fixed-columns-header.default.png table-fixed-columns-header.default.css-var.png table-fixed-columns-header.default.css-var.png

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: 🔄 32 changed.
Please check all items:

  • Checked all diffs in the full report
  • Visual diff is acceptable

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 1, 2025

📝 Walkthrough

Summary by CodeRabbit

  • 维护
    • 升级依赖 rc-table 至 ~7.52.5,包含上游小幅更新与兼容性改进,不影响现有功能行为。
  • 测试
    • 图像回归测试支持选择性运行指定示例,便于聚焦单个或少量用例进行验证;默认行为保持不变。

Walkthrough

package.jsonrc-table 依赖从 ~7.51.1 升级到 ~7.52.5;在 tests/shared/imageTest.tsx 中为 imageDemoTest 添加可选参数 only?: string[],当提供时使用显式 demo 文件列表而非 glob 发现。

Changes

Cohort / File(s) Summary
Dependency bump
package.json
将依赖 rc-table 版本从 ~7.51.1 升级为 ~7.52.5
测试工具:imageDemoTest 行为变更
tests/shared/imageTest.tsx
type Options 添加 only?: string[]imageDemoTestoptions.only 存在时构建显式路径 ./components/${component}/demo/${file}.tsx 并使用该列表,否则继续 glob 发现并过滤 _semantic。用于仅运行指定 demo(调试)。

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 文件列表并执行截图测试
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • zombieJ
  • li-jia-nan
  • thinkasany

Poem

我是小兔子敲键盘,
依赖换新鞋轻快跑,
测试有了只挑选,
调试更快显成果,
合并后我去啃萝卜 🐰🌿


📜 Recent 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.

📥 Commits

Reviewing files that changed from the base of the PR and between de0ccff and 51eebcf.

⛔ Files ignored due to path filters (1)
  • components/table/__tests__/__snapshots__/demo-extend.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (1)
  • tests/shared/imageTest.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • 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: visual-diff snapshot (2/2)
  • GitHub Check: visual-diff snapshot (1/2)
  • GitHub Check: test lib/es module (es, 2/2)
  • GitHub Check: build
  • GitHub Check: test lib/es module (es, 1/2)
  • GitHub Check: test-react-latest (dom, 1/2)
  • GitHub Check: test-react-legacy (16, 1/2)
  • GitHub Check: test-react-latest (dom, 2/2)
  • GitHub Check: test-react-legacy (17, 2/2)
  • GitHub Check: test-react-legacy (16, 2/2)
  • GitHub Check: test-react-legacy (17, 1/2)
  • GitHub Check: lint
  • GitHub Check: build
  • GitHub Check: build preview
  • GitHub Check: size
  • GitHub Check: Analyze (javascript)
  • GitHub Check: build
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch wuxh/bump-rc-table

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2025

Preview is ready

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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-table dependency has been updated from version 7.51.1 to 7.52.1.
  • Virtual Scroll Fix: Addresses an issue where scroll.scrollToFirstRowOnChange did not function correctly with virtual scrolling in the Table component.
  • Column Fixed Positioning: Resolves a bug preventing columns with children from being correctly fixed to the right (fixed: 'right').
  • Expandable Column Display: Fixes a problem where the expand column was not displayed when expandable.fixed was 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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

@socket-security
Copy link

socket-security bot commented Sep 1, 2025

@coderabbitai coderabbitai bot added lgtm This PR has been approved by a maintainer skip-verify-files labels Sep 1, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2025

size-limit report 📦

Path Size
dist/antd.min.js 445.23 KB (+104 B 🔺)
dist/antd-with-locales.min.js 532.76 KB (+109 B 🔺)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 1, 2025

@codecov
Copy link

codecov bot commented Sep 1, 2025

Bundle Report

Changes will increase total bundle size by 784 bytes (0.02%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.38MB 784 bytes (0.02%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: antd.min-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
antd-with-locales.min.js 392 bytes 1.84MB 0.02%
antd.min.js 392 bytes 1.53MB 0.03%

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 5079856 and 5f01f6d.

📒 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

@afc163
Copy link
Member

afc163 commented Sep 1, 2025

@Wxh16144
Copy link
Member Author

Wxh16144 commented Sep 1, 2025

还有这个:

这个写了, 就是最后一条。

@afc163
Copy link
Member

afc163 commented Sep 1, 2025

还有这一系列问题 #54741 (comment)

@codecov
Copy link

codecov bot commented Sep 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (23a2b5e) to head (51eebcf).
⚠️ Report is 1 commits behind head on master.

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.
📢 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.

thinkasany
thinkasany previously approved these changes Sep 1, 2025
@Wxh16144
Copy link
Member Author

Wxh16144 commented Sep 1, 2025

还有这一系列问题 #54741 (comment)

不确定讨论结果? 那就有劳发版的同学整理一下 changelog吧,我感觉我描述的不够准确
image

@afc163
Copy link
Member

afc163 commented Sep 1, 2025

重现和修复自查自测列表:

@afc163 afc163 marked this pull request as draft September 1, 2025 08:48
@afc163 afc163 changed the title fix(deps): bump rc-table to 7.52.1 fix(deps): bump rc-table to 7.52.3 Sep 1, 2025
@afc163 afc163 changed the title fix(deps): bump rc-table to 7.52.4 fix: bump rc-table to 7.52.4 Sep 2, 2025
@afc163 afc163 changed the title fix: bump rc-table to 7.52.4 fix: Table issues by upgrade rc-table to 7.52.4 Sep 2, 2025
@afc163
Copy link
Member

afc163 commented Sep 2, 2025

react-component/table#1332 😂 未能解决问题。

@crazyair
Copy link
Member

crazyair commented Sep 2, 2025

先看看本地能复现吗?实在复现不了,改快照生成逻辑

@crazyair
Copy link
Member

crazyair commented Sep 2, 2025

这个快照功能,有本地 debug 模式吗,起个无头浏览器,看下是不是显示就有问题

@afc163

This comment was marked as off-topic.

@crazyair
Copy link
Member

crazyair commented Sep 3, 2025

没有鬼,肯定有差异存在!

@afc163
Copy link
Member

afc163 commented Sep 3, 2025

图片

搞错图了,确实是有问题的。

@crazyair
Copy link
Member

crazyair commented Sep 3, 2025

不止是看到结果(截图),看看能调试吗?看启动的浏览器,查样式

@afc163
Copy link
Member

afc163 commented Sep 3, 2025

找到原因了,jsdom 里会出现 colWidths 都是 0 的情况。

图片

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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.

📥 Commits

Reviewing files that changed from the base of the PR and between b3c5f12 and de0ccff.

⛔ Files ignored due to path filters (1)
  • components/table/__tests__/__snapshots__/demo.test.ts.snap is 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)
使用类型守卫函数进行运行时类型检查
避免使用非空断言操作符(!)
使用 instanceoftypeof 进行类型守卫
为自定义类型创建类型谓词(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.tsx
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.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 说明:.md

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} : 每个组件演示包含 .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.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 : 测试文件放在 __tests__ 目录,命名格式为:index.test.tsx 或 xxx.test.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 : 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

@coderabbitai coderabbitai bot requested a review from thinkasany September 3, 2025 10:56
@yoyo837 yoyo837 changed the title fix: Table issues by upgrade rc-table to 7.52.4 fix: Table issues by upgrade rc-table to 7.52.5 Sep 3, 2025
@afc163
Copy link
Member

afc163 commented Sep 3, 2025

现在 Visual Diff 好了,符合预期了。

图片

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer skip-verify-files

Projects

None yet

5 participants