Skip to content

fix(layout): preserve 'content' (hug) basis on load — overlay no longer clips (0.0.46)#48

Merged
gyng merged 1 commit into
mainfrom
fix/parser-drops-content-basis
Jun 14, 2026
Merged

fix(layout): preserve 'content' (hug) basis on load — overlay no longer clips (0.0.46)#48
gyng merged 1 commit into
mainfrom
fix/parser-drops-content-basis

Conversation

@gyng

@gyng gyng commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Root cause (the real one)

isLength — the layout parser's length validator (migration.ts) — accepted number / 'auto' / { fr } but not 'content'. So parseLeaf / parseContainer silently 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-content floors 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: isLength now accepts 'content'.
  • migration.test.ts: parseLayoutNode preserves '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:

  • before: min-height: auto, group height 104px, rate row clipped
  • after: min-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

…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>
@gyng gyng merged commit 946f628 into main Jun 14, 2026
3 checks passed
@gyng gyng deleted the fix/parser-drops-content-basis branch June 14, 2026 23:26
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