Skip to content

fix: align frozen rows in short tables - #5254

Closed
biubiukam wants to merge 1 commit into
VisActor:developfrom
biubiukam:fix/issue-5253-frozen-row-layout
Closed

fix: align frozen rows in short tables#5254
biubiukam wants to merge 1 commit into
VisActor:developfrom
biubiukam:fix/issue-5253-frozen-row-layout

Conversation

@biubiukam

Copy link
Copy Markdown
Contributor

🤔 This is a ...

  • New feature
  • Bug fix
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Refactoring
  • Update dependency
  • Code style optimization
  • Test Case
  • Branch merge
  • Site / documentation update
  • Demo update
  • Workflow
  • Chore
  • Release
  • Other (about what?)

🔗 Related issue link

fix #5253

💡 Background and solution

When table content is shorter than the viewport, combining top and bottom frozen rows can inflate the scenegraph content height and place the bottom frozen row below the actual content.

The body scene container already includes the top frozen-row offset, but updateTableSize() added the top, body, and bottom scene-container heights again. This counted the top frozen area twice.

This change uses getAllRowsHeight() as the canonical content height, keeping the table group, bottom frozen rows, and scrollbar metrics aligned. A regression test covers six records with four top frozen rows and one bottom frozen row. Before the fix, the table group height was 400 instead of 280; after the fix, the table group height is 280 and the bottom frozen group ends at the same content boundary.

✅ Validation

  • Frozen-row Jest coverage: 4 suites and 19 tests passed.
  • ESLint: 0 errors; 59 existing warnings in scenegraph.ts.
  • Prettier check and git diff --check passed.
  • Rush recognized the new patch change record. Its verification command still reports the repository's existing upstream/main lookup warning.
  • npm run compile remains blocked by four pre-existing errors in src/state/checkbox/checkbox.ts (TS7006 and TS2339). This pull request does not modify that module.
  • The repository-wide pre-push suite is also blocked by existing failures involving the same checkbox type errors, local package resolution in vtable-sheet, existing formula assertions, the video-cell test environment, and an existing checkbox record-index assertion. The focused frozen-row suites above pass, and this pull request only changes the scenegraph height calculation, its regression test, and the Rush change record.

📝 Changelog

Language Changelog
🇺🇸 English Fix frozen-row layout when table content does not fill the viewport.
🇨🇳 Chinese 修复数据不足一屏时设置冻结行导致的布局错乱。

☑️ Self-Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

copilot:summary

🔍 Walkthrough

copilot:walkthrough

@fangsmile

Copy link
Copy Markdown
Contributor

#5255 已经解决。后续修复问题提pr, 请补充相关复现demo到项目examples中
image

@biubiukam

@fangsmile fangsmile closed this Jul 31, 2026
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.

[Bug] 数据不足一屏时,设置冻结行,表格样式错乱

2 participants