table icon indicating copy to clipboard operation
table copied to clipboard

Fix/gap fixed columns shadow

Open bbb169 opened this issue 1 year ago • 5 comments

fix: https://github.com/ant-design/ant-design/issues/47834

Summary by CodeRabbit

  • 新功能

    • 添加了对表格组件的支持,改进了列索引和引用转发功能。
    • 引入了新的 summary 属性,允许用户提供自定义摘要。
    • 更新了 CellHeaderRow 组件,增强了对列索引的支持。
    • 简化了表格组件的 API,整合了行交互相关的属性。
  • 修复

    • 修复了固定列的渲染和调整事件的处理。
  • 文档

    • 更新了测试用例,确保在不同情况下组件的正确性,包括右到左的布局和固定列的视觉表现。

bbb169 avatar Nov 01 '24 14:11 bbb169

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
table ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 8, 2024 2:04pm

vercel[bot] avatar Nov 01 '24 14:11 vercel[bot]

Walkthrough

本次更改主要涉及表格组件的样式和功能增强。具体来说,移除了 .tablePrefixCls-fixed-column-gapped 类,影响固定列的显示效果。同时,BodyRowCell 组件新增了 colIndex 属性,以便于对列索引的处理。Table 组件的多个属性进行了重构,简化了 API,并增加了对表格摘要的支持。测试用例也进行了扩展,以验证固定列的渲染和调整行为。

Changes

文件路径 更改摘要
assets/index.less 移除 .tablePrefixCls-fixed-column-gapped 类,影响固定列的伪元素显示。
src/Body/BodyRow.tsx Cell 组件中添加 colIndex 属性,增强列索引处理能力。
src/Cell/index.tsx 添加 colIndex 属性到 CellProps 接口,更新 Cell 函数签名以支持 ref 转发。
src/Header/HeaderRow.tsx HeaderRow 组件中添加 headerCellRefscolIndex,增强对表头单元格的引用管理。
src/Table.tsx 移除多个与行交互相关的属性,重构 expandable 属性,添加 summary 属性以支持表格摘要。
src/context/TableContext.tsx TableContextProps 接口中添加 headerCellRefsbodyScrollLeft 属性。
tests/FixedColumn.spec.tsx 添加 getBoundingClientRect 方法到 domSpy 设置,扩展测试用例以验证固定列的渲染和调整行为。
tests/Scroll.spec.jsx 引入 safeAct 函数,重构滚动相关测试,改进滚动事件的处理逻辑和测试结构。

Assessment against linked issues

Objective Addressed Explanation
堆叠列有阴影 (### #47834)

Possibly related PRs

  • #1195: 此 PR 修改了 expandedRowClassName 属性,与主 PR 中对表格样式的增强相关。
  • #1199: 此 PR 解决了与表格中固定列的视觉表现相关的问题,连接到主 PR 中对固定列渲染的影响。

Suggested reviewers

  • zombieJ
  • MadCcc

Poem

🐇 在表格中跳跃,样式新生,
固定列的阴影,终于显现。
列索引相随,功能更强,
测试用例齐全,确保无恙。
让我们欢庆,代码的辉煌! 🎉

[!WARNING]

Tool Failures:

Tool Failure Count:


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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

Documentation and Community

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

coderabbitai[bot] avatar Nov 01 '24 14:11 coderabbitai[bot]

看下上面 CR Bot 的评论

afc163 avatar Nov 08 '24 03:11 afc163

看下上面 CR Bot 的评论

已resolve 解决此问题必须要每次滚动时重新计算,无解,目前看没有性能问题

bbb169 avatar Nov 08 '24 12:11 bbb169

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.77%. Comparing base (26f9746) to head (e862c63). Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1202      +/-   ##
==========================================
+ Coverage   97.75%   97.77%   +0.01%     
==========================================
  Files          75       75              
  Lines        7484     7540      +56     
  Branches     1121     1144      +23     
==========================================
+ Hits         7316     7372      +56     
  Misses        162      162              
  Partials        6        6              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Nov 08 '24 12:11 codecov[bot]