Skip to content

Wait for animation frame before measuring Tabulator page size - #8390

Merged
philippjfr merged 3 commits into
mainfrom
tabulator_page_size_fix
Jan 26, 2026
Merged

Wait for animation frame before measuring Tabulator page size#8390
philippjfr merged 3 commits into
mainfrom
tabulator_page_size_fix

Conversation

@philippjfr

Copy link
Copy Markdown
Member

In some setups the Tabulator page size calculation doesn't perform well and you end up with an incorrectly measured page size. This aims to improve that by delaying the measurement of the row height until after an animation frame.

Copilot AI review requested due to automatic review settings January 26, 2026 12:42

Copilot AI 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.

Pull request overview

This PR addresses an issue where Tabulator's page size calculation performs incorrectly in certain setups, resulting in an improperly measured page size. The fix delays the measurement of row height until after an animation frame by wrapping the recompute_page_size() call with requestAnimationFrame.

Changes:

  • Modified _resize_redraw() method to delay page size calculation until after an animation frame
  • Added semicolon to restore_scroll() call for consistency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread panel/models/tabulator.ts
this.restore_scroll()
this.recompute_page_size()
this.restore_scroll();
(window as any).requestAnimationFrame(() => this.recompute_page_size())

Copilot AI Jan 26, 2026

Copy link

Choose a reason for hiding this comment

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

The cast (window as any) is unnecessary here. Other files in the codebase (such as panel/models/column.ts, panel/models/feed.ts, panel/models/layout.ts, and panel/models/modal.ts) use requestAnimationFrame directly without this cast. For consistency with the rest of the codebase, you should call requestAnimationFrame(() => this.recompute_page_size()) directly.

Copilot uses AI. Check for mistakes.
@codecov

codecov Bot commented Jan 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.09%. Comparing base (7668ce8) to head (bcec462).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8390      +/-   ##
==========================================
- Coverage   86.10%   86.09%   -0.02%     
==========================================
  Files         349      349              
  Lines       54845    54845              
==========================================
- Hits        47227    47219       -8     
- Misses       7618     7626       +8     

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

@philippjfr
philippjfr merged commit c77e716 into main Jan 26, 2026
18 of 20 checks passed
@philippjfr
philippjfr deleted the tabulator_page_size_fix branch January 26, 2026 13:02
@philippjfr philippjfr mentioned this pull request Jan 26, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants