Commit graph

91 commits

Author SHA1 Message Date
Lawrence Chen
7916b2d418
Fix Xcode Cloud UI tests by running TestAction in Debug (#672)
* Set cmux TestAction to Debug for UI tests

* Broaden XCTest detection for debug launch gate

* Fix AutomationSocketUITests launch hang in CI

* Stabilize CI Swift package resolution for test jobs

* Stabilize Xcode Cloud UI test focus and socket handling

* Add Xcode Cloud pre-xcodebuild submodule bootstrap

* Harden Xcode Cloud bonsplit bootstrap fallback
2026-02-28 01:48:49 -08:00
Lawrence Chen
be89812bea
Harden CI unit tests against SwiftPM artifact flakes (#682) 2026-02-28 00:38:46 -08:00
Lawrence Chen
ae3bcd7eea
Set up full test suite in CI and Xcode Cloud (#447)
* Set up full test suite in CI and Xcode Cloud

Add build-ghosttykit.yml workflow to pre-build and publish
GhosttyKit.xcframework as a GitHub release on manaflow-ai/ghostty,
keyed by submodule SHA. Add ci_scripts/ci_post_clone.sh for Xcode
Cloud to download the pre-built xcframework with retry logic. Create
cmux-ci scheme that runs both cmuxTests and cmuxUITests. Switch the
CI tests job from running a single UI test class to the full suite.

* Run unit tests + single UI test class on self-hosted runner

The self-hosted runner can't launch the full app for UI tests (no GUI
session), so run all unit tests via cmux-unit scheme and keep the
original UpdatePillUITests as a smoke test. Full UI test suite runs
on Xcode Cloud which has proper macOS GUI support.

* Handle expected test failures in unit tests step

xcodebuild returns exit code 65 even for expected failures
(XCTExpectFailure). Parse the summary line to only fail the CI job
when there are unexpected failures.
2026-02-27 04:18:26 -08:00
Lawrence Chen
c7eec9fbb5
Pin create-dmg version in signed build workflows (#401)
* Pin create-dmg version in release workflows

* Bump pinned create-dmg to 8.0.0
2026-02-25 19:30:10 -08:00
Lawrence Chen
4d2fd30143 Fix UI test hang: bypass launch guard for XCUITest apps
XCUITest launches the app as a separate process that doesn't inherit
XCTest env vars (XCTestConfigurationFilePath, etc.), so
isRunningUnderXCTest() returns false. The app then hits
shouldBlockUntaggedDebugLaunch() and exits with code 64, causing the
test runner to hang waiting for the app to launch.

Fix: detect CMUX_UI_TEST_* env vars set via XCUIApplication.launchEnvironment
and skip the launch guard. Also revert the failed CMUX_TAG ci.yml workaround.
2026-02-24 23:28:34 -08:00
Lawrence Chen
77a59b5743 Fix UI test hang: set CMUX_TAG for debug launch guard
Debug builds refuse to launch without CMUX_TAG to prevent accidental
untagged launches. XCUITest launches the app as a separate process
without XCTest env vars, so the app's isRunningUnderXCTest() check
fails and the app calls exit(64). The test runner then waits forever
for the app to report back. Set CMUX_TAG=ci in the CI env.
2026-02-24 23:19:04 -08:00
Lawrence Chen
79266ee03b Fix UI test hang: remove ad-hoc signature before test launch
The Mac Mini runner has no dev certificates, so xcodebuild produces
an ad-hoc signed app. Gatekeeper rejects it, causing XCUITest to hang
forever at app.launch(). Split build and test phases, strip the ad-hoc
signature between them so the app can launch.
2026-02-24 23:15:11 -08:00
Lawrence Chen
fc3e3a4d7d Pin all GitHub Actions to full commit SHAs
Org policy now requires actions pinned to immutable SHAs instead of
mutable version tags. Pin actions/checkout, actions/github-script,
softprops/action-gh-release, and oven-sh/setup-bun across all workflows.
2026-02-24 22:21:40 -08:00
Lawrence Chen
53ef6a5f7d
Upgrade Sentry: tracing, breadcrumbs, dSYM upload (#366)
* Upgrade Sentry: tracing, breadcrumbs, dSYM upload

- Enhanced Sentry SDK init with performance tracing (10% sample),
  explicit app hang timeout, stack trace attachment, and HTTP
  failure capture
- Added breadcrumbs for key user actions: workspace switch/create/close,
  split creation, command palette open/close, app focus — these give
  context to hang/crash reports
- Added dSYM upload step to nightly and release CI workflows so hang
  stacks are fully symbolicated (requires SENTRY_AUTH_TOKEN secret)
- Created SentryHelper.swift with lightweight breadcrumb helper

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

* Remove command palette breadcrumbs

Not useful for hang diagnosis — keep only workspace/tab/split/focus
breadcrumbs that correlate with heavy operations.
2026-02-23 17:11:01 -08:00
Lawrence Chen
f3fc880468 Guard self-hosted CI from fork pull requests 2026-02-23 14:58:17 -08:00
Lawrence Chen
5ac633445f Fail partial release assets and short-circuit reruns 2026-02-21 15:27:24 -08:00
Lawrence Chen
cf1cd096b1 Make release asset guard idempotent 2026-02-21 15:19:10 -08:00
Lawrence Chen
6a0b708ea1
Merge pull request #269 from manaflow-ai/feat-release-immutable-guards
release: enforce immutable signed assets per tag
2026-02-21 04:14:27 -08:00
Lawrence Chen
a5b1039fbc release: block accidental overwrite of signed assets 2026-02-21 04:07:00 -08:00
Lawrence Chen
5e1d458505 nightly: publish immutable DMG assets for appcast 2026-02-21 04:02:51 -08:00
Lawrence Chen
5502bec29a
Fix homebrew cask template: homepage → cmux.dev, min macOS → Sonoma (#162) 2026-02-20 13:45:20 -08:00
Lawrence Chen
305d22e4e6
Fix same-day nightly update detection in Sparkle (#173)
* Fix nightly build version monotonicity for Sparkle updates

* Include run attempt in nightly build version
2026-02-20 13:43:51 -08:00
Lawrence Chen
6f9146e895
Run nightly workflow hourly instead of daily (#170)
The decide job already skips when main HEAD matches the nightly tag,
so this only builds when there are actual changes. Hourly means users
get nightly updates within an hour of merging to main.
2026-02-20 04:40:14 -08:00
Lawrence Chen
ec9b80f389
Add nightly-specific app icon with purple NIGHTLY banner (#166)
Follows the same pattern as AppIcon-Debug (orange DEV banner) but with
a purple banner and "NIGHTLY" text. The nightly CI workflow now passes
ASSETCATALOG_COMPILER_APPICON_NAME=AppIcon-Nightly to xcodebuild so
the nightly app gets its own distinct icon.

Includes scripts/generate_nightly_icon.py for regenerating the icons
from the production AppIcon source files.
2026-02-20 04:10:32 -08:00
Lawrence Chen
ecee9386cf
Add GitHub issue templates for bug reports and feature requests (#165)
Bug reports now require cmux version, macOS version, chip type,
install method, repro steps, and expected behavior. Blank issues
are disabled to encourage structured reports.
2026-02-20 04:02:26 -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
fc1de08561
Fix homebrew SHA mismatch race condition (#111)
Root cause: update-homebrew.yml triggered on release:published, which fires
before softprops/action-gh-release finishes uploading assets. The workflow
downloaded a 404 page instead of the DMG and committed its SHA.

Fix:
- Change trigger from release:published to workflow_run (fires after the
  release workflow completes, guaranteeing assets are uploaded)
- Add download validation with retries and file size checks
- Add SHA verification step before committing to the cask
- Add homebrew cask update to build-sign-upload.sh for local releases
- Add regression test (tests/test_homebrew_sha.sh)
- Update /release and /release-local skills with homebrew verification steps

Fixes #110
2026-02-19 17:44:00 -08:00
Lawrence Chen
d08f28d770
Merge pull request #83 from manaflow-ai/perf/portal-hosting-selected-mount
Reduce terminal input latency via portal hosting + selected-only workspace mounting
2026-02-18 22:31:45 -08:00
Lawrence Chen
699db2a9ed
Fix menubar lag on M1 Macs by using universal xcframework target (#93)
Remove -Dxcframework-target=native from CI and release workflows,
defaulting to universal (matching upstream ghostty). The native target
produces a macos-arm64 xcframework slice that causes Xcode to link the
final binary differently (~70KB more __text), resulting in menubar and
right-click lag on M1 Max. The arm64 static libraries are byte-for-byte
identical between native and universal builds - the difference is purely
in how Xcode resolves the xcframework slice.
2026-02-18 22:09:13 -08:00
Lawrence Chen
442eb1f01d Rename test targets to cmuxTests and cmuxUITests 2026-02-18 21:19:56 -08:00
Lawrence Chen
915e34bd38
Revert xcframework-target removal that broke CI (#86) (#90)
The -Dxcframework-target flag controls platform slices (native=macOS
only, universal=macOS+iOS), not CPU microarchitecture. Removing it
caused CI to attempt iOS builds which fail due to missing Metal
iOS toolchain on the runner.
2026-02-18 20:37:59 -08:00
Austin Wang
65ac29d827
Fix zsh git branch refresh race after cwd change (#71)
* Fix zsh git branch refresh race after cwd change

* Clarify intentional duplicate cwd check in git refresh path

* Add Metal Toolchain download step to CI and release workflows

Fixes build failure when compiling Metal shaders for iOS xcframework
targets — the self-hosted runner needs `xcodebuild -downloadComponent
MetalToolchain` installed before `xcrun metal` can run.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:36:27 -08:00
Lawrence Chen
d24030db58
Use universal xcframework target instead of native (#86)
The self-hosted runner (M4 Mac Mini) was building GhosttyKit with
-Dxcframework-target=native, producing M4-tuned binaries. This caused
menubar and right-click lag on M1 machines. Dropping the flag defaults
to universal, which works well across all Apple Silicon chips.
2026-02-18 20:21:34 -08:00
Lawrence Chen
a2457f1d5e Fix menubar lag in production builds caused by hardened runtime
Hardened runtime's library validation was verifying every dylib on load,
causing noticeable UI lag. Add entitlements file with
disable-library-validation to fix while keeping notarization support.
2026-02-16 03:26:33 -08:00
Lawrence Chen
5e62a9eca7 Fix nightly: delete existing CMUXCommit plist key before adding 2026-02-15 17:14:35 -08:00
Lawrence Chen
a01e7483d6 Improve nightly version numbers
- Marketing version: append -nightly.YYYYMMDD (e.g. 1.28.2-nightly.20260215)
- Build number: monotonic YYYYMMDDNN integer for clean Sparkle comparisons
- Embed commit SHA via CMUXCommit plist key (already shown in About panel)
2026-02-15 17:10:10 -08:00
Lawrence Chen
faf1bd44c2 release: fix Sparkle upgrade path for 1.27.0 users 2026-02-14 03:26:42 -08:00
Lawrence Chen
299a5eb3d8 ci: run ui tests directly on self-hosted macmini 2026-02-14 03:00:26 -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
0dd3252980 CI: add cmux-macmini as UI test VM fallback 2026-02-11 18:09:45 -08:00
Lawrence Chen
2013be43ef CI: allow cmux-vm host/user via GitHub secrets 2026-02-10 17:29:38 -08:00
Lawrence Chen
de1b2e1c37 CI: require reachable cmux-vm; fail fast instead of slow scan 2026-02-10 17:28:01 -08:00
Lawrence Chen
7022517b47 CI: use dhcp lease IPs as vm candidates 2026-02-10 17:16:50 -08:00
Lawrence Chen
023abc48e0 CI: fix yaml; parse dhcp leases with awk 2026-02-10 17:06:02 -08:00
Lawrence Chen
110715b09c CI: derive vm IP from /var/db/dhcpd_leases 2026-02-10 17:04:39 -08:00
Lawrence Chen
bc9f1ff663 CI: bound vm discovery time; faster ssh probes 2026-02-10 16:54:26 -08:00
Lawrence Chen
6612b389c6 CI: fix vm discovery scan under set -u 2026-02-10 16:45:32 -08:00
Lawrence Chen
d7475a2356 CI: make vm subnet scan compatible with pipefail 2026-02-10 16:44:34 -08:00
Lawrence Chen
4bca80affe CI: discover vm via subnet scan when host alias missing 2026-02-10 16:38:06 -08:00
Lawrence Chen
7e1653a3ca CI: fix vm host detection quoting 2026-02-10 16:36:26 -08:00
Lawrence Chen
a5a29962e5 CI: find cmux-vm host via ssh config; fail if unreachable 2026-02-10 16:33:51 -08:00
Lawrence Chen
e72916a77d CI: require UI tests via vm; robust ssh opts 2026-02-10 16:32:10 -08:00
Lawrence Chen
0d950cb891 CI: run mac UI tests only in cmux-vm 2026-02-10 16:27:29 -08:00
Lawrence Chen
aa4c7ceede CI: gate mac UI tests on real GUI session 2026-02-10 16:25:44 -08:00