fix(layout): hug widgets no longer overflow their container cross axis (0.0.47)#49
Merged
Conversation
…s (0.0.47) A content-basis (hug) widget floored BOTH axes at the content extent, so a widget in a column got `min-width: max-content` — pinning it to its widest possible content and overflowing its container horizontally (the Network widget bulging past its column in studio, after 0.0.46 made the basis apply). Floor only the MAIN axis in a flex parent (min-width for a row, min-height for a col); the cross axis is already bounded by align-items:stretch. Grid parents keep the 2D floor (no single main axis, no regression report there). Verified live on the overlay + studio (overflowsParent:false, group width == container, vertical hug preserved) and with a new Chromium e2e that also proves the old both-axis behaviour overflowed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Problem
The 0.0.46 hug fix made a content-basis (hug) widget floor its size at the content extent so it couldn't be clipped — but it floored both axes. A widget in a column therefore got
min-width: max-content, pinning its width to the widest its content can be (e.g. the two un-wrapped network rate texts) — wider than its container. That's the Network widget overflowing horizontally in studio.Fix
In a flex parent, floor only the main axis (
min-widthfor a row,min-heightfor a column). The cross axis is already bounded by the parent'salign-items: stretch, so it stops bulging past the container. Grid parents keep the 2D floor (no single main axis, no overflow report there). Vertical content hug is preserved.Verification
Measured live via CDP on the real layout (DISPLAY3), both roles, on the fixed build:
min-width(cross)max-contentautomin-height(main)max-contentmax-contentoverflowsParentgroupHug.spec.ts) — asserts main-axis-only flooring stays bounded and that the old both-axis behaviour overflowed (guards a real regression).tsc+ lint clean.🤖 Generated with Claude Code