* Fix minimal mode toggle not properly updating titlebar state
UpdateTitlebarAccessoryController only re-evaluated titlebar accessories
on window focus events (didBecomeKey/didBecomeMain), not when the
presentation mode actually changed. This caused:
1. Switching to minimal: accessories weren't immediately removed
2. Switching back to standard: accessories were never re-attached
(removeAccessoryIfPresent cleared attachedWindows, but no event
triggered re-attachment)
3. Repeated toggling left the window in inconsistent states
Add a UserDefaults observer that detects presentation mode changes and
re-evaluates all windows. When switching to minimal, accessories are
removed; when switching to standard, fresh accessories are created and
attached. Also handle the fullscreen edge case where re-attached
accessories must be hidden to avoid doubling with SwiftUI overlay
controls.
* Hide window toolbar in minimal mode to eliminate titlebar gap
The NSToolbar (attached by WindowToolbarController) creates a non-zero
titlebar area even in minimal mode, leaving an empty gap above the
Bonsplit tab bar. In minimal mode there's no need for the toolbar (it
shows a "Cmd:" text that's hidden anyway with titleVisibility=.hidden).
Hide the toolbar when switching to minimal mode and restore it when
switching back to standard. Also set initial visibility on attachment
based on the current mode.
* Apply ignoresSafeArea to contentAndSidebarLayout in minimal mode
The titlebar gap persisted because intermediate SwiftUI views still
respected the window's safe area even though MainWindowHostingView
zeroes safeAreaInsets. Apply .ignoresSafeArea(.container, edges: .top)
directly to the contentAndSidebarLayout when in minimal mode so the
entire content (sidebar + terminal) extends into the titlebar area.
* Remove toolbar entirely in minimal mode instead of just hiding
toolbar.isVisible=false still reserves titlebar space. Remove the
toolbar entirely (window.toolbar=nil) when switching to minimal mode
and re-attach it when switching back to standard. Skip toolbar
attachment entirely when launching in minimal mode.
* Add BonsplitTabDragUITests.swift to cmuxUITests target
The test file existed on disk but was missing from the Xcode project,
causing all BonsplitTabDrag UI tests (including minimal mode tests) to
silently report 0 tests on CI.
* Use negative titlebar padding in minimal mode to extend content into titlebar
The native titlebar area (28.5pt for traffic lights) persists even
without a toolbar and despite .ignoresSafeArea() modifiers. Use
negative padding (-titlebarPadding) in minimal mode to pull the
terminal content up into the titlebar area. The sidebar's internal
trafficLightPadding spacer keeps sidebar content properly offset
below the traffic lights.
* Add window drag handle to Bonsplit top strip in minimal mode
In minimal mode, the custom titlebar (which provides the window drag
handle) is hidden. Add a WindowDragHandleView to the top strip overlay
so users can drag-to-move the window from the Bonsplit tab bar area.
The TitlebarDoubleClickMonitorView is kept as a background for
double-click-to-zoom.
* Use native titlebar drag in minimal mode instead of WindowDragHandleView
WindowDragHandleView defers to interactive siblings (Bonsplit tab bar),
so it never captures hits. Instead, set window.isMovable=true in
minimal mode so the native titlebar area handles drag-to-move and
double-click-to-zoom. Remove the non-functional overlay from
WorkspaceContentView.
* Enable isMovableByWindowBackground in minimal mode for window dragging
window.isMovable alone doesn't work because the Bonsplit tab bar
captures all hits before the native titlebar drag engages. Use
isMovableByWindowBackground=true so any area that doesn't handle
mouse events becomes a drag handle. Also capture
workspacePresentationMode in the WindowAccessor closure so the
window properties update when toggling modes.
* Add debug logging for minimal mode window drag diagnosis
* Intercept double-click in minimal mode tab bar to zoom instead of new tab
Bonsplit's EmptyTabBarDoubleClickMonitorView creates a new tab on
double-click in the tab bar empty space. In minimal mode, intercept
these double-clicks with a higher-priority local event monitor and
perform the standard macOS titlebar action (zoom/minimize based on
System Settings) instead. Only intercepts in the top 30pt strip and
only when minimal mode is active.
* Fix double-click monitor ordering and coordinate calculation
NSEvent local monitors are called LIFO (last installed first). Install
the minimal-mode double-click interceptor with a 0.5s delay so it's
added after Bonsplit's EmptyTabBarDoubleClickMonitorView monitors,
ensuring it runs first and can consume the event. Also fix the
distance-from-top calculation to use window frame height instead of
contentLayoutRect height, since the tab bar is in the titlebar area.
* Remove unnecessary delay from double-click monitor installation
* Show split buttons on hover only in minimal mode, fix sidebar controls re-attachment
Two fixes:
1. Add splitButtonsOnHover to BonsplitConfiguration.Appearance. In
minimal mode, the Bonsplit split buttons (terminal, browser, split
right/down) fade in only when hovering the tab bar. Revert to
always-visible when switching back to standard mode.
2. Delay titlebar accessory re-attachment when switching to standard
mode so the toolbar is re-added first. Without this, the accessory
attaches before the toolbar exists, causing the sidebar controls
to not appear in the titlebar.
* Fix splitButtonsOnHover via onChange instead of body eval, add debug logs
* Update bonsplit submodule for splitButtonsOnHover
* Remove debug logs, verified splitButtonsOnHover and accessory re-attachment on macmini
* Read presentationMode directly in TabBarView via @AppStorage
The @Observable configuration propagation wasn't reliably triggering
re-renders in TabBarView. Read the workspacePresentationMode directly
via @AppStorage in TabBarView instead, which SwiftUI reactively
updates when UserDefaults changes. Remove the syncSplitButtonsOnHover
workaround from WorkspaceContentView.
* Fix tab drag, double-click zone, and sidebar controls re-attachment
- Revert isMovableByWindowBackground to false; it breaks Bonsplit tab
reordering. Keep isMovable=true in minimal mode so the sidebar area
(which has WindowDragHandleView) is draggable.
- Increase double-click intercept zone from 30pt to 40pt to cover the
full tab bar height (33pt).
- Use asyncAfter(0.1s) for titlebar accessory re-attachment when
switching to standard mode, giving the toolbar time to re-attach.
* Add debug logging for titlebar accessory re-attachment diagnosis
* Fix crash and sidebar controls re-attachment
Remove debug logging that crashed when accessing window properties
during iteration. Increase deferred re-attachment delay to 0.3s to
give the WindowAccessor callback time to set the window identifier
and toolbar before attachIfNeeded checks isMainTerminalWindow.
* Keep titlebar accessories attached in minimal mode instead of removing
The remove/re-add cycle was fragile: re-attachment depended on window
identifiers being set, toolbar being re-added, and timing delays.
Instead, keep TitlebarControlsAccessoryViewController always attached
and let its own UserDefaults observer handle visibility. It already
hides itself (view.isHidden=true, preferredContentSize=.zero) in
minimal mode and shows itself in standard mode. No timing hacks needed.
* Force titlebar accessory layout after toolbar re-addition
* Use both self.isHidden and view.alphaValue/isHidden for accessory visibility
self.isHidden alone doesn't reliably hide the accessory when the
toolbar is nil on macOS 26. Add view.alphaValue=0 and view.isHidden
as visual fallbacks. Crucially, don't zero preferredContentSize or
frames so fittingSize returns valid values when switching back.
* Set window.isMovable=false always to fix sidebar button clicks
window.isMovable=true in minimal mode blocks clicks on the sidebar
controls because the native titlebar drag intercepts mouse events in
the overlapping area. The sidebar's WindowDragHandleView already
handles drag-to-move via performDrag with withTemporaryWindowMovableEnabled,
so native isMovable isn't needed.
* Add drag-to-move from empty bonsplit tab bar space in minimal mode
* Use overlay for tab bar drag, smart hitTest passes through tabs/buttons
* Add double-click zoom/minimize to tab bar drag view
* Add leading padding for traffic lights when sidebar collapsed in minimal mode
* Add traffic light inset to tab bar when sidebar collapsed in minimal mode
* Fix accessory space and double-click in minimal mode
- Zero preferredContentSize in minimal mode (so accessory takes no
space) but seed hostingView with cached size before querying
fittingSize when switching back (so size can be restored).
- Skip EmptyTabBarDoubleClickMonitorView in minimal mode so
DraggableTabBarView handles double-click for zoom instead.
- Remove redundant ContentView double-click monitor.
* Auto-detect traffic light inset in TabBarView via GeometryReader
Instead of propagating sidebar state through config, the tab bar
detects its own position relative to the window. If in minimal mode
and the tab bar's leading edge is near the window edge (< 20pt, no
sidebar), add 72pt spacer for traffic light clearance.
* Increase traffic light spacer to 80pt
* Fix tab click passthrough in minimal mode drag overlay
* Check full window for interactive hits in drag overlay
* Fix drag overlay capturing all clicks via reentrancy guard in hitTest
* Distinguish interactive controls from hosting views in drag hitTest
* Walk ancestor chain for button detection in drag overlay hitTest
* Replace overlay with background drag view per ensemble recommendation
* Only add traffic light inset for top-left pane
* Use GeometryReader for traffic light inset, check screen position
* Fix operator precedence in traffic light inset check
* Use window frame for traffic light inset detection
* Set tabBarLeadingInset from ContentView via onChange handlers
Replace unreliable coordinate-based detection with direct state from
ContentView, which knows both sidebar visibility and minimal mode.
Syncs on appear, sidebar toggle, and mode toggle.
* Use allPaneIds.first for top-left pane detection, no hierarchy threading needed
* Update bonsplit submodule to merged main
---------
Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>