Skip to content

Flexible frames: min/max/ideal, fill, and alignment#37

Merged
colemancda merged 8 commits into
masterfrom
feature/flexible-frame
Jul 23, 2026
Merged

Flexible frames: min/max/ideal, fill, and alignment#37
colemancda merged 8 commits into
masterfrom
feature/flexible-frame

Conversation

@colemancda

Copy link
Copy Markdown
Member

Closes the biggest day-to-day layout gap: .frame only supported fixed width/height.

What's new

  • Flexible .frameminWidth/idealWidth/maxWidth/minHeight/idealHeight/maxHeight plus alignment. maxWidth/maxHeight of .infinity fills the available space.
  • Fixed .frame now takes alignment: — positions the content within the frame.
  • Full Alignment preset set — added .leading/.trailing/.top/.bottom/.topTrailing/.bottomLeading (only .center/.topLeading/.bottomTrailing existed).

.infinity can't cross the bridge as a JSON number, so it's carried as a fillWidth/fillHeight flag; the interpreter maps to fillMaxWidth/fillMaxHeight, finite bounds to widthIn/heightIn, and alignment to wrapContentSize.

Verification

  • swift test — 4 new frame tests (default-alignment omission, fill flag, bounds), 61 passing
  • Emulator (new Frames screen): fill-width bar, fill + leading/trailing content alignment, a fixed 220×90 box with bottom-trailing content, and a bounded min 120/max 200 box whose text wraps at the cap — all render as SwiftUI would

Incidental

Adds a core-package .gitignore for stray swiftc build outputs (*.swiftmodule, *.dia, …) that had accumulated untracked in the package root.

Deferred

idealWidth/idealHeight are emitted but only inform bounds today (no ideal-size negotiation); per-axis alignment guides beyond the 9 presets.

@colemancda
colemancda merged commit 509221c into master Jul 23, 2026
6 checks passed
@colemancda
colemancda deleted the feature/flexible-frame branch July 23, 2026 18:06
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