Skip to content

gpui: Fill auto-sized window roots to the viewport - #60739

Merged
mikayla-maki merged 2 commits into
mainfrom
fable/gpui-root-size-full
Jul 11, 2026
Merged

gpui: Fill auto-sized window roots to the viewport#60739
mikayla-maki merged 2 commits into
mainfrom
fable/gpui-root-size-full

Conversation

@mikayla-maki

Copy link
Copy Markdown
Member

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

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.
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jul 10, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Jul 10, 2026
@mikayla-maki mikayla-maki self-assigned this Jul 10, 2026
@mikayla-maki
mikayla-maki marked this pull request as draft July 11, 2026 23:01
@mikayla-maki
mikayla-maki marked this pull request as ready for review July 11, 2026 23:02
@mikayla-maki
mikayla-maki added this pull request to the merge queue Jul 11, 2026
Merged via the queue into main with commit b0da438 Jul 11, 2026
34 checks passed
@mikayla-maki
mikayla-maki deleted the fable/gpui-root-size-full branch July 11, 2026 23:04
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants