Skip to content

Conversation

@li-jia-nan
Copy link
Member

@li-jia-nan li-jia-nan commented Sep 15, 2025

Summary by CodeRabbit

  • 新功能
  • Bug 修复
    • 修复空数据状态下未渲染列结构导致的布局异常,确保列宽与整体布局在空态也保持一致,避免错位与抖动。
    • 提升空态与非空态在不同浏览器下的视觉一致性。

@vercel
Copy link

vercel bot commented Sep 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
table Ready Ready Preview Comment Sep 15, 2025 7:26am

@coderabbitai
Copy link

coderabbitai bot commented Sep 15, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

该变更仅修改了 src/FixedHolder/index.tsx 中关于 isColGroupEmpty 的条件渲染:当为空时不再返回 null,而是渲染 colGroup;非空路径仍渲染 ColGroup。未更改任何导出/公共实体的声明。

Changes

Cohort / File(s) 摘要
固定列占位渲染逻辑
src/FixedHolder/index.tsx
调整 isColGroupEmpty 分支:由返回 null 改为返回 colGroup;保持非空分支继续渲染 ColGroup。

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant R as React Renderer
    participant FH as FixedHolder
    participant CG as ColGroup

    R->>FH: render()
    alt isColGroupEmpty === true
        note over FH: 变更:不再返回 null<br/>改为直接输出 colGroup 片段
        FH-->>R: <colgroup>...</colgroup>
    else isColGroupEmpty === false
        FH->>CG: render ColGroup
        CG-->>FH: <colgroup>...</colgroup>
        FH-->>R: <colgroup>...</colgroup>
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • afc163

Poem

我在表格边缘跳一跳,(=^▽^=)
空空如也也铺好,colgroup 不再少。
左一列,右一列,齐整排成行,
轻敲胡萝卜键,布局更明朗。
嗅嗅风,蹦蹦走,表头不跑掉。

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch antd-5.x

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2cbe690 and d06f8a0.

📒 Files selected for processing (1)
  • src/FixedHolder/index.tsx (1 hunks)

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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 @li-jia-nan, 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 introduces several key updates to the rc-table library, likely as part of an ongoing upgrade to Ant Design 5.x. The changes focus on refining the measureRowRender functionality for better handling of hidden elements within table rows, streamlining the rendering logic for column groups in fixed table headers, and updating a core TypeScript type definition for React components to ensure modern compatibility and improved type safety.

Highlights

  • Enhanced measureRowRender Functionality: The measureRowRender function in rc-table has been updated to provide a more robust way of hiding elements within table rows, specifically by cloning React elements and merging styles to ensure proper rendering behavior.
  • Refactored FixedHolder Component: The internal FixedHolder component has been refactored to improve the conditional rendering of the ColGroup based on whether column width calculations are available, leading to cleaner and more explicit logic.
  • Updated React Type Definition: A core TypeScript type definition for React components has been updated from keyof React.ReactHTML to keyof React.JSX.IntrinsicElements, aligning with modern React and TypeScript practices for intrinsic HTML elements.
  • New Documentation and Example: A new documentation page and an updated example have been added for the measureRowRender feature, demonstrating its usage and the improved implementation.
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.

@codecov
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.75%. Comparing base (25fb5a1) to head (6fff957).
⚠️ Report is 78 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1357      +/-   ##
==========================================
- Coverage   97.75%   97.75%   -0.01%     
==========================================
  Files          77       77              
  Lines        7678     7666      -12     
  Branches     1165     1163       -2     
==========================================
- Hits         7506     7494      -12     
  Misses        166      166              
  Partials        6        6              

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@li-jia-nan li-jia-nan changed the title Antd 5.x chore: merge 5.x into master Sep 15, 2025
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 rc-table for compatibility with Ant Design 5.x. The changes include updating type definitions to modern standards, refactoring for better readability in FixedHolder, and fixing the measureRowRender implementation. The changes are solid. I've added one comment to improve type safety in the new measureRowRender example by removing unnecessary any casts.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants