Skip to content

chore: playground 增加 grid-tree,修复 vue playground 多行文本不生效 - #3317

Merged
Alexzjt merged 4 commits into
nextfrom
chore/playground
Feb 6, 2026
Merged

Alexzjt merged 4 commits into
nextfrom
chore/playground

Conversation

@Alexzjt

@Alexzjt Alexzjt commented Feb 6, 2026 •

Copy link
Copy Markdown
Contributor
Before After
❌ image ✅ image

@github-actions

github-actions Bot commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

你好 @Alexzjt,非常感谢你的贡献.
为了让代码更健壮, 请根据 贡献指南 补充相应单元测试 (文档改动或其他特殊场景除外), 如果有 API 改动, 请修改 相应的文档.
同时请检查 lint 和 test 相关 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 next 2.0-next 版本的问题 label Feb 6, 2026
@github-actions github-actions Bot added the pr(chore) configuration changes label Feb 6, 2026
@gemini-code-assist

Copy link
Copy Markdown
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!

此拉取请求主要旨在增强 React 和 Vue 组件的 playground 环境。它在 playground 的配置界面中引入了一个新的 grid-tree 层级类型选项,使用户能够体验这种新的显示模式。此外,它还解决了 Vue playground 中多行文本显示不正确的问题,从而提升了 Vue 用户的显示能力。

Highlights

  • React Playground 增强: 在 React playground 中,将层级类型选择器从 Switch 组件替换为 Radio.Group 组件,并新增了 grid-tree 选项,同时为选择器添加了 Tooltip 提示。
  • Vue Playground 增强与修复: 在 Vue playground 中,同样将层级类型选择器从 a-switch 替换为 a-radio-group 并新增 grid-tree 选项。此外,引入了 pivotSheetMultiLineTextDataCfg 并添加了 onMaxLinesChange 函数,以修复 Vue 环境下多行文本显示不生效的问题。
  • 统一层级类型选择 UI: 统一了 React 和 Vue playground 中层级类型选择的 UI 控件,使其都使用单选按钮组来提供 grid、tree 和 grid-tree 选项。
Changelog
  • packages/s2-react/playground/index.tsx
    • 将 hierarchyType 的选择控件从 Switch 替换为 Radio.Group。
    • 在 Radio.Group 中新增了 grid-tree 选项。
    • 为 Radio.Group 添加了 Tooltip 提示。
  • packages/s2-vue/playground/App.vue
    • 导入了 pivotSheetMultiLineTextDataCfg。
    • 新增了 onMaxLinesChange 函数,用于根据 pivotSheetMultiLineTextDataCfg 更新数据配置。
    • 将 hierarchyType 的选择控件从 a-switch 替换为 a-radio-group。
    • 在 a-radio-group 中新增了 grid-tree 选项。
    • 为 a-radio-group 添加了 a-tooltip 提示。
    • 将 onMaxLinesChange 函数作为 prop 传递给相关的配置组件。
Activity
  • 此 PR 被标记为 chore 类型,主要涉及 playground 的更新。
  • PR 描述中包含前后对比截图,清晰展示了 Vue 多行文本显示问题的修复效果。
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
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 pull request 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. ↩

@Alexzjt Alexzjt changed the title chore: playground 增加 grid-tree,修复 vue 多行文本不生效 chore: playground 增加 grid-tree,修复 vue playground 多行文本不生效 Feb 6, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

这个 PR 为 React 和 Vue 的 playground 添加了 grid-tree 层级结构类型,并修复了 Vue playground 中多行文本不生效的问题。代码改动大部分是好的,但我在 Vue playground 的实现中发现了一些问题需要修正。具体来说,一个控件缺少了 disabled 状态,并且处理多行文本的逻辑与 React 的实现相比不够完整。

Comment thread packages/s2-vue/playground/App.vue Resolved
Comment thread packages/s2-vue/playground/App.vue Resolved
@codecov-commenter

codecov-commenter commented Feb 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.76%. Comparing base (ecdc9c8) to head (8bae5a3).
⚠️ Report is 779 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #3317      +/-   ##
==========================================
+ Coverage   75.77%   78.76%   +2.99%     
==========================================
  Files         257      224      -33     
  Lines       11994    12456     +462     
  Branches     2464     2820     +356     
==========================================
+ Hits         9088     9811     +723     
+ Misses       1398      950     -448     
- Partials     1508     1695     +187     

☔ 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

github-actions Bot commented Feb 6, 2026 •

Copy link
Copy Markdown
Contributor

Size Change: +118 B (+0.02%)

Total Size: 740 kB

Filename Size Change
./packages/s2-core/dist/s2-extends.min.js 208 kB +59 B (+0.03%)
./packages/s2-core/dist/s2.min.css 583 B +2 B (+0.34%)
./packages/s2-core/dist/s2.min.js 308 kB +57 B (+0.02%)
ℹ️ View Unchanged
Filename Size
./packages/s2-react-components/dist/s2-react-components.min.css 2.55 kB
./packages/s2-react-components/dist/s2-react-components.min.js 123 kB
./packages/s2-react/dist/s2-react.min.css 1.3 kB
./packages/s2-react/dist/s2-react.min.js 38.5 kB
./packages/s2-vue/dist/s2-vue.min.css 3.8 kB
./packages/s2-vue/dist/s2-vue.min.js 54.2 kB

compressed-size-action

@Alexzjt

Alexzjt commented Feb 6, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

本次 PR 主要有两个目的:

  1. 在 React 和 Vue 的 playground 中为透视表增加了 grid-tree 的层级结构选项,替换了原有的平铺/树形切换开关。
  2. 修复了 Vue playground 中,当文本行数变化时,表格数据配置没有正确更新导致多行文本不生效的问题。

代码改动主要集中在 playground 组件,核心代码 s2-core 中有一处小的调整以支持 grid-tree 的单元格宽度计算。整体来看,改动清晰地实现了目标。

我提出了一些关于代码可维护性的建议,主要是建议将新添加的内联样式提取到 CSS 类中,以便于统一管理和维护。

Comment thread packages/s2-vue/playground/App.vue Resolved
@Alexzjt

Alexzjt commented Feb 6, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

本次 PR 主要增加了 grid-tree 布局模式的支持,并修复了 Vue playground 中多行文本不生效的问题。核心逻辑的修改看起来是正确的,并且与添加的功能和修复的缺陷相符。我在 playground 文件中发现了一些可以减少代码重复、提高可维护性的机会。总的来说,这是一次不错的更新。

Comment thread packages/s2-react/playground/index.tsx Resolved
Comment thread packages/s2-vue/playground/App.vue Resolved
@Alexzjt
Alexzjt merged commit ea9c6a3 into next Feb 6, 2026
9 checks passed
@Alexzjt
Alexzjt deleted the chore/playground branch February 6, 2026 05:49
@Alexzjt

Alexzjt commented Mar 31, 2026

Copy link
Copy Markdown
Contributor Author

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

The release is available on:

Your semantic-release bot 📦🚀

Laffery pushed a commit to Laffery/S2 that referenced this pull request Jul 17, 2026
* chore: 在 playground 中增加 grid-tree

* chore: 换行配置生效

* fix: grid-tree 行头文本较长时可能会溢出单元格

* fix: tree 和 grid-tree 模式下,如果用户没有配置 totals,不应该自动聚合
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

next 2.0-next 版本的问题 pr(chore) configuration changes released on @latest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants