Commit graph

70 commits

Author SHA1 Message Date
Austin Wang
6a39bac0e1
Fix update error details dialog overflow (#2359) 2026-03-30 03:05:48 -07:00
Lawrence Chen
c51f0f15c4
Fix minimal mode toggle not updating titlebar state (#2218)
* 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>
2026-03-27 20:25:51 -07:00
Lawrence Chen
b42f64fbe3
Fix update attempt refreshing pill without actually updating (#2168)
* Fix update attempt refreshing pill without actually updating

The attemptUpdate() subscriber watched for .updateAvailable state to
auto-confirm, but showUpdateFound used setStateAfterMinimumCheckDelay
which delays the transition by up to 2 seconds. During that window,
dismissUpdateInstallation (from a background probe race) could cancel
the pending transition, reverting state to idle without ever confirming.
The subscriber then tore down on the transient idle, silently abandoning
the update.

Fix: move auto-confirm to the Sparkle driver level via an
autoInstallOnNextUpdate flag. When set, showUpdateFound immediately
calls reply(.install) bypassing the delay entirely. The subscriber
is kept as a fallback but no longer tears down on transient idle
while the flag is active.

Closes https://github.com/manaflow-ai/cmux/issues/2166

* Revert "Fix update attempt refreshing pill without actually updating"

This reverts commit 1cd842dd924bf114b096f222851c47d2e36ad4d9.

* Fix update attempt refreshing pill without actually updating

The attemptUpdate() subscriber tore down monitoring whenever it saw
.idle after observing progress. During check startup (retry loop,
background probe race), state can transiently return to .idle before
Sparkle's interactive check begins. The subscriber interpreted this
as "check completed" and stopped monitoring, so the auto-confirm
for .updateAvailable never fired.

Fix: add !state.isIdle to the teardown guard so monitoring only
stops on terminal failures (.notFound, .error), not transient idle.

Closes https://github.com/manaflow-ai/cmux/issues/2166

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-25 16:55:29 -07:00
Austin Wang
99ca3c9b9a
Fix sidebar update pill cached popover flow (#2142)
* test: cover cached update pill first-click flow

* fix: use cached sidebar update popover
2026-03-25 04:21:03 -07:00
Austin Wang
ffb660dee8
Fix first click on detected update pill (#2117) 2026-03-25 00:51:34 -07:00
Austin Wang
56602066a1
Revert Sparkle manual update dialog flow from #1908 (#2090)
* Restore inline sidebar update checks and embed appcast changelog

* Revert Sparkle manual update dialog flow
2026-03-24 20:44:54 -07:00
austinpower1258
44b4374f2a fix: harden Sparkle manual update dialog flow 2026-03-21 15:19:31 -07:00
austinpower1258
72f2e3b89d fix: show Sparkle dialog on first manual update check 2026-03-20 23:06:46 -07:00
pstanton237
0fa7160de8
fix: align titlebar icons with traffic-light buttons (#1754)
The titlebar control icons (sidebar, notifications, new tab) were
vertically misaligned — centered within the full titlebar+tab-bar
area instead of the titlebar alone.

Use the close button's superview height as the true titlebar height
so the icons sit at the same vertical center as the traffic lights,
matching the behavior of apps like Slack.
2026-03-20 01:57:35 -07:00
Austin Wang
e203c51c7a
Show update-available banner automatically on launch (#1651)
* Show update-available banner automatically on launch

Probe for updates immediately on launch via Sparkle's
checkForUpdateInformation() so the sidebar surfaces a passive update
indicator without waiting for the 24h scheduler. When Sparkle detects
an available update in the background, the pill now shows
"Update Available: X.Y.Z" with accent styling while the updater is
idle. Clicking it triggers the full interactive update flow.

Also fixes thread safety in delegate callbacks by dispatching
@Published mutations to the main queue.

Closes #1643

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add periodic background update probe every 15 minutes

The launch-only probe wouldn't catch updates published while the app
is already running. Add a repeating 15-minute timer that calls
checkForUpdateInformation() so the sidebar banner appears within a
reasonable window after a new version is published.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Change background update probe interval to 30 minutes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Change update check interval to 1 hour and migrate existing users

Reduce Sparkle's scheduled check interval from 24h to 1h so update
banners appear sooner. Migrate users stuck on the old 24h default by
bumping the migration key to v2. Align background probe interval with
the Sparkle check interval instead of hardcoding 30 minutes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 12:30:44 -07:00
Lawrence Chen
90e573b68f
Merge origin/main into feat-hidden-titlebar-minimalism-reset 2026-03-17 17:37:28 -07:00
Austin Wang
e15825826f
fix: restore Sparkle automatic update checks (#1597) 2026-03-17 03:07:38 -07:00
Lawrence Chen
b8a87d8914
Gate workspace chrome from minimal mode 2026-03-16 23:15:22 -07:00
Austin Wang
971b2b4e77
fix: show sidebar update banner from background checks (#1543) 2026-03-16 20:40:35 -07:00
Lawrence Chen
f633ddbfe2
Apply Fade Buttons to minimal-mode sidebar controls 2026-03-15 22:50:59 -07:00
Lawrence Chen
2611a32ef7
Keep minimal-mode sidebar buttons always visible 2026-03-15 22:44:47 -07:00
Lawrence Chen
5da7da127a
Narrow shortcut settings notifications 2026-03-15 22:09:37 -07:00
Lawrence Chen
70ec1a0915
Split fade buttons from titlebar visibility 2026-03-15 21:31:41 -07:00
Lawrence Chen
d67237b891
Fix hidden titlebar underlap and settings focus 2026-03-15 18:03:38 -07:00
Lawrence Chen
e4ef98aca1
Implement hidden-titlebar minimalism mode 2026-03-15 16:43:26 -07:00
Lawrence Chen
459a0289c1
Fix titlebar shortcut hint clipping (#1259)
* Add regression test for titlebar shortcut hint clipping

* Fix titlebar shortcut hint clipping
2026-03-12 03:27:10 -07:00
Lawrence Chen
527dfa6292
Add Jump to Latest to the notifications popover (#1167)
* Add jump-to-latest button to notifications popover

* Fix jump-to-latest popover accessibility

* Relax shortcut badge UI test expectation

* Stabilize jump-to-latest UI coverage

* Keep popover notification actions visible when empty

* Inline jump-to-latest shortcut label

* Match jump-to-latest shortcut label styling
2026-03-10 19:30:17 -07:00
austinpower1258
9e8a401e3c Fix tooltip tracking lifetime and shortcut lag 2026-03-07 01:46:02 -08:00
Lawrence Chen
a6329d79ad
Fix titlebar controls clipped at bottom edge (#1016)
The NSTitlebarAccessoryViewController constrains the accessory view
height to the titlebar, which can be slightly shorter than the button
frames (especially with softButtons style). Disable masksToBounds on
the container view so the rounded-rectangle button backgrounds render
fully instead of being cut off at the bottom.
2026-03-06 15:36:51 -08:00
Lawrence Chen
6347571b7c
Fix Dvorak Cmd+C colliding with notifications shortcut (#762)
* Fix layout-safe command shortcut matching

* Fix unshifted symbol shortcut coercion

* Fix layout handling for hardcoded Cmd shortcuts

* Support Cmd/Ctrl modifier hold shortcut hints

* Address PR shortcut review feedback

* Handle Caps Lock in command shortcut matching

* Address remaining PR shortcut review comments

* Handle Cmd+Ctrl+F control-character fallback

* Tighten shortcut hint hold-delay test

* Expose shortcut hint visibility in settings

* Restore Cmd+digit fallback on symbol-first layouts

* Stabilize shortcut regression coverage

* Align shortcut hint toggle with Cmd/Ctrl behavior

* Restore Claude workflow file

* Match Claude workflow file to main

* Keep shortcut hint hold behavior command-only

* Restore command shortcut fallback when layout data is unavailable

* Preserve command-aware shortcut translation
2026-03-05 18:32:42 -08:00
atani
2c330efb8a
feat: add Japanese localization with String Catalog (#819)
* Add i18n infrastructure with String Catalog and Japanese translations

Introduce String Catalog (.xcstrings) for localization support:
- Localizable.xcstrings: 195 UI string entries with en and ja translations
- InfoPlist.xcstrings: Info.plist strings (microphone usage, Finder menu items)
- project.pbxproj: add xcstrings to build phase and ja to knownRegions

* Replace hardcoded UI strings with String(localized:defaultValue:)

Migrate all user-facing strings across 11 source files to use
String(localized:defaultValue:) API (macOS 13+). Each string references
a key in Localizable.xcstrings, with the English text preserved as
defaultValue for fallback.

Files modified:
- KeyboardShortcutSettings: 28 shortcut labels
- SocketControlSettings: mode names and descriptions
- TabManager: placement labels, color names, close dialogs
- BrowserPanel/BrowserPanelView: error pages, context menus, tooltips
- UpdateViewModel/UpdatePopoverView/UpdatePill: update UI states
- NotificationsPage: notification panel labels
- SurfaceSearchOverlay: search bar placeholder and tooltips
- AppDelegate: menus, dialogs, command palette items

* Fix localization gaps from review feedback

Address review comments from CodeRabbit, Greptile, and Cubic Dev AI:
- Use interpolated String(localized:) instead of concatenation for
  version/progress strings in UpdateViewModel
- Localize remaining hardcoded strings in AppDelegate: window labels,
  rename dialog, status menu items, unread notification count
- Localize insecure HTTP alert body in BrowserPanel
- Add 12 new entries to Localizable.xcstrings with Japanese translations

* Fix String(localized:defaultValue:) keys to use StaticString

The localized: parameter requires StaticString when defaultValue: is
used. Move string interpolation from the key to defaultValue only,
and revert maxWidthText to plain strings since they are only used for
layout width calculation.

* Localize remaining UI strings across all source files

Add String(localized:defaultValue:) to all user-facing strings in:
- cmuxApp.swift: settings screen, menus, about panel, dialogs (~180 strings)
- ContentView.swift: command palette, sidebar context menu, dialogs (~200 strings)
- Workspace.swift: rename/move/close tab dialogs, tooltips (~20 strings)
- UpdateTitlebarAccessory.swift: titlebar tooltips, notifications popover (~10 strings)
- TerminalNotificationStore.swift: notification permission dialog (4 strings)
- CmuxWebView.swift: browser context menu items (2 strings)
- AppDelegate.swift: CLI install/uninstall alerts (6 strings)

Add 418 new entries to Localizable.xcstrings with Japanese translations.
Extract sidebar context menu into separate @ViewBuilder to fix Swift
type-checker timeout in large body.
Fix xcstrings format specifiers for interpolated strings (%lld, %@).

Total: 624 localization entries covering the full UI.

* Address review feedback: fix missing localizations and terminology

- Localize javaScriptDialogTitle URL branch in BrowserPanel
- Localize cantReach error message in BrowserPanel
- Localize close other tabs dialog message in TabManager
- Localize workspace accessibility label in ContentView
- Fix unread notification singular/plural (split into two keys)
- Fix insecure connection apostrophe inconsistency (unify to U+2019)
- Rename socketControl.fullOpen.description to socketControl.allowAll.description
- Remove dead code: renameTargetNoun function
- Fix terminology inconsistencies in xcstrings:
  - Unify "Developer Tools" to デベロッパツール
  - Unify "Jump to Latest Unread" phrasing
  - Unify "Flash Focused Panel" terminology
  - Fix dialog.enableNotifications.notNow translation

* fix: address remaining PR 819 review feedback

* fix: use a single localized key for close-other-tabs

* fix: avoid inflection markup in close-other-tabs message

* Address review feedback: localize tooltip, fix subtitle concat, unify keys

- Localize menubar tooltip unread count (hardcoded English -> localized)
- Replace subtitle string concatenation anti-pattern with single localized
  keys containing interpolation placeholders
- Unify workspace fallback key to workspace.displayName.fallback
- Remove unused workspace.defaultName key from xcstrings
- Add Japanese translations for new tooltip and subtitle keys
2026-03-04 14:58:28 -08:00
Lawrence Chen
b1846aaec4
Fix notification bell hover crash by conditionally tracking hover (#574)
Only enable .onHover tracking on TitlebarControlButton when the style
uses hoverBackground (e.g. pillGroup). Styles without a visible hover
background no longer install the tracking area, preventing the crash
on notification-bell hover.

Also switches the notifications anchor from .overlay to .background so
AppKit hit-testing no longer conflicts with the popover anchor view.

Includes regression test for the hover-tracking policy.

Fixes https://github.com/manaflow-ai/cmux/issues/537
2026-02-26 14:26:28 -08:00
Lawrence Chen
47056f4074 Throttle titlebar accessory sizing churn
Fixes CMUXTERM-MACOS-F1
2026-02-25 16:47:38 -08:00
Lawrence Chen
e8477131c1 Merge origin/main into issue-143-session-persistence 2026-02-24 14:41:27 -08:00
Lawrence Chen
aeda5f827d Adopt custom blue accent across active UI states 2026-02-24 14:22:58 -08:00
Lawrence Chen
6eeca9c5da Merge remote-tracking branch 'origin/main' into pr-317-session-persistence
# Conflicts:
#	Sources/AppDelegate.swift
#	Sources/cmuxApp.swift
2026-02-23 14:58:16 -08:00
Lawrence Chen
82d2d0e474 Add command palette apply and attempt update actions 2026-02-23 04:53:25 -08:00
Lawrence Chen
927b0eb2d1 Implement session persistence pass 1 with multi-window restore 2026-02-22 15:39:59 -08:00
Lawrence Chen
699e708601 Scope command shortcut hints to active window 2026-02-20 18:48:29 -08:00
Lawrence Chen
1650ba372f
Fix sidebar workspace staying dim after external drop (#207)
* Fix stuck sidebar dim state after external drop

* Debug sidebar drag outside-drop flow with content overlay

* Handle sidebar drag endings outside window

* Fix stale update feed resolver tests
2026-02-20 14:53:57 -08:00
Lawrence Chen
707be44aaf
Separate cmux NIGHTLY as standalone app with its own bundle ID (#164)
The nightly build is now a distinct app called "cmux NIGHTLY" with
bundle ID com.cmuxterm.app.nightly, allowing side-by-side installation
with the stable release. The nightly appcast URL is baked into the
app's Info.plist by CI, so no in-app channel switching is needed.

- Nightly workflow: rename app to "cmux NIGHTLY", set bundle ID to
  com.cmuxterm.app.nightly, hardcode nightly Sparkle feed URL, publish
  DMG as cmux-nightly-macos.dmg
- Remove "Receive Nightly Builds" toggle from settings
- Remove UpdateChannelSettings enum and simplify feed URL resolution
  to just use SUFeedURL from Info.plist
- Remove UpdateChannelSettingsTests (no longer applicable)
2026-02-20 03:54:07 -08:00
Lawrence Chen
9af7df0dac Fix socket accept loop not restarted after Sparkle update relaunch
After a Sparkle auto-update relaunches cmux, the control socket stops
accepting connections because start() early-returns when isRunning is
true, without checking if the accept loop thread is actually alive.

- Add acceptLoopAlive flag to track accept loop thread liveness
- Fix start() early-return to also check acceptLoopAlive, so a dead
  thread triggers full socket re-creation
- Break acceptLoop() after 50 consecutive accept() failures with 10ms
  backoff instead of tight-spinning forever
- Clean up socket in applicationWillTerminate and
  updaterWillRelaunchApplication for clean teardown before relaunch
2026-02-17 22:00:47 -08:00
Lawrence Chen
f0e4ccdc1d
Show sidebar/notification/new-tab controls in fullscreen without hovering titlebar (#55)
In fullscreen mode, the NSTitlebarAccessoryViewController buttons are hidden
with the system titlebar. This adds SwiftUI-based fullscreen controls that
appear in the sidebar area (when visible) or inline in the custom titlebar
(when sidebar is hidden), reusing the existing TitlebarControlsView component.

- Track fullscreen state via window notifications and toggle controls visibility
- Hide original titlebar accessory (isHidden + alphaValue=0) in fullscreen
- Route notification popover anchoring through fullscreen controls view model
  so both button clicks and keyboard shortcuts (Cmd+Shift+I) position correctly
- Add debug titlebar spacing slider for fine-tuning leading inset
2026-02-17 20:24:01 -08:00
Lawrence Chen
484b66c8ac
Fix terminal keys swallowed after opening browser (#45)
* Fix terminal keys (arrows, Ctrl+N/P) swallowed after opening browser

After a browser panel is shown, SwiftUI's internal focus system activates
and its _NSHostingView starts consuming arrow keys and other non-Command
key events via performKeyEquivalent, preventing them from reaching the
terminal's keyDown handler.

Fix: In the NSWindow performKeyEquivalent swizzle, when GhosttyNSView is
the first responder and the event has no Command modifier, route directly
to the terminal's performKeyEquivalent — bypassing SwiftUI's view hierarchy
walk entirely.

Also clear stale browserAddressBarFocusedPanelId when a terminal surface
has focus, preventing Cmd+N from being eaten by omnibar selection logic
after focus transitions away from a browser.

Adds DEBUG-only keyboard event ring buffer (KeyDebugLog) that dumps to
/tmp/cmux-key-debug.log for diagnosing future key routing issues.

* Fix split focus and Cmd+Shift+N swallowed after opening browser

Split focus: capture the source terminal's hostedView before bonsplit
mutates focusedPaneId, so focusPanel moves focus FROM the old pane
instead of from the new pane to itself. Also retry ensureFocus when the
new terminal's view has no window yet (matching the existing retry
pattern for isVisibleInUI).

Cmd+Shift+N: after WKWebView has been in the responder chain, SwiftUI's
internal focus system can intercept Command-key events in the content
view hierarchy (returning true) without firing the CommandGroup action
closure. Fix by dispatching Command-key events directly to NSApp.mainMenu
when the terminal is first responder, bypassing the broken SwiftUI path.
Also add Cmd+Shift+N to handleCustomShortcut so it's customizable and
doesn't depend on SwiftUI menu dispatch at all.

* Unified debug event log: merge key/mouse/focus into /tmp/cmux-debug.log

- Delete KeyDebugLog, MouseDebugLog, klog(), mlog() from AppDelegate
- Replace all klog/mlog calls with dlog() (provided by bonsplit)
- Remove debugLogCallback wiring from Workspace
- Add focus change logging: focus.panel, focus.firstResponder,
  split.created, focus.moveFocus
- Add import Bonsplit where needed for dlog access
- Fix stale drag state on cancelled tab drags (bonsplit submodule)

* Fix split focus stolen by re-entrant becomeFirstResponder during reparenting

During programmatic splits (Cmd+D / Cmd+Shift+D), SwiftUI reparents the old
terminal view, which fires becomeFirstResponder → onFocus → focusPanel for the
OLD panel, stealing focus from the newly created pane.

Add programmaticFocusTargetPanelId guard to suppress re-entrant focusPanel
calls for non-target panels during split creation.

Also document the unified debug event log in CLAUDE.md.

* Clear stale title/favicon when browser navigation fails

When a page fails to load (e.g. connection refused), the tab was still
showing the previous page's title and favicon. Now didFailProvisionalNavigation
resets pageTitle to the failed URL and clears faviconPNGData.

* Fix Cmd+N swallowed by browser omnibar and improve split focus suppression

- Only Ctrl+N/P trigger omnibar navigation, not Cmd+N/P (Cmd+N should
  always create new workspace regardless of address bar focus)
- Move split focus suppression from workspace-level guard to source:
  suppress becomeFirstResponder side-effects (onFocus + ghostty_surface_set_focus)
  directly on the old GhosttyNSView during reparenting, preventing both
  model-level and libghostty-level focus divergence
- Remove programmaticFocusTargetPanelId from Workspace.focusPanel

* Fix omnibar hang, WebView white flash, drag-over-browser, and idle CPU spin

- Omnibar: first click selects all without entering NSTextView tracking loop;
  subsequent clicks have 3s synthetic mouseUp safety net to prevent hang
- WebView: set underPageBackgroundColor to match window so new browsers don't
  flash white before content loads
- Drag/drop: register custom UTType (com.splittabbar.tabtransfer) in Info.plist
  so WKWebView doesn't intercept tab drags; override registerForDraggedTypes
  on CmuxWebView as belt-and-suspenders
- CPU: fix infinite makeFirstResponder loop in controlTextDidEndEditing by
  checking both the text field and its field editor (the actual first responder)
2026-02-17 03:21:08 -08:00
Lawrence Chen
c0f7a07a7b Fix sidebar tabs getting extra left padding when update pill is visible
Move GeometryReader from wrapping the entire VStack to wrapping only the
ScrollView so proxy.size.height reflects available height (minus pill),
preventing unnecessary scrollability that triggered macOS horizontal insets.

Also clamp update pill text width with maxWidth instead of fixed width so
it truncates gracefully at narrow sidebar widths and grows when wider, add
horizontal padding, left-align truncated text, and add debug menu item for
testing with long nightly version strings.
2026-02-16 03:20:51 -08:00
Lawrence Chen
ac4b49d7a4 move update pill to sidebar only, add Install Update menu item 2026-02-15 21:17:33 -08:00
Lawrence Chen
f789306a97 enable update pill in Release builds 2026-02-15 18:08:32 -08:00
Lawrence Chen
a2943b0c70 Add nightly update channel workflow and adopt AGPL licensing 2026-02-14 02:43:03 -08:00
Lawrence Chen
50f0dd334d
Fix frozen terminals after split churn (#12)
* Fix blank terminal after split operations and add visual tests

## Blank Terminal Fix
- Add `needsRefreshAfterWindowChange` flag in GhosttyTerminalView
- Force terminal refresh when view is added to window, even if size unchanged
- Add `ghostty_surface_refresh()` call in attachToView for same-view reattachment
- Add debug logging for surface attachment lifecycle (DEBUG builds only)

## Bonsplit Migration
- Add bonsplit as local Swift package (vendor/bonsplit submodule)
- Replace custom SplitTree with BonsplitController
- Add Panel protocol with TerminalPanel and BrowserPanel implementations
- Add SidebarTab as main tab container with BonsplitController
- Remove old Splits/ directory (SplitTree, SplitView, TerminalSplitTreeView)

## Visual Screenshot Tests
- Add test_visual_screenshots.py for automated visual regression testing
- Uses in-app screenshot API (CGWindowListCreateImage) - no screen recording needed
- Generates HTML report with before/after comparisons
- Tests: splits, browser panels, focus switching, close operations, rapid cycles
- Includes annotation fields for easy feedback

## Browser Shortcut (⌘⇧B)
- Add keyboard shortcut to open browser panel in current pane
- Add openBrowser() method to TabManager
- Add shortcut configuration in KeyboardShortcutSettings

## Screenshot Command
- Add 'screenshot' command to TerminalController for in-app window capture
- Returns OK with screenshot ID and path

## Other
- Add tests/visual_output/ and tests/visual_report.html to .gitignore

* Add browser title subscription and set tab height to 30px

- Subscribe to BrowserPanel.$pageTitle changes to update bonsplit tabs
- Update tab titles in real-time as page navigation occurs
- Clean up subscriptions when panels are removed
- Set bonsplit tab bar and tab height to 30px (in submodule)

* Fix socket API regressions in list_surfaces, list_bonsplit_tabs, focus_pane

- list_surfaces: Remove [terminal]/[browser] suffix to keep UUID-only format
  that clients and tests expect for parsing
- list_bonsplit_tabs --pane: Properly look up pane by UUID instead of
  creating a new PaneID (requires bonsplit PaneID.id to be public)
- focus_pane: Accept both UUID strings and integer indices as documented

* Fix browser panel stability and keyboard shortcuts

- Prevent WKWebView focus lifecycle crashes during split/view reshuffles
- Match bracket shortcuts via keyCode (Cmd+Shift+[ / ], Cmd+Ctrl+[ / ])
- Support Ghostty config goto_split:* keybinds when WebView is focused
- Add focus_webview/is_webview_focused socket commands and regression tests
- Rename SidebarTab to Workspace and update docs

* Make ctrl+enter keybind test skippable

Skip when the Ghostty keybind isn't configured or when osascript can't send keystrokes (no Accessibility permission), so VM runs stay green.

* Auto-focus browser omnibar when blank

When a browser surface is focused but no URL is loaded yet, focus the address bar instead of the WKWebView.

* Stabilize socket surface indexing

* Focus browser omnibar escape; add webview keybind UI tests

- Escape in omnibar now returns focus to WKWebView\n- Add UI tests for Cmd+Ctrl+H pane navigation with WebKit focused (including Ghostty config)\n- Avoid flaky element screenshots in UpdatePillUITests on the UTM VM

* Fix browser drag-to-split blanks and socket parsing

* Fix webview-focused shortcuts and stabilize browser splits

- Match ctrl/shift shortcuts by keyCode where needed (Ctrl+H, bracket keys)
- Load Ghostty goto_split triggers reliably and refresh on config load
- Add debug socket helpers: set_shortcut + simulate_shortcut for tests
- Convert browser goto_split/keybind tests to socket-based injection (no osascript)
- Bump bonsplit for drag-to-split fixes

* Fix split layout collapse and harden socket pane APIs

* Stabilize OSC 99 notification test timing

* Fix terminal focus routing after split reparent

* Support simulate_shortcut enter for focus routing test

* Stabilize terminal focus routing test

* Fix frozen new terminal tabs after many splits

* Fix frozen new terminal tabs after splits

* Fix terminal freeze on launch/new tabs

* Update ghostty submodule

* Fix terminal focus/render stalls after split churn

* Fix nested split collapsing existing pane

* Fix nested split collapse + stabilize new-surface focus

* Update bonsplit submodule

* Fix SIGINT test flake

* Remove bonsplit tab-switch crossfade

* Remove PROJECTS.md

* Remove bonsplit tab selection animation

* Ignore generated test reports

* Middle click closes tab

* Revert unintended .gitignore change

* Fix build after main merge

* Revert "Fix build after main merge"

This reverts commit 16bf9816d0856b5385d52f886aa5eb50f3c9d9a4.

* Revert "Merge remote-tracking branch 'origin/main' into fix/blank-terminal-and-visual-tests"

This reverts commit 7c20fb53fd71fea7a19a3673f2dd73e5f0c783c4, reversing
changes made to 0aff107d787bc9d8bbc28220090b4ca7af72e040.

* Remove tab close fade animation

* Use terminal.fill icon

* Make terminal tab icon smaller

* Match browser globe tab icon size

* Bonsplit: tab min width 48 and tighter close button

* Bonsplit: smaller tab title font

* Show unread notification badge in bonsplit tabs and improve UI polish

Sync unread notification state to bonsplit tab badges (blue dot).
Improve EmptyPanelView with Terminal/Browser buttons and shortcut hints.
Add tooltips to close tab button and search overlay buttons.

* Fix reload.sh single-instance safety check on macOS

Replace GNU-only `ps -o etimes=` with portable `ps -o etime=` and
parse the dd-hh:mm:ss format manually for macOS compatibility.

* Centralize keyboard shortcut definitions into Action enum

Replace per-shortcut boilerplate with a single Action enum that holds
the label, defaults key, and default binding for each shortcut. All
call sites now use shortcut(for:). Settings UI is data-driven via
ForEach(Action.allCases). Titlebar tooltips update dynamically when
shortcuts are changed. Remove duplicate .keyboardShortcut() modifiers
from menu items that are already handled by the event monitor.

* Fix WKWebView consuming app menu shortcuts and close panel confirmation

Add CmuxWebView subclass that routes key equivalents through the main
menu before WebKit, so Cmd+N/Cmd+W/tab switching work when a browser
pane is focused. Fix Cmd+W close-panel path: bypass Bonsplit delegate
gating after the user confirms the running-process dialog by tracking
forceCloseTabIds. Add unit tests (CmuxWebViewKeyEquivalentTests) and
UI test scaffolding (MenuKeyEquivalentRoutingUITests) with a new
cmux-unit Xcode scheme.

* Update CLAUDE.md and PROJECTS.md with recent changes

CLAUDE.md: enforce --tag for reload commands, add cleanup safety rules.
PROJECTS.md: log notification badge, reload.sh fix, Cmd+W fix, WebView
key equiv fix, and centralized shortcuts work.

* Keep selection index stable on close

* Add concepts page documenting terminology hierarchy

New docs page explaining Window > Workspace > Pane > Surface > Panel
hierarchy with aligned ASCII diagram. Updated tabs.mdx and splits.mdx
to use consistent terminology (workspace instead of tab, surface
instead of panel) and corrected outdated CLI command references.

* Update bonsplit submodule

* WIP: improve split close stability and UI regressions

* Close terminal panel on child exit; hide terminal dirty dot

* Fix split close/focus regressions and stabilize UI tests

* Add unread Dock/Cmd+Tab badge with settings toggle

* Fix browser-surface shortcuts and Cmd+L browser opening

* Snapshot current workspace state before regression fixes

* Update bonsplit submodule snapshot

* Stabilize split-close regression capture and sidebar resize assertions

* Change default Show Notifications shortcut from Cmd+Shift+I to Cmd+I

* Fix update check readiness race, enable release update logging, and improve checking spinner

* Restore terminal file drop, fix browser omnibar click focus, and add panel workspace ID mutation for surface moves

* Add Cmd+digit workspace hints, titlebar shortcut pills, sidebar drag-reorder, and workspace placement settings

* Add v2 browser automation API, surface move/reorder commands, and short-handle ref system to TerminalController

* Add CLI browser command surface, --id-format flag, and move/reorder commands

* Extend test clients with move/reorder APIs, ref-handle support, and increased timeouts

* Harden test runner scripts with deterministic builds, retry logic, and robust socket readiness

* Stabilize existing test suites with focus-wait helpers, increased timeouts, and API shape updates

* Add terminal file drop e2e regression test

* Add v2 browser API, CLI ref resolution, and surface move/reorder test suites

* Add unit tests for shortcut hints, workspace reorder, drop planner, and update UI test stabilization

* Add cmux-debug-windows skill with snapshot script and agent config

* Update project docs: mark browser parity and move/reorder phases complete, add parallel agent workflow guidelines

* Update bonsplit submodule: re-entrant setPosition guard, tab shortcut hints, and moveTab/reorderTab API

* Add browser agent UX improvements: snapshot refs, placement reuse, diagnostics, and skill docs

- Upgrade browser.snapshot to emit accessibility tree text with element refs (eN)
- Add right-sibling pane reuse policy for browser.open_split placement
- Add rich not_found diagnostics with retry logic for selector actions
- Support --snapshot-after for post-action verification on mutating commands
- Allow browser fill with empty text for clearing inputs
- Default CLI --id-format to refs-first (UUIDs opt-in via --id-format uuids|both)
- Format legacy new-pane/new-surface output with short surface refs
- Add skills/cmuxterm-browser/ and skills/cmuxterm/ end-user skill docs
- Add regression tests for placement policy, snapshot refs, diagnostics, and ID defaults

* Update bonsplit submodule: keep raster favicons in color when inactive
2026-02-13 16:45:31 -08:00
Lawrence Chen
eb19e8fa25
Bump version to 1.27.0 (#35)
Fix macOS 14 (Sonoma) compatibility issues:
- Muted traffic lights and toolbar items caused by clipsToBounds default change
- Toolbar buttons disappearing after sidebar toggle (Cmd+B)
- Update check pill not appearing in titlebar
2026-02-11 20:30:12 -08:00
Lawrence Chen
9817d131f8
Release v1.23.0 (#31)
* Rename cmuxterm to cmux across entire codebase

- Rename GitHub repos: manaflow-ai/cmuxterm -> manaflow-ai/cmux,
  manaflow-ai/homebrew-cmuxterm -> manaflow-ai/homebrew-cmux
- Rename bundle IDs: com.cmuxterm.app -> com.cmux.app
- Rename CLI: CLI/cmuxterm.swift -> CLI/cmux.swift
- Rename homebrew submodule: homebrew-cmuxterm -> homebrew-cmux
- Update all socket paths: /tmp/cmuxterm*.sock -> /tmp/cmux*.sock
- Update all GitHub URLs, DMG names, Sparkle URLs
- Update all source files, scripts, tests, docs, CI workflows

* Bump version to 1.23.0
2026-02-09 15:30:43 -08:00
Lawrence Chen
6866743519 Map Sparkle error 4005 to "Move to Applications" message
Error 4005 (updater permission) with underlying code 10 (cache
directory creation failure) has the same root cause as 1003/1005:
the app isn't in Applications.
2026-02-08 21:11:28 -08:00
Lawrence Chen
87e5ac02ad
Bump version to 1.20.0 (#24) 2026-02-08 20:44:47 -08:00
Lawrence Chen
679cafdc51 Fix update pill constraint feedback loop
The pill never appeared because:
1. SwiftUI .frame(width:0, height:0) when idle poisoned fittingSize
2. AppKit constraints locked at 0x0 prevented expansion on state change
3. fittingSize always returned 0 due to active 0x0 constraints

Fix: Remove zero-frame from SwiftUI (always render at natural size,
use opacity only). Deactivate constraints before measuring fittingSize
so they don't clamp the measurement. Pass visibility to sizeToolbarItem
to set constraints to zero when idle or natural size when active.
2026-02-08 20:21:27 -08:00
Lawrence Chen
59370115ce Fix pill visibility: always render, use opacity to hide
NSHostingView with frame (0,0) won't layout SwiftUI content, so
fittingSize always returns 0 when transitioning from EmptyView.
Instead, always render the pill button and use opacity/frame(0)
to hide when idle. This ensures the hosting view always has content
to measure.
2026-02-08 19:16:07 -08:00