Skip to content

Conversation

@Alexzjt
Copy link
Contributor

@Alexzjt Alexzjt commented Sep 19, 2025

👀 PR includes

✨ Feature

  • New feature

🎨 Enhance

  • Code style optimization
  • Refactoring
  • Change the UI
  • Improve the performance
  • Type optimization

🐛 Bugfix

  • Solve the issue and close #0

🔧 Chore

  • Test case
  • Docs / demos update
  • CI / workflow
  • Release version
  • Other ()

📝 Description

🖼️ Screenshot

Before After
image image

🔗 Related issue link

🔍 Self-Check before the merge

  • Add or update relevant docs.
  • Add or update relevant demos.
  • Add or update test case.
  • Add or update relevant TypeScript definitions.

@github-actions github-actions bot added the next 2.0-next 版本的问题 label Sep 19, 2025
@github-actions
Copy link
Contributor

你好 @Alexzjt,非常感谢你的贡献.
为了让代码更健壮, 请根据 贡献指南 补充相应单元测试 (文档改动或其他特殊场景除外), 如果有 API 改动, 请修改 相应的文档.
同时请检查 linttest 相关 CI 是否通过, 如果失败, 请点击 [Details] 按钮查看, 并根据日志修复.

Hello, @Alexzjt, Thanks for your contribution. In order to make the code more robust, please add the corresponding unit tests, and update the docs if there are API changes.
At the same time, please check whether the CI related to lint and test passes. If the CI fails, please click [Details] button to check and repair according to the log.

@github-actions github-actions bot added the pr(fix) bug fix label Sep 19, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Alexzjt, 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!

此 PR 旨在解决当字体大小增加时,单元格行高无法正确自适应的问题。通过调整核心的行高计算逻辑,并扩展了枢轴表和表格中行高自适应的触发条件,确保在字体变大时,单元格能够自动调整其高度以容纳内容。此外,还引入了一个统一的默认字体大小常量,以提高主题配置的一致性。

Highlights

  • 优化基础单元格行高计算: 简化了 BaseFacet 中单元格行高的自适应计算逻辑,现在只要文本高度大于默认高度,就会触发自适应行高,不再局限于多行文本。
  • 增强枢轴表行高自适应逻辑: 在 PivotFacet 中,除了多行文本和自动换行外,当行单元格的字体大小超过 12px 时,也会启用行高自适应功能。
  • 改进表格行高自适应判断: 在 TableFacet 中,引入了 DEFAULT_FONTSIZE 常量,并调整了预设行高和启用自适应行高的条件,使其在字体大小大于默认值时也能正确触发。
  • 统一默认字体大小配置: 在 theme/index.ts 中定义了 DEFAULT_FONTSIZE 常量为 12,并将其应用于所有相关主题配置中的字体大小,提高了代码的可维护性和一致性。
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

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

您好,感谢您的贡献。本次 PR 旨在解决字体变大时行高无法自适应的问题,整体修改思路清晰,实现合理。主要改动包括:在 base-facet.ts 中移除了 isMultiLineText() 的检查,使得单行大字体文本也能正确触发行高自适应;在 pivot-facet.tstable-facet.ts 中更新了启用高度自适应的逻辑,将字体大小也作为判断条件之一;在 theme/index.ts 中引入了 DEFAULT_FONTSIZE 常量来替代硬编码的字号 12,这是一个很好的重构,提高了代码的可维护性。我有一个小建议,希望能在 pivot-facet.ts 中也使用新引入的 DEFAULT_FONTSIZE 常量,以保持代码风格的统一。具体请看我的评论。

@codecov-commenter
Copy link

codecov-commenter commented Sep 19, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.67%. Comparing base (ecdc9c8) to head (faa4d03).
⚠️ Report is 745 commits behind head on next.

Files with missing lines Patch % Lines
packages/s2-core/src/facet/table-facet.ts 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #3230      +/-   ##
==========================================
+ Coverage   75.77%   79.67%   +3.90%     
==========================================
  Files         257      217      -40     
  Lines       11994    11985       -9     
  Branches     2464     2687     +223     
==========================================
+ Hits         9088     9549     +461     
+ Misses       1398      811     -587     
- Partials     1508     1625     +117     

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

@github-actions
Copy link
Contributor

github-actions bot commented Sep 19, 2025

Size Change: +144 B (+0.02%)

Total Size: 628 kB

Filename Size Change
./packages/s2-core/dist/s2.min.css 583 B +2 B (+0.34%)
./packages/s2-core/dist/s2.min.js 263 kB +142 B (+0.05%)
ℹ️ View Unchanged
Filename Size
./packages/s2-core/dist/s2-extends.min.js 158 kB
./packages/s2-react-components/dist/s2-react-components.min.css 2.55 kB
./packages/s2-react-components/dist/s2-react-components.min.js 124 kB
./packages/s2-react/dist/s2-react.min.css 1.3 kB
./packages/s2-react/dist/s2-react.min.js 38.3 kB
./packages/s2-vue/dist/s2-vue.min.css 1.59 kB
./packages/s2-vue/dist/s2-vue.min.js 38.3 kB

compressed-size-action

@Alexzjt
Copy link
Contributor Author

Alexzjt commented Sep 21, 2025

/gemini review

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

本次 PR 旨在修复当设置大字体时单元格行高无法自适应的问题,整体思路正确,通过修改触发高度自适应的条件来兼容字体大小的变化,并添加了相应的测试用例。然而,审查中发现了一些可以改进的地方:

  1. 新添加的测试用例中存在代码重复。
  2. base-facet.ts 中,访问主题属性时的可选链使用不一致。
  3. pivot-facet.tstable-facet.ts 中,检查字体大小的逻辑似乎不完整或存在错误,这可能导致在某些情况下高度自适应不会被正确触发。

建议修复以上问题,以确保代码的健壮性和可维护性。

@Alexzjt
Copy link
Contributor Author

Alexzjt commented Sep 21, 2025

/gemini review

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

这个 PR 旨在解决当字体变大时单元格行高不能自适应变高的问题。通过在主题字体大于默认值时启用自适应高度计算,本次修改成功地解决了这个问题。修改涉及 base-facetpivot-facettable-facet,覆盖了不同的单元格类型和表格模式。同时,新增的测试用例确保了修复的正确性。引入 DEFAULT_FONTSIZE 常量也是一个很好的重构。总体而言,代码修改得很好,我有一个关于代码完整性的建议。

@Alexzjt Alexzjt merged commit e74bd3c into next Oct 20, 2025
9 checks passed
@Alexzjt Alexzjt deleted the beta1 branch October 20, 2025 02:15
@lijinke666
Copy link
Member

🎉 This PR is included in version @antv/s2-v2.4.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

next 2.0-next 版本的问题 pr(fix) bug fix released on @latest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants