Repository navigation
Conversation
|
你好 @Alexzjt,非常感谢你的贡献. 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. |
There was a problem hiding this comment.
Code Review
This pull request updates the getMaxLines logic in DataCell to ensure that maximum lines are calculated based on the current cell height, preventing text wrapping when vertical space is insufficient. This change is verified by updated test snapshots showing correct text truncation. A review comment suggests improving the code documentation by translating a Chinese comment into English and generalizing its description to include both pivot and table sheets.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #3339 +/- ##
==========================================
+ Coverage 75.77% 78.65% +2.88%
==========================================
Files 257 224 -33
Lines 11994 12502 +508
Branches 2464 2842 +378
==========================================
+ Hits 9088 9833 +745
+ Misses 1398 959 -439
- Partials 1508 1710 +202 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Size Change: -66 B (-0.01%) Total Size: 744 kB 📦 View Changed
ℹ️ View Unchanged
|
|
🎉 This PR is included in version @antv/s2-v2.7.1-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version @antv/s2-v2.7.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* fix: dataCell 始终按当前 meta.height 计算可展示行数 * fix: 修复单测
👀 PR includes
🐛 Bugfix
🔧 Chore
📝 Description
改动点在 data-cell.ts (line 542):DataCell 现在会始终按当前 meta.height 计算可展示行数,而不是只有“自定义高度”时才计算。
之前的问题是默认行高下 getResizedTextMaxLines() 返回 undefined,于是回退到你配置的 dataCell.maxLines: 10,导致文本继续按 10 行换行。现在会按当前行高收缩成 1 行,textOverflow: 'ellipsis' 才能生效。
🖼️ Screenshot