Commit graph

58 commits

Author SHA1 Message Date
Austin Wang
021cc05cf3
Stabilize sidebar resizer hitbox and cursor across portals (#255) 2026-02-20 23:14:48 -08:00
Austin Wang
3c0e3a7c82
Fix flaky browser download activity accounting (#246)
* Add debug tracing for context-menu download flow

* Remove temporary download debug instrumentation
2026-02-20 22:15:35 -08:00
Lawrence Chen
41b2db5962 Preserve approved HTTP request semantics and fix test imports 2026-02-20 21:24:03 -08:00
Austin Wang
95ac588bb2
Fix browser download UX and stabilize browser crash path (#235)
* Fix browser download UX and stabilize download crash path

* Fix context menu image/link download target resolution

* Restore native WebKit context-menu download actions

* Improve browser download feedback and context menu downloads

* Fix flaky alternating context-menu downloads

* Stabilize linked-file context downloads

* Use per-menu-item fallback for context downloads

* Harden linked-file URL resolution for context downloads
2026-02-20 21:21:03 -08:00
Lawrence Chen
73cbfce432 Fix WKWebView JavaScript dialogs in browser panel 2026-02-20 20:53:59 -08:00
Lawrence Chen
5ae36fcb91
Merge pull request #203 from cmer/browser-whitelist
Add wildcard hostname allowlist for built-in browser routing
2026-02-20 20:47:51 -08:00
Lawrence Chen
cf38330483 Address review: allow favicon refresh across history URL changes 2026-02-20 20:23:16 -08:00
Lawrence Chen
26a88a4b2e Fix favicon race during back/forward navigation 2026-02-20 20:17:58 -08:00
Lawrence Chen
01313b6c9a Expand default HTTP host allowlist for local dev 2026-02-20 19:55:59 -08:00
Lawrence Chen
1d5be22820 Normalize IDN host allowlist entries 2026-02-20 19:34:34 -08:00
Lawrence Chen
7cc94ffa29 Merge remote-tracking branch 'origin/main' into pr-203-browser-whitelist 2026-02-20 19:25:56 -08:00
Lawrence Chen
ce6b5e3999 Harden terminal URL host allowlist routing 2026-02-20 19:25:51 -08:00
Lawrence Chen
64f6e34e7b Merge origin/main into pr-203-browser-whitelist 2026-02-20 19:10:59 -08:00
Austin Wang
41e9b8081f
Increase hit area for browser panel buttons
Merged by manaflow for task kn71ngz7871bej8k7m9ka2qy7d81kxqd.
2026-02-20 19:10:48 -08:00
Lawrence Chen
39c16183ee
Merge pull request #222 from manaflow-ai/feat-pr117-review-followup
Follow up browser DevTools and portal review comments from PR 117
2026-02-20 19:03:38 -08:00
Austin Wang
04431751ce
Fix file drag-and-drop and file input in browser panel (#214)
* Fix file drag-and-drop and file input in browser panel (#194)

Two fixes for the browser panel:

1. File drag-and-drop from Finder: CmuxWebView previously suppressed ALL
   drag type registration as a no-op to prevent bonsplit tab drags from
   being intercepted. Now it selectively filters out only the text-based
   types that conflict with bonsplit (public.text, public.utf8-plain-text,
   public.plain-text) and the custom tab transfer types, while allowing
   file URL types through so Finder drops work.

2. File <input> elements: Added the WKUIDelegate runOpenPanelWith method
   to BrowserUIDelegate so clicking a file input opens the native macOS
   file picker (NSOpenPanel), with support for multiple selection and
   directory picking as specified by the HTML element.

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

* chore(claude-opus-4-6): take a look at https://github.com/manaflow-ai/cmux/issues...

* ok

* wok

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 18:26:23 -08:00
Lawrence Chen
f294699670 Fix browser DevTools retry and portal visibility follow-ups 2026-02-20 18:00:20 -08:00
Lawrence Chen
438b7a6a41 Merge remote-tracking branch 'origin/main' into fix/browser-devtools-shortcuts-pr
# Conflicts:
#	Sources/Panels/BrowserPanel.swift
#	Sources/cmuxApp.swift
#	cmuxTests/CmuxWebViewKeyEquivalentTests.swift
#	vendor/bonsplit
2026-02-20 15:48:27 -08:00
Lawrence Chen
ea0593475c
Merge pull request #206 from manaflow-ai/issue-180-http-nonsecure-hosts
Allow HTTP in built-in browser for local dev hosts
2026-02-20 15:39:22 -08:00
Austin Wang
270115ccbb
Fix Cmd+Enter being routed as browser reload (#213) 2026-02-20 15:36:24 -08:00
Lawrence Chen
6133da0b20 Prefer navigate row over switch-to-tab for identical URL 2026-02-20 15:19:06 -08:00
Lawrence Chen
3ffceb7e8e Fix insecure HTTP proceed to be one-time unless saved 2026-02-20 15:16:12 -08:00
Lawrence Chen
79b34052cb Persist HTTP allowlist selection when opening externally 2026-02-20 15:00:54 -08:00
Lawrence Chen
821e3ab4c3 Guard insecure HTTP in browser with allowlist and proceed flow 2026-02-20 14:55:26 -08:00
Carl Mercier
5e74161324
Add wildcard hostname allowlist for built-in browser routing (#195)
Adds a configurable host allowlist in Settings > Browser that controls
which terminal links open in the cmux embedded browser vs the system
default browser. Supports exact match and wildcard prefix patterns
(e.g. localhost, 127.0.0.1, *.localtest.me). Empty list preserves
existing behavior of opening all web links in cmux.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 16:24:50 -06:00
Lawrence Chen
cae40d1a4c
Sidebar ports on own line, wider sidebar, CMUX_PORT env vars (#160)
* Sidebar ports on own line, wider sidebar, CMUX_PORT env vars

- Move listening ports to dedicated sidebar row (removed from branch/directory line)
- Allow sidebar to resize up to 2/3 of screen width (was capped at 360px)
- Add CMUX_PORT, CMUX_PORT_END, CMUX_PORT_RANGE env vars per workspace
- Each workspace gets a dedicated port range (default: base 9100, range 10)
- Add settings UI for port base and range size
- Add portOrdinal to Workspace, monotonic counter in TabManager

Closes #129

* Make port ordinal counter static to avoid overlap across windows

Each window creates its own TabManager, so a per-instance counter
would reset and reuse port ranges. Making it static ensures unique
ranges across all windows.

* Fix portOrdinal race: pass through Workspace init instead of setting after

The first TerminalPanel is created inside Workspace.init, so setting
portOrdinal after init returns meant the initial terminal always got
ordinal 0. Pass portOrdinal as an init parameter and set it before
the TerminalPanel is created.

* Fix P2/P3: snapshot port settings at surface creation, use window screen for sidebar cap

P2: Port base/range are now snapshotted on TerminalSurface when the
panel is created, so changing settings mid-session won't cause
inconsistent CMUX_PORT values across terminals in the same workspace.

P3: Sidebar max width now uses NSApp.keyWindow?.screen instead of
NSScreen.main, so multi-monitor setups get the correct 2/3 cap for
the display the window is actually on.

* Fix P1: snapshot port base/range once per app session, not per panel

Port base and range size are now static properties on TerminalSurface,
initialized once from UserDefaults at first access. This prevents
overlapping port ranges across workspaces when settings are changed
mid-session (e.g., workspace 1 with range=10 at 9110-9119, then
range changed to 5, workspace 2 would overlap at 9110).
2026-02-20 14:12:14 -08:00
Lawrence Chen
5560492d27
Add preference to disable in-app browser for terminal links (#174)
* Add preference for terminal link browser target

Fixes https://github.com/manaflow-ai/cmux/issues/172

* Route non-web terminal links to external opener

Only route http/https terminal links to cmux's embedded browser.
Absolute paths, file:// URLs, and non-web schemes now open via NSWorkspace.

Refs https://github.com/manaflow-ai/cmux/issues/172
2026-02-20 13:58:39 -08:00
Lawrence Chen
eb5c52d239 Render unread notification ring above portal-hosted terminal view 2026-02-20 02:41:52 -08:00
Lawrence Chen
4588c3b0d1 Avoid O(N) re-renders by passing derived Bool instead of ObservableObject
Replace @ObservedObject notificationStore in TerminalPanelView and
PanelContentView with a plain `let hasUnreadNotification: Bool`.
The parent WorkspaceContentView already subscribes to the store
via @EnvironmentObject; it now computes the per-panel Bool and
passes it down, so child views only re-render when their own
notification state actually changes.
2026-02-20 02:41:52 -08:00
Lawrence Chen
cef1513ceb Fix notification ring not appearing on terminal panes
TerminalPanelView and PanelContentView held notificationStore as a
plain `let` property. Since it's a reference type (class), SwiftUI's
structural diffing saw no change when notifications were added and
skipped re-evaluating the view body. Changed to @ObservedObject var
so the views properly subscribe to the store's @Published changes.

Closes #126
2026-02-20 02:41:52 -08:00
Lawrence Chen
153b73c952 Add earlier devtools shortcut snapshots and geometry probes 2026-02-20 01:04:16 -08:00
Lawrence Chen
5b2be45f3a
Fix browser panel mouse back/forward buttons and middle-click (#131) (#139)
Handle multi-button mouse events in the browser panel's WKWebView:

- Mouse back button (button 3) triggers goBack(), forward button
  (button 4) triggers goForward(), enabling side-button navigation
  on mice like Logitech
- Middle-click (button 2) on a link opens it in a new browser tab
  by hit-testing the click position via JavaScript and routing through
  the existing openLinkInNewTab mechanism
2026-02-19 23:38:21 -08:00
Lawrence Chen
db66fc4bb0 Stabilize browser portal bounds and log inspector height metrics 2026-02-19 23:19:00 -08:00
Lawrence Chen
943858acff Defer and auto-arm devtools refresh across reparent 2026-02-19 21:17:55 -08:00
Lawrence Chen
54a0f78d75 Harden browser devtools split reparent flow 2026-02-19 21:13:41 -08:00
Lawrence Chen
6170143b6d Add deep split/devtools reparent diagnostics 2026-02-19 20:41:22 -08:00
Lawrence Chen
f546c289c3 Preserve devtools webview during split teardown 2026-02-19 20:38:31 -08:00
Lawrence Chen
397e46a667 Add devtools split diagnostics and restore retries 2026-02-19 20:31:00 -08:00
Lawrence Chen
743cfcdc6d Fix browser devtools persistence and Safari shortcut wiring 2026-02-19 20:21:01 -08:00
Lawrence Chen
de666ff05b Fix split blackout race and stabilize focus handoff 2026-02-19 17:10:27 -08:00
Lawrence Chen
1d246b2bbd Fix omnibar focus intent races for Cmd+L 2026-02-19 00:35:25 -08:00
Lawrence Chen
5fc4df467a
Fix omnibar Cmd+L infinite focus loop causing 100% CPU (#97)
The browser omnibar's updateNSView and controlTextDidEndEditing
were both dispatching makeFirstResponder calls without any guard
against re-dispatch. Each makeFirstResponder triggers SwiftUI's
FirstResponderObserver, which re-evaluates the view graph, which
calls updateNSView again, creating an infinite loop via the main
dispatch queue.

Fix: Add a pendingFocusRequest flag on the coordinator to prevent
re-dispatching while a focus/blur request is already in flight.
Also add nsView.currentEditor() != nil to the isFirstResponder
check so the field is recognized as focused during the transition
when the field editor (not the field itself) is first responder.
2026-02-18 23:18:08 -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
ee4848c008 Speed up workspace switching: reduce portal churn and enforce selected z-order 2026-02-18 22:13:40 -08:00
Austin Wang
ab89fab897
Fix browser opening new tabs on link click (#92)
* Fix browser panel opening new tabs on every link click

Navigate target=_blank and window.open() links in the current webview
instead of spawning new browser tabs.

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

* Preserve cmd+click new tab behavior in createWebViewWith

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:53:36 -08:00
Austin Wang
2d64ecfc44
fixes crashes and filedrop fatal issue 2026-02-18 20:46:31 -08:00
Lawrence Chen
27df9cd171 Remove SwiftUI dimming fallback for portal terminals 2026-02-18 20:28:00 -08:00
Lawrence Chen
b05347884d Restore unfocused pane dimming for portal-hosted terminals 2026-02-18 20:24:54 -08:00
Austin Wang
0cca513eac
Browser searchbar bugs (#51)
* Add "+" menu button to horizontal tab bar for new terminal/browser tabs

Adds a "+" button to the tab bar (next to split buttons) that shows a
dropdown menu with "New Terminal ⌘T" and "New Browser ⌘⇧L" options.

- Uses native NSButton + NSMenu so the icon matches the split buttons
- Menu appears below the button
- Routes tab creation through new didRequestNewTab delegate method

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

* works

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 16:26:42 -08:00
Lawrence Chen
c2fdd48290
Release v1.36.0 (#47)
* Fix multi-workspace drag/drop, WebView click focus, and add regression tests

- Wire bonsplit isInteractive to workspace active state so inactive
  workspace NSViews are hidden from AppKit event routing
- Add CmuxWebView.mouseDown notification for browser panel focus
  tracking (AppKit delivers clicks to WKWebView, not SwiftUI overlays)
- Add multi-workspace focus regression test covering isHidden fix,
  rapid workspace switching, and browser panel focus routing

* Bump version to 1.36.0
2026-02-17 04:04:29 -08:00