Skip to content

Tiled layout: shrink neighbours to fit an app's minimum width, and say why a resize stops - #25

Merged
jsanzdev merged 2 commits into
mainfrom
tiled-min-width
Oct 19, 2026
Merged

jsanzdev merged 2 commits into
mainfrom
tiled-min-width

Conversation

@jsanzdev

Copy link
Copy Markdown
Contributor

Summary

  • Layout: in the Tiled layout, a tile whose window has a learned minimum width now gets its split ratio set so its neighbours shrink to make room, instead of overlapping them. Only the sizing split for that tile changes; other splits keep their ratios. The stored ratios are not rewritten: the fitted layout is derived from them each time.
  • Fallback: the old overlap is still used when the minimums can't all fit in the viewport, or when fitting would squeeze a neighbour below its own minimum or below 200 pt (a tile already narrower than that keeps its width).
  • Message: a resize (mouse, setColumnWidthFromResize) or a width cycle that would go below a window's minimum stops at the minimum and shows, through the existing workspace HUD, e.g. "Safari has a minimum width of 800 px, so Glide can't make it narrower." Mouse resizes show it once per drag (the existing debounced reassert). New string added to Sources/Glide/Localizable.xcstrings in all languages the app ships.

Branched from origin/main. Does not touch PR #24's focusTabOrTile, though both change Workspace.swift, so expect a small merge conflict there if #24 lands first.

Test plan

  • xcodebuild ... -scheme Glide ... test with TEST_HOST= BUNDLE_LOADER= (no app launch): 253 tests, 0 failures
  • New tests in TiledLayoutTests: neighbour shrinks with no overlap; overlap fallback when minimums can't fit; neighbour floor; second-part tile met through its earlier split; resize and width cycle stop at the minimum
  • LocalizationTests (every string in every language) pass
  • Manual check on a real app with a minimum width (not run here)

…y why a resize stops

A tile whose window has a learned minimum width now gets its split ratios
adjusted so the neighbours shrink, instead of the tile overlapping them.
The overlap stays as the fallback when the minimums can't all fit or a
neighbour would drop below a sensible size.

A resize or width cycle that would go below the minimum stops at it and
shows a short on-screen message naming the app and its minimum.
@jsanzdev
jsanzdev merged commit 462b302 into main Oct 19, 2026
2 checks passed
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