Skip to content

fix: preserve zero-valued column titles - #1516

Open
QDyanbing wants to merge 1 commit into
react-component:masterfrom
QDyanbing:fix-react-node-guards
Open

QDyanbing wants to merge 1 commit into
react-component:masterfrom
QDyanbing:fix-react-node-guards

Conversation

@QDyanbing

@QDyanbing QDyanbing commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

说明

  • 列标题为 0 时,宽度测量单元格使用实际内容,不再用空白替代。
  • 为零值列标题和分组标题生成正确的表头 scope,补充测量及无障碍属性测试。

验证

  • npm test -- --maxWorkers=2(238 项通过)
  • npm run tsc
  • 改动源码 ESLint 检查通过。

关联 ant-design/ant-design#59193

Summary by CodeRabbit

  • 修复
    • 标题为数字 0 时,现在也能正确显示;表头会按列结构设置对应的范围属性。

@vercel

vercel Bot commented Sep 28, 2026

Copy link
Copy Markdown

@QDyanbing is attempting to deploy a commit to the React Component Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 2d956613-d2da-4c59-a0a3-3c7db4033124

📥 Commits

Reviewing files that changed from the base of the PR and between e63fbf5 and 655813c.

📒 Files selected for processing (3)
  • src/Body/MeasureCell.tsx
  • src/Header/HeaderRow.tsx
  • tests/renderability.spec.tsx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


Walkthrough

表头和测量单元格现在使用 isReactRenderable 判断标题是否可渲染。新增测试验证标题值为 0 时的渲染结果。

Changes

标题可渲染性

Layer / File(s) Summary
标题渲染与验证
src/Header/HeaderRow.tsx, src/Body/MeasureCell.tsx, tests/renderability.spec.tsx
表头根据标题是否可渲染设置 scope,并继续依据 colSpan 选择 colgroup 或 col。测量单元格在标题不可渲染时显示不间断空格。新增测试验证零值标题文本和对应的表头范围属性。

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 65581

Zero-valued titles are now retained in header and measurement cells with the expected header scopes. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题“fix: preserve zero-valued column titles”准确概括了主要变更:保留值为 0 的列标题,并支持相关单元格内容和表头 scope 正确渲染。标题简洁且明确。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR

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.

@codecov

codecov Bot commented Sep 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.08%. Comparing base (e63fbf5) to head (655813c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1516   +/-   ##
=======================================
  Coverage   99.08%   99.08%           
=======================================
  Files          45       45           
  Lines        1426     1426           
  Branches      432      432           
=======================================
  Hits         1413     1413           
  Misses         13       13           

☔ View full report in Codecov by Harness.
📢 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.

This branch has not been deployed

No deployments
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.

1 participant