gpui: Fill auto-sized window roots to the viewport - #60739
Merged
Conversation
Window roots with an auto size now stretch to fill the window, the way the root element on the web fills the initial containing block. Explicitly styled root dimensions are preserved, and tooltips, drags, and deferred draws keep their shrink-wrap semantics.
Anthony-Eid
approved these changes
Jul 10, 2026
mikayla-maki
marked this pull request as draft
July 11, 2026 23:01
mikayla-maki
marked this pull request as ready for review
July 11, 2026 23:02
This was referenced Jul 31, 2026
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
) Window roots whose size is `auto` now stretch to fill the window, the way the root element on the web fills the initial containing block. Previously a window root with no explicit size shrink-wrapped its content (flex/grid roots collapsed to content size in both axes), which is why every root view needed `size_full()`. Mechanically: `draw_roots` requests layout for the window root (and prompt roots), then `TaffyLayoutEngine::stretch_auto_size_to_fill` rewrites any `auto` dimension on the root node to the viewport size before layout runs. Explicitly styled root dimensions are preserved, and tooltips, drags, and anchored/deferred draws keep their shrink-wrap semantics. Includes regression tests covering both the auto-fill and explicit-size cases (the auto case collapses to 0×0 without the fix). Release Notes: - N/A --------- Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
playdohface
pushed a commit
to playdohface/zed
that referenced
this pull request
Aug 29, 2026
) Window roots whose size is `auto` now stretch to fill the window, the way the root element on the web fills the initial containing block. Previously a window root with no explicit size shrink-wrapped its content (flex/grid roots collapsed to content size in both axes), which is why every root view needed `size_full()`. Mechanically: `draw_roots` requests layout for the window root (and prompt roots), then `TaffyLayoutEngine::stretch_auto_size_to_fill` rewrites any `auto` dimension on the root node to the viewport size before layout runs. Explicitly styled root dimensions are preserved, and tooltips, drags, and anchored/deferred draws keep their shrink-wrap semantics. Includes regression tests covering both the auto-fill and explicit-size cases (the auto case collapses to 0×0 without the fix). Release Notes: - N/A --------- Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Window roots whose size is
autonow stretch to fill the window, the way the root element on the web fills the initial containing block. Previously a window root with no explicit size shrink-wrapped its content (flex/grid roots collapsed to content size in both axes), which is why every root view neededsize_full().Mechanically:
draw_rootsrequests layout for the window root (and prompt roots), thenTaffyLayoutEngine::stretch_auto_size_to_fillrewrites anyautodimension on the root node to the viewport size before layout runs. Explicitly styled root dimensions are preserved, and tooltips, drags, and anchored/deferred draws keep their shrink-wrap semantics.Includes regression tests covering both the auto-fill and explicit-size cases (the auto case collapses to 0×0 without the fix).
Release Notes: