Repository navigation
Conversation
Taffy computes one tree at a time. The measure closure of `Window::request_measured_layout` runs inside that computation, so an element cannot lay a child out there, and `Window::layout_engine` is `None` for the duration anyway. An element that wants to size itself from content it has to measure has no way to do it. `IsolatedLayout` holds a second tree for that content. `enter` puts it in front of the window's tree for the duration of a closure and gives the window its own tree back afterwards. GPUIX needs this for a panel whose height animates to the height of its content. The width is what the parent gives it, which taffy hands to the measure closure, and the content has to be measured at that width for text to wrap the way it will on screen. Sent upstream as the same change on gpui/isolated-layout.
This was referenced Sep 4, 2026
Author
|
Reopened. This PR stays the path for the GPUIX submodule: AGENTS.md in remorses/gpuix asks for GPUI changes as commits on this branch before the submodule points at them. The same stack, rebased onto zed-industries main, is open as zed-industries#63771. |
5 tasks done
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.
What this adds
IsolatedLayout: a second taffy tree that an element can enter while the window's tree computes.Window::request_measured_layoutcan lay out and measure a child.GPUIX needs this for a panel whose height animates to the height of its content. Taffy hands the parent's width to the measure closure. The content must be measured at that width so text wraps the way it will on screen.
What I ran and saw
cargo check -p gpui -p gpui_applepasses on this branch.cargo test -p gpuipasses (269 tests plus 1 doc test).What I did not verify
Moved from the fork
The same stack, rebased onto zed-industries main, is open upstream as zed-industries#63771. This PR is the path for the GPUIX submodule, which follows the
gpuixbranch of this repo.This PR was mateo-m/zed#4. The branch merged
gpuixat 8802c83 before the move, with no conflicts.cargo check -p gpui -p gpui_wgpupasses on the merged head.Bottom of a stack. The corner shapes PR and the effect layers PR build on this branch.