ReviewOS

craft-native/craft

Native space switcher: bottom-corner placement (flipped NSThemeFrame), and no single-space rule

#18
Closed glennmichael123 opened this 22 days ago · 0 comments
22 days ago

Found driving harness's desktop window. Two defects in src/components/native_space_switcher.zig, one visible symptom: a lone blue pill floating at the sidebar's bottom-left.

1. The control lands at the window bottom, not the titlebar. attach() computes y bottom-up (themeBounds.height - closeFrame.y - …), but NSThemeFrame — the view it attaches to — is a flipped view, so the segmented control ends up a titlebar's height above the window bottom instead of beside the traffic lights. The autoresizing mask compounds it: 4 is NSViewMaxXMargin (horizontal) despite its "min-Y margin flexible" comment.

2. One space renders as a lone pill. With a single space the control still shows — one selected segment naming the space the user is already in. The web rail hides its dots for exactly this case (showDots = spaces.length > 1 in SidebarSpaceSwitcher, with the Dia precedent cited); the native control never got the rule.

Fixes exist on the local branch perf/cold-start-experiments (commit be3fd20): ask the view isFlipped and branch the y math and the flexible margin on the answer; setHidden:(count < 2) in rebuildSegments — hidden rather than destroyed, so setSpaces growing to 2+ brings it back. Verified against a live window: pill gone with one space; with two, a segmented control beside the traffic lights.

Same branch also carries 74255c8: in web-sidebar-material mode the AppKit window title renders underneath the repositioned traffic lights (screenshot showed "harness" with the close button on its first letters) — fixed by hiding title visibility in that mode.

Happy to PR the branch — it also has the rebased activation/TLS fix and the Settings…/menu-name work.

Sign in to comment on this issue.