cmux-next: the background aspect-fills the window, centered, with no framing logic

Merged
TE
17d ago
+71-810

Leo: the background should stay full size and resize with the window sensibly, with no odd crop or offset logic and no jumps while resizing.

The odd logic was BackdropArtMetadata.placement (BackdropArtPlacement.swift). For every window size, the art layer worked out its own frame and crop:

  • It zoomed up to 1.4x to keep a painting's subject box in view.
  • When zooming couldn't, it shrank the art to 0.7x over a blurred copy of itself (artFillView).
  • It shifted the art whenever the sidebar or a docked agent chat came, went or resized. Both reported their columns to the art through setCover.

So the same window showed a different crop and offset for each work and layout, and the picture moved on a spring as columns changed.

Now WindowMaterialView's art view autoresizes with the window. Its layer aspect-fills (resizeAspectFill), centered and masked, the way the video wallpaper already did. Every image, whether bundled art, your own or a macOS wallpaper, follows that one rule. Nothing is computed per size.

Removed:

  • the placement and visible-span math
  • the blurred fill
  • the sidebar and agent-chat cover reports (LayoutRootView+BackdropCover.swift, SidebarContainerView.reportBackdropCover)
  • the framing_sheet.py audit script that mirrored the placement
  • the three test files for those

The subject boxes stay in the catalog as data (BackdropSubjectBox.swift).

Tests

  • Committed first (299a1abc8bfd): ResizeInvariantTests.theArtFillsTheWindowCenteredAtEverySize. Across six window sizes and every bundled work, it checks that the art view's frame is the backdrop's bounds, that its gravity is resizeAspectFill and that its contentsRect is the whole image. Red on the base, from reading the code: the gravity there is .resize, with a computed frame and crop.
  • This host is Linux with no Swift toolchain, so nothing compiled or ran here. CI's CmuxNextAppTests will be the first run.
  • python3 scripts/verify-local.py --affected origin/feat-cmux-next: everything passes except localization and package-groups, which fail the same way on the base.

Changelog

  • Fixed: cmux NEXT's background fills the window like a macOS wallpaper (aspect-fill, centered) and no longer shifts or jumps while you resize or open the sidebar or agent chat.

๐Ÿค– Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

The background art now fills the window like a macOS wallpaper โ€” aspect-filled, centered, and autoresizing โ€” instead of computing a frame and crop for each window size. Every image, whether bundled art, your own, or a macOS wallpaper, follows that one rule, so nothing shifts or jumps while resizing or opening the sidebar or a docked agent chat.

Previously, each image was placed per size: zooming up to 1.4x to keep a painting's subject in view, shrinking to 0.7x over a blurred copy when it couldn't, and shifting whenever the sidebar or a docked agent chat came, went, or resized. That caused different crops and offsets per layout.

  • Removed the placement and visible-span math, the blurred fill, and the sidebar/agent-chat cover reporting.
  • Removed the framing_sheet.py audit script and the tests covering the old behavior; the subject boxes stay in the catalog as data.
  • Autofixes restore two defaults in schemas/defaults/cmux-next.json and refresh ci-target-graph.json.

Tests
A new ResizeInvariantTests case checks across six window sizes and every bundled work that the art view's frame equals the backdrop's bounds, its gravity is resizeAspectFill, its contentsRect is the whole image, and an image is shown. This host has no Swift toolchain, so CI's CmuxNextAppTests will be the first run.