Skip to content

fix: recompute grid rows when the tab bar appears/disappears#1687

Open
cantona wants to merge 2 commits into
raphamorim:mainfrom
cantona:fix/tab-bar-grid-rows-recompute
Open

fix: recompute grid rows when the tab bar appears/disappears#1687
cantona wants to merge 2 commits into
raphamorim:mainfrom
cantona:fix/tab-bar-grid-rows-recompute

Conversation

@cantona

@cantona cantona commented Jun 25, 2026

Copy link
Copy Markdown

When hide_if_single is on, creating a second tab makes the tab bar appear, which grows scaled_margin.top to reserve its band. But update_dimensions re-laid out via apply_taffy_layout without refreshing Taffy's available height for the new margin — so the grid kept its previous (taller) row count and the bottom row was clipped off the bottom of the window. It only corrected itself after a window resize, because resize() calls try_update_size (which does push the new margin into Taffy).

Fix: update_dimensions now calls try_update_size(self.width, self.height) before apply_taffy_layout, so the available height accounts for the tab-bar band and the row count is recomputed. Also fixes the reverse transition (closing back to one tab).

Standalone, based on main.

cantona and others added 2 commits June 25, 2026 18:27
Creating a tab toggles hide_if_single, which grows scaled_margin.top to
make room for the tab bar. update_dimensions then re-laid out via
apply_taffy_layout, but never refreshed Taffy's available height for the
new margin -- so the grid kept its old (taller) row count and the bottom
row was clipped off the window until a window resize (which calls
try_update_size) corrected it. Refresh the Taffy size with the current
scaled_margin in update_dimensions before laying out.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant