Commit graph

64 commits

Author SHA1 Message Date
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
Lawrence Chen
05101a1a10 Fix light theme omnibar suggestions popover styling 2026-02-23 19:06:50 -08:00
Lawrence Chen
88c1dbc5d6 Fix omnibar focus thrash when another text field takes focus 2026-02-23 19:00:01 -08:00
Lawrence Chen
82ef5b8f6e Move omnibar suggestions popover up 1px 2026-02-23 18:51:32 -08:00
Lawrence Chen
b87d4fecda Move omnibar suggestions popover up by 2px 2026-02-23 18:43:39 -08:00
Lawrence Chen
ed0dd1ccb7 Make omnibar suggestions popup/rows squircle 2026-02-23 18:39:58 -08:00
Lawrence Chen
cfce7e93e0 Darken omnibar pill relative to theme background 2026-02-23 17:08:46 -08:00
Lawrence Chen
0d03b58be8 Tune omnibar pill tint toward theme background 2026-02-23 17:02:19 -08:00
Lawrence Chen
0eef387d5d Tint browser omnibar pill with theme accent 2026-02-23 15:55:01 -08:00
Lawrence Chen
561f052fdd Use theme background for browser omnibar chrome in light mode 2026-02-23 15:31:24 -08:00
Austin Wang
3c1f1792c0
Fix browser workspace focus handoff lag (#381) 2026-02-23 10:27:04 -08:00
Lawrence Chen
2499ba1bb2
Fix browser-surface click focus without regressing open (#355)
* Allow click-to-focus for unfocused browser surfaces

* Add browser click-focus diagnostics and guard fix

* Allow pointer-initiated browser focus through responder guard
2026-02-23 03:09:19 -08:00
Lawrence Chen
e4379a136c Match terminal flash ring padding to browser 2026-02-23 02:37:48 -08:00
Lawrence Chen
a3f3e20d72 Unify Cmd+Shift+H flash path across panel types 2026-02-23 02:31:22 -08:00
Lawrence Chen
1d71303d18
Merge pull request #331 from manaflow-ai/task-307-configurable-open-wrapper
Respect open-wrapper browser settings and preserve PR 307 history
2026-02-22 19:38:17 -08:00
Lawrence Chen
a369cf4419 Prevent background webview autofocus from stealing focus 2026-02-22 19:13:15 -08:00
Vadim Kostin
a33e231c79 fix(browser): avoid unavailable symbolColorRenderingMode API 2026-02-23 10:52:21 +08:00
Lawrence Chen
af2b276e98 Make browser omnibar squircle 2026-02-22 18:36:27 -08:00
Lawrence Chen
d496a07a84
Hide new-tab toggles and align dark-mode button styling (#322)
* Hide new-tab browser toggles and align dark-mode button style

* Switch forced dark mode from dimming overlay to dark theme

* Add tri-state browser theme mode for embedded web view

* Hide browser theme menu chevron in toolbar

* Use outline icons for browser theme toggle

* Align browser theme icon tint with DevTools button

* Force monochrome rendering for browser toolbar icons

* Reduce browser theme icon weight for visual parity

* Tune browser theme icon stroke for perceptual color match

* Force flat SF Symbol color rendering for toolbar icons

* Use button popover for browser theme selector
2026-02-22 17:41:10 -08:00
Lawrence Chen
07796232d7 Sync customizable shortcuts across menus and tooltips 2026-02-22 16:24:43 -08:00
Austin Wang
fb2ae855db
Light mode (#258) 2026-02-21 15:39:25 -08:00
Lawrence Chen
8ac554fb06
Follow up PR 242: refresh browser under-page background on theme updates (#272)
* Address PR 242 follow-ups for titlebar and browser background

* Restore titlebar border per follow-up scope

* Refresh browser under-page color with Ghostty opacity

* Browser: theme blank page fallback for about:blank

* Browser: keep new tabs webview-less until first nav
2026-02-21 05:30:21 -08:00
Lawrence Chen
ed0d246039
Slim browser omnibar and add button hover/press states (#271) 2026-02-21 04:39:27 -08:00
Lawrence Chen
685996ef0d
Remove border below titlebar (#242)
* Remove border below titlebar

Remove the 1px separator line overlay at the bottom of the custom
titlebar and its associated fakeTitlebarSeparatorColor computed property.

* Remove tab hover background in bonsplit

Update bonsplit submodule to remove the background fill on hovered
non-selected tabs.

* Restore titlebar border with system separator color, hover bg on all tabs, browser theme bg

- Add back 1px bottom border on titlebar using NSColor.separatorColor
  (matches bonsplit tab separator color)
- Tab hover background now applies to all tabs including the selected one
- Browser address bar and under-page background now use Ghostty theme
  background color instead of window background
2026-02-21 04:31:55 -08:00
Austin Wang
021cc05cf3
Stabilize sidebar resizer hitbox and cursor across portals (#255) 2026-02-20 23:14:48 -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
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
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
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