Commit graph

103 commits

Author SHA1 Message Date
Lawrence Chen
dc6bcb259a
fix: address browser import review feedback 2026-03-16 22:30:09 -07:00
Lawrence Chen
92cb42262c
feat: add browser profile mapping import flow 2026-03-16 21:22:39 -07:00
Lawrence Chen
1d540d0806 Merge origin/main into issue-122-import-browser-cookies-history-settings 2026-03-12 18:40:20 -07:00
austinpower1258
f843ce2706 Hide unsafe side dock controls for attached devtools 2026-03-11 23:04:28 -07:00
austinpower1258
72e7a9de76 Adapt attached devtools to narrow panes 2026-03-11 22:56:39 -07:00
austinpower1258
df54af34cf Merge branch 'main' of https://github.com/manaflow-ai/cmux into issue-1183-devtools-resize-layout
# Conflicts:
#	cmuxTests/CmuxWebViewKeyEquivalentTests.swift
2026-03-11 22:16:07 -07:00
austinpower1258
7d5d4d718d wip 2026-03-11 22:13:45 -07:00
austinpower1258
8aafb68935 Fix browser pane drag/drop follow-ups 2026-03-11 19:16:17 -07:00
Lawrence Chen
5d82a29f45 Repair local-host devtools reparent geometry 2026-03-11 18:21:41 -07:00
Lawrence Chen
6849b83f8d
Reduce typing lag from sidebar re-evaluation and hitTest overhead (#1204)
* Add typing hot path timing diagnostics

* Add stress workspace debug menu item

* Restore stress workspace preload debug path

* Reduce typing lag from sidebar re-evaluation and hitTest overhead

hitTest: gate divider/sidebar/drag routing to pointer events only,
avoiding two full view-tree walks per non-pointer event.

forceRefresh: replace per-keystroke ISO8601DateFormatter + FileHandle
I/O with dlog() in DEBUG builds.

TabItemView: replace @EnvironmentObject subscriptions with plain refs
and precomputed parameters, add Equatable conformance to skip body
re-evaluation when parent rebuilds with unchanged values. @self changed
re-evaluations dropped from 668 to 1 during rapid typing.

* Add typing-latency guardrail comments and CLAUDE.md pitfalls

Strategic comments on hitTest, TabItemView, and forceRefresh to prevent
future regressions. Adds typing-latency-sensitive paths to CLAUDE.md
pitfalls section so agents know the constraints before editing.

* Add workspace palette actions and fix release autosave typing guard

Add Move Up/Down/Top, Close Other/Above/Below, Mark Read/Unread to
Cmd+Shift+P command palette and a Workspace submenu in the menu bar.

Fix recordTypingActivity() being gated behind #if DEBUG, which prevented
release builds from honoring the typing quiet period in autosave.
2026-03-11 17:54:02 -07:00
austinpower1258
06c5cac4df Stabilize docked devtools side resize 2026-03-11 12:26:19 -07:00
austinpower1258
8b66628b19 Route inline inspector hits to native webkit 2026-03-11 04:21:49 -07:00
austinpower1258
63787c26b1 Stabilize inline developer tools hosting 2026-03-11 04:17:37 -07:00
Lawrence Chen
3ca11a5e00 Keep off-window local hosts from stealing devtools view 2026-03-10 21:12:18 -07:00
Lawrence Chen
359ada8a3f Preserve side-docked browser devtools layout on pane resize 2026-03-10 20:42:26 -07:00
Austin Wang
d25067f38f
Merge pull request #1170 from manaflow-ai/fix-1160-devtools-loop
Fix side-docked browser DevTools resizing
2026-03-10 20:12:17 -07:00
austinpower1258
91061ce341 Fix side-docked browser DevTools resizing 2026-03-10 19:49:06 -07:00
Lawrence Chen
ec10dfdaec
Add browser find focus debug logs (#1162)
* Add browser find focus debug logs

* Allow browser find bar focus in portal host

* Add split and terminal find debug logs

* Avoid stealing search focus across splits

* Generalize panel focus restore intent

* Unify split focus intent activation

* Address focus restore review feedback

* Yield inactive panel focus before restore

* Gate browser find focus retries by generation

* Avoid repeated browser focus invalidation

* Keep browser find ownership while find bar is open
2026-03-10 19:31:52 -07:00
austinpower1258
eea6cdc1bd works 2026-03-10 19:18:30 -07:00
Austin Wang
8fa1ca3a4d
Hide browser portal when terminal tab is active (#1130) 2026-03-09 17:24:58 -07:00
Austin Wang
c447bee602
Fix browser pane portal anchor sizing (#1094)
* Fix browser pane webview sizing

* Guard browser portal by pane ownership

* Keep browser portal frame during transient zero geometry

* Guard portal surfaces against duplicate hosts

* Defer terminal surface reflow during tab drags

* Fix browser panel pane ID unit tests
2026-03-09 13:28:05 -07:00
austinpower1258
52bd8cf16a Keep browser webviews alive during drag reparenting 2026-03-08 03:04:12 -07:00
austinpower1258
58f1f34466 Fix browser reattach after pane reparenting 2026-03-07 18:49:42 -08:00
Austin Wang
0c11bc17cd
Merge pull request #1043 from manaflow-ai/issue-1036-tooltip-tracking-area-crash
Fix tooltip tracking lifetime and shortcut lag
2026-03-07 03:05:48 -08:00
Lawrence Chen
e680f1de55
Add DEBUG logging for browser omnibar/content focus handoff (#910)
* Add browser focus debug logging around omnibar/content handoff

* Avoid release-only unused-value warnings in focus debug logs

* Add omnibar focus writer trace logs

* Fix omnibar tap focus race

* Stabilize omnibar focus state transitions

* Propagate event context into responder guard

* Fix webview pointer hit testing in focus guard

* Stop omnibar reacquire on pointer blur intent

* Blur omnibar on webview click intent

* Preserve pointer intent through webview focus handoff

* Restore page input focus after omnibar escape

* Fix omnibar escape focus handoff and restore retry

* Track editable focus for omnibar restore and improve test diagnostics

* Add omnibar focus tracker telemetry to failing UI test

* Wait for page readiness before seeding focused input in UI test setup

* Strengthen omnibar escape focus regression with post-click assertion

* Use deterministic window offsets for post-escape web input click test

* Always enforce webview responder on omnibar escape

* Harden omnibar focus restore and address PR review feedback

---------

Co-authored-by: tiffanysun1 <tiffanysun8@gmail.com>
2026-03-07 03:05:13 -08:00
austinpower1258
9e8a401e3c Fix tooltip tracking lifetime and shortcut lag 2026-03-07 01:46:02 -08:00
austinpower1258
d43d7d6a51 Fix drag hover redraw churn in hosted panes 2026-03-06 15:47:11 -08:00
austinpower1258
3874cac08e Merge origin/main into issue-969-browser-drag-top-drop-targets 2026-03-05 22:36:33 -08:00
Lawrence Chen
46e810fef2
Move rectApproximatelyEqual out of #if DEBUG in HostContainerView (#1000)
The function was defined inside a #if DEBUG block but called from
non-DEBUG code, breaking Release builds (nightly CI).
2026-03-05 22:18:48 -08:00
Austin Wang
138ed0e2f0
Merge pull request #990 from manaflow-ai/issue-983-browser-unfocusable-after-cmdr
Fix browser focus after dismissing the command palette by click
2026-03-05 22:17:06 -08:00
austinpower1258
2427a2a736 Fix browser portal anchor churn during pane drag 2026-03-05 21:55:26 -08:00
austinpower1258
44910d03e8 fix: preserve browser target lookup on palette dismiss 2026-03-05 21:29:58 -08:00
Austin Wang
15c7c0cc3c
Fix side-docked dev tools resize (#712)
* wip

* Fix side-docked dev tools resize
2026-03-05 21:28:31 -08:00
Lawrence Chen
e49e572505
Fix browser Cmd+F overlay clipping in portal mode (#916)
* Fix browser Cmd+F overlay clipping in portal mode

* Fix browser Cmd+F panel update regression

* Fix browser find overlay lifecycle and focus

* Extract regression test helpers for browser find guards

* Restore new-tab Cmd+F overlay and harden test helper

* Fix browser Cmd+F focus handoff race

* Fix browser Cmd+F focus loss across page load

* Address review feedback on browser find focus guards

* Add Cmd+F pane-switch regression UI tests

* Run Cmd+F pane-switch regressions from existing UI suite

* Restore browser find focus on pane refocus

* Stabilize Cmd+F pane-switch regressions with focus-state recorder

* Make autofocus race UI test wait on deterministic page signal

* Fix cmuxTests WebViewRepresentable init after browser search state param
2026-03-05 15:36:47 -08:00
Austin Wang
9b215eddab
Fix browser portal pane drag routing and uploads (#961) 2026-03-05 15:27:17 -08:00
atani
3a5bd8494c
fix: avoid NSTextView tracking loop in omnibar mouseDown (#928)
* fix: avoid NSTextView tracking loop in omnibar mouseDown (#917)

Replace the synthetic mouseUp timeout workaround with direct cursor
positioning via NSTextView.characterIndexForInsertion(at:). The previous
approach posted a fake mouseUp event via NSApp.postEvent after 3 seconds,
but the NSTextView tracking loop does not always dequeue events from the
application event queue when stuck in an infinite
NSTextLayoutManager.enumerateTextLayoutFragments cycle, so the hang
persisted.

The new approach bypasses super.mouseDown entirely when the field editor
is already active, positioning the cursor (or extending the selection
with Shift+click) without entering the tracking loop. Drag-to-select is
not supported in this code path, but for a single-line omnibar this is
an acceptable trade-off.

* fix: handle double-click, UTF-16 length, and shift-click anchor

Address review feedback:

- Forward double/triple-click events to editor.mouseDown(with:) to
  preserve word and line selection without entering NSTextField's
  tracking loop
- Use (editor.string as NSString).length instead of String.count for
  NSRange clamping (NSRange uses UTF-16 indices)
- Track shift-click anchor independently via shiftClickAnchor property
  to correctly handle bidirectional selection extension

* fix: reset shiftClickAnchor on keyDown to prevent stale anchor

Clear the shift-click selection anchor whenever a key is pressed, so
that keyboard navigation (arrow keys, Shift+arrow, Home/End, etc.)
properly invalidates the mouse-originated anchor. A subsequent
Shift+click will then use the current selection position as anchor
instead of a stale value from a prior mouse interaction.

* fix: reset shiftClickAnchor in performKeyEquivalent and on re-focus

Key equivalents (Cmd+A, Cmd+V, etc.) bypass keyDown and go through
performKeyEquivalent, so the anchor must also be cleared there.
Similarly, re-focusing the field (currentEditor() == nil path) should
reset the anchor since selectAll changes the selection state.
2026-03-05 02:31:23 -08:00
Lawrence Chen
28977c8e3b
Fix browser panel lifecycle after WebContent process termination (#892)
* Fix browser panel webview lifecycle after web content crashes

* Fix BrowserPanel observer lifecycle during webview replacement

* Fix WebKit termination delegate and harden lifecycle regression check
2026-03-04 16:23:22 -08:00
Yoshiki Agatsuma
76bdf7631a
Add find-in-page (Cmd+F) for browser panels (#837) (#875)
JavaScript-based find using TreeWalker + <mark> highlights with
match counter, next/previous navigation, and drag-to-corner overlay
matching the existing terminal find bar.

- BrowserFindJavaScript: JS generation for search/next/prev/clear
- BrowserSearchOverlay: SwiftUI overlay with IME-safe onSubmit
- BrowserSearchState: Observable state (needle/selected/total)
- TabManager routing: Cmd+F/G dispatches to browser when focused
- Visibility filter: skips script/style/hidden/aria-hidden elements
- Stale DOM guard: isConnected check in next/previous scripts
- Navigation cleanup: clears find on didFinish and didFailNavigation

Co-authored-by: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com>
2026-03-04 16:15:15 -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
Yoshiki Agatsuma
a4bf2214fe
Fix browser address bar Japanese IME input (#789) (#867)
* Fix browser address bar Japanese IME input (#789)

* Remove redundant comments
2026-03-04 14:32:52 -08:00
Lawrence Chen
bc1b6fd9eb
Honor Ghostty background-opacity across all cmux chrome (#667)
* Honor Ghostty background-opacity across all cmux chrome

Parse background-opacity from Ghostty config and propagate it through
the entire chrome pipeline: bonsplit tab bar (via RRGGBBAA hex),
browser panel/omnibar, titlebar, empty panel, and window background.

Decouple glass effect from sidebar blend mode — bgGlassEnabled now
defaults to false so opacity works independently. Add
GhosttyBackgroundTheme helper for consistent color+opacity resolution
across all UI surfaces.

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

* Titlebar and chrome opacity matches terminal background-opacity

Use CALayer-level opacity for the titlebar background instead of SwiftUI
Color alpha, matching the terminal's Metal compositing path. Account for
the double alpha stacking in the terminal area (Bonsplit container bg +
Ghostty renderer) so the titlebar visually matches.

Also fix opacity-only config changes not triggering titlebar refresh on
Cmd+Shift+, reload.
2026-03-01 03:48:46 -08:00
Lawrence Chen
1392bd16d7 Revert "Use workspace color for notification ring and selection bar (#664)"
This reverts commit 4bfe95d125.
2026-02-27 18:24:51 -08:00
Lawrence Chen
4bfe95d125
Use workspace color for notification ring and selection bar (#664)
- Notification/focus flash uses workspace customColor (fallback: accent)
- Selection bar/indicator uses workspace customColor when set
- Flash color propagated through Panel.triggerFlash(color:) API
- Browser panel flash overlay uses workspace color
- Regression tests for flash color resolution

Fixes https://github.com/manaflow-ai/cmux/issues/557
2026-02-27 18:14:19 -08:00
Lawrence Chen
f28eb00b31 Merge remote-tracking branch 'origin/main' into feature/sidebar-pr-metadata
# Conflicts:
#	Sources/ContentView.swift
#	Sources/Workspace.swift
2026-02-24 20:49:29 -08:00
Lawrence Chen
2877531ea2
Auto-focus omnibar when focusing blank browser surfaces (#448)
* Auto-focus omnibar when focusing blank browser surfaces

* Fix browser omnibar autofocus across pane and palette paths

* Fix Cmd+P switcher omnibar autofocus timing
2026-02-24 16:00:03 -08:00
Lawrence Chen
653c59a90b
Merge pull request #437 from manaflow-ai/task-sidebar-selected-workspace-colors
Sidebar: set selected workspace colors and white text
2026-02-24 14:24:46 -08:00
Lawrence Chen
aeda5f827d Adopt custom blue accent across active UI states 2026-02-24 14:22:58 -08:00
Lawrence Chen
c56ef67750 Fix browser chrome contrast for mixed light/dark themes 2026-02-24 14:05:45 -08:00
Lawrence Chen
1893fc4c7a
Use native WebKit middle-click handling for browser links (#416)
* Add middle-click debug logging for browser links

* Handle browser middle-click via native WebKit actions

* Fix flaky middle-click new-tab detection in browser
2026-02-23 23:09:36 -08:00
Lawrence Chen
5f38178f85
Merge pull request #408 from manaflow-ai/issue-407-focus-swap-omnibar-command-palette
Fix omnibar/command-palette focus oscillation
2026-02-23 19:31:17 -08:00