Skip to content

fix: maintain integer column widths and allocate remainder to the last auto-fit column#3349

Open
Alexzjt wants to merge 3 commits into
nextfrom
fix/3348
Open

fix: maintain integer column widths and allocate remainder to the last auto-fit column#3349
Alexzjt wants to merge 3 commits into
nextfrom
fix/3348

Conversation

@Alexzjt
Copy link
Copy Markdown
Contributor

@Alexzjt Alexzjt commented Jun 2, 2026

👀 PR includes

🐛 Bugfix

🔧 Chore

  • Test case

📝 Description

Maintain integer column widths using round(), and compensate for any remainder pixels by allocating them to the last auto-fit column.

Only columns that actually use auto-fit widths are eligible for this compensation (excluding row index columns, manually resized columns, and columns with a custom colCell.width). Therefore, scenarios involving custom column widths remain completely unaffected.

"Distribute the remainder pixels lost during floor() calculation to a specific column (typically the last one), ensuring that the total column width exactly matches the available width."

保持 round() 整数列宽,余数补给最后一个自适应列
只有实际使用自适应宽度的列才参与补偿(排除序号列、拖拽调整过的列、有自定义 colCell.width 的列),所以自定义列宽场景不受影响。
"将 floor() 丢失的余数像素分配到某一列(通常最后一列),确保总列宽恰好等于可用宽度"

🖼️ Screenshot

Before After
Image image

⚠️ Breaking Changes

  • Yes
  • No

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

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

This pull request simplifies the column width calculation in table-facet.ts by removing a redundant round() call on adaptiveColWidth, as it is already floored in getAdaptiveColWidth. There are no review comments to address, and the change looks correct.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Size Change: +157 B (+0.02%)

Total Size: 745 kB

📦 View Changed
Filename Size Change
packages/s2-core/dist/s2.min.js 312 kB +157 B (+0.05%)
ℹ️ View Unchanged
Filename Size
packages/s2-core/dist/s2-extends.min.js 209 kB
packages/s2-core/dist/s2.min.css 583 B
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 changed the title fix: 移除了 getColLeafNodesWidth 中对自适应列宽的 round() 调用 fix: 保持整数列宽,余数补给最后一个自适应列 Jun 2, 2026
@Alexzjt Alexzjt changed the title fix: 保持整数列宽,余数补给最后一个自适应列 fix: maintain integer column widths and allocate remainder to the last auto-fit column Jun 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

🎉 This PR is included in version @antv/s2-v2.7.2-alpha.1 🎉

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛明细表右侧存在多余的空白

1 participant