fix(layout): preserve 'content' (hug) basis on load — overlay no longer clips (0.0.46)#48
Merged
Merged
Conversation
…er clips (0.0.46)
isLength (the layout parser's length validator) accepted number / 'auto' / { fr } but NOT
'content', so parseLeaf/parseContainer silently DROPPED a hug basis on every load. A hugged
widget/group looked right in the studio (set in memory) but clipped on the overlay, which
re-parses the layout from disk — the Network "hug clips" reports. The flowStyle content
floors (min/max-content) shipped earlier were correct but never ran on the overlay because
the basis was gone before they were reached.
- migration.ts: isLength now accepts 'content'.
- migration.test.ts: parseLayoutNode preserves 'content' on a primitive leaf, a GROUP leaf,
and a container.
Verified end-to-end: built the fixed exe and CDP-inspected the live DISPLAY3 overlay — the
Network group now renders min-height:max-content at 150px with its rate row inside the box
(was 104px, clipped). No re-hug needed; existing saved layouts fix on next load.
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.
Root cause (the real one)
isLength— the layout parser's length validator (migration.ts) — acceptednumber/'auto'/{ fr }but not'content'. SoparseLeaf/parseContainersilently dropped a hug (content) basis on every load.A hugged widget/group therefore looked right in the studio (basis set in memory) but clipped on the overlay, which re-parses the layout from disk and lost the basis → no content floor → clip. The flowStyle
min/max-contentfloors shipped in 0.0.43–0.0.45 were all correct, but never ran on the overlay because the basis was gone before they were reached.Fix
migration.ts:isLengthnow accepts'content'.migration.test.ts:parseLayoutNodepreserves'content'on a primitive leaf, a GROUP leaf, and a container.Verification (end-to-end, not a guess)
Traced via a live CDP inspection of the running DISPLAY3 overlay, then built the fixed exe and re-inspected the same group on the same saved layout:
min-height: auto, group height 104px, rate row clippedmin-height: max-content, group height 150px, rate row inside the box (not clipped)Plus: type-check, lint, migration tests (21, +3), full unit suite, build. No re-hug needed — existing saved layouts fix on next load.
🤖 Generated with Claude Code