Skip to content

fix(layout): hug widgets no longer overflow their container cross axis (0.0.47)#49

Merged
gyng merged 1 commit into
mainfrom
fix/hug-cross-axis-overflow
Jun 15, 2026
Merged

fix(layout): hug widgets no longer overflow their container cross axis (0.0.47)#49
gyng merged 1 commit into
mainfrom
fix/hug-cross-axis-overflow

Conversation

@gyng

@gyng gyng commented Jun 14, 2026

Copy link
Copy Markdown
Owner

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-width for a row, min-height for a column). The cross axis is already bounded by the parent's align-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:

0.0.46 this PR
min-width (cross) max-content auto
min-height (main) max-content max-content
overflowsParent yes no
group width vs container wider equal (251.73==251.73 overlay; 59.51==59.51 studio)
  • New Chromium e2e (groupHug.spec.ts) — asserts main-axis-only flooring stays bounded and that the old both-axis behaviour overflowed (guards a real regression).
  • flowStyle units updated (main-axis-only row/col, 2D grid); full client suite + tsc + lint clean.

🤖 Generated with Claude Code

…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>
@gyng gyng merged commit af8a06a into main Jun 15, 2026
3 checks passed
@gyng gyng deleted the fix/hug-cross-axis-overflow branch June 15, 2026 00:02
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