Skip to content
Closed
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d180c95
Prove global UI scale behavior before implementation
austinywang May 11, 2026
24d9816
Route cmux chrome through a persisted UI scale
austinywang May 11, 2026
d7183bf
Include UI scale files in build targets
austinywang May 11, 2026
ba866d0
Keep UI scale changes off hot event paths
austinywang May 11, 2026
529881f
Address UI scale review edge cases
austinywang May 11, 2026
00c2d1d
Reload UI scale settings on the main thread
austinywang May 11, 2026
bbe0885
Return UI scale shortcut handling result
austinywang May 11, 2026
8b83355
Keep UI scale regression tests compiling
austinywang May 11, 2026
2c75428
Honor UI scale review edge cases
austinywang May 11, 2026
7972849
Keep popover loading text on UI scale
austinywang May 11, 2026
d63c063
Remove unused direct UI scale persistence entrypoint
austinywang May 11, 2026
3356a9b
Prevent stale UI scale reloads during rapid changes
austinywang May 11, 2026
ff2b34b
Scale session popover transcript chrome
austinywang May 11, 2026
9285052
Preserve file explorer expansion while scaling
austinywang May 11, 2026
9aa4004
Preserve caption sizing under UI scale
austinywang May 11, 2026
0c0613e
Preserve editable UI scale config and chrome sizing
austinywang May 12, 2026
0498bce
Merge remote-tracking branch 'origin/main' into issue-3862-global-ui-…
austinywang May 12, 2026
d4ad407
Scale file explorer header height
austinywang May 12, 2026
85702aa
Avoid redundant file explorer scale layout
austinywang May 12, 2026
79db107
merge: sync issue-3862-global-ui-font-size with main
austinywang May 12, 2026
80746ab
Preserve dynamic settings subtitle scaling
austinywang May 12, 2026
30f0ae0
Refine UI scale persistence ownership
austinywang May 12, 2026
b689330
Harden UI scale settings writes
austinywang May 13, 2026
907f548
Extract UI scale JSONC editor
austinywang May 13, 2026
24e61fa
Fix UI scale persistence sendability warnings
austinywang May 13, 2026
ec342fe
Merge remote-tracking branch 'origin/main' into issue-3862-global-ui-…
austinywang May 13, 2026
dc1c435
Fix sidebar accessory scale merge
austinywang May 13, 2026
ac28cd0
Guard hidden transcript popover refresh
austinywang May 13, 2026
e2e0819
Merge main and address UI scale review feedback
austinywang May 14, 2026
3c25d7c
Merge remote-tracking branch 'origin/main' into issue-3862-global-ui-…
austinywang May 17, 2026
eb2263a
fix: preserve task manager macOS text styles
austinywang May 17, 2026
786b166
fix: scale right sidebar mode controls consistently
austinywang May 17, 2026
624e8d6
fix: scale unread badge container
austinywang May 18, 2026
8cebb47
merge: resolve conflicts with main
austinywang May 19, 2026
9228263
fix: scale session index chrome metrics
austinywang May 19, 2026
e10f9d4
merge: sync main and address UI scale feedback
austinywang May 19, 2026
3073f4a
fix: preserve pending UI scale during reload
austinywang May 19, 2026
a1d8e3e
fix: localize UI scale strings
austinywang May 19, 2026
b4f4a84
fix: preserve managed UI scale changes
austinywang May 19, 2026
e50dbd6
fix: skip stale UI scale writes
austinywang May 19, 2026
dbe6177
fix: clear UI scale sendability warnings
austinywang May 19, 2026
86bdab4
Merge remote-tracking branch 'origin/main' into issue-3862-global-ui-…
austinywang May 19, 2026
058d95b
fix: avoid UserDefaults capture in UI scale writer
austinywang May 19, 2026
69ee9df
Merge branch 'main' of https://github.com/manaflow-ai/cmux into issue…
austinywang May 22, 2026
15a356f
fix: update task manager ui scale wrapper for observation
austinywang May 22, 2026
110095c
merge: sync main into global UI font size
austinywang May 22, 2026
9a5c681
fix: address ui scale review feedback
austinywang May 22, 2026
5da03c9
fix: pass ui scale in session popover tests
austinywang May 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
220 changes: 218 additions & 2 deletions Resources/Localizable.xcstrings

Large diffs are not rendered by default.

77 changes: 69 additions & 8 deletions Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ func cmuxJavaScriptStringLiteral(_ value: String?) -> String? {
return String(arrayLiteral.dropFirst().dropLast())
}

private struct MainWindowUIScaleRoot<Content: View>: View {
@AppStorage(UIScaleSettings.userDefaultsKey) private var uiScaleRaw = UIScaleSettings.defaultValue

let content: Content

var body: some View {
content
.environment(\.uiScaleFactor, UIScaleSettings.clamped(uiScaleRaw))
}
}

private struct MultiWindowRouteCLIResult {
let status: String
let stdout: String
Expand Down Expand Up @@ -7324,13 +7335,15 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
}
#endif

let root = ContentView(updateViewModel: updateViewModel, windowId: windowId)
.environmentObject(tabManager)
.environmentObject(notificationStore)
.environmentObject(sidebarState)
.environmentObject(sidebarSelectionState)
.environmentObject(fileExplorerState)
.environmentObject(cmuxConfigStore)
let root = MainWindowUIScaleRoot(
content: ContentView(updateViewModel: updateViewModel, windowId: windowId)
.environmentObject(tabManager)
.environmentObject(notificationStore)
.environmentObject(sidebarState)
.environmentObject(sidebarSelectionState)
.environmentObject(fileExplorerState)
.environmentObject(cmuxConfigStore)
)

// Use the current key window's size for new windows so Cmd+Shift+N
// creates a window matching the previous one's dimensions.
Expand Down Expand Up @@ -11526,6 +11539,11 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
return false
}

if !isCommandPaletteBlockingUIScaleShortcut(for: event),
handleUIScaleShortcut(event: event) {
return true
}

let normalizedFlags = flags.subtracting([.numericPad, .function, .capsLock])
let commandPaletteTargetWindow = commandPaletteWindowForShortcutEvent(event)
let commandPaletteShortcutWindow = shouldHandleCommandPaletteShortcutEvent(
Expand Down Expand Up @@ -13297,8 +13315,45 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
return true
}

/// Keep UI scale shortcuts app-global even when focused AppKit views bypass SwiftUI menus.
@discardableResult
func handleUIScaleKeyEquivalent(_ event: NSEvent) -> Bool {
guard !isCommandPaletteBlockingUIScaleShortcut(for: event) else {
return false
}
return handleUIScaleShortcut(event: event)
}

private func handleUIScaleShortcut(event: NSEvent) -> Bool {
if matchConfiguredShortcut(event: event, action: .uiScaleZoomIn) {
UIScaleSettings.zoomIn()
return true
}
if matchConfiguredShortcut(event: event, action: .uiScaleZoomOut) {
UIScaleSettings.zoomOut()
return true
}
if matchConfiguredShortcut(event: event, action: .uiScaleReset) {
UIScaleSettings.reset()
return true
}
return false
}
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved

private func isCommandPaletteBlockingUIScaleShortcut(for event: NSEvent) -> Bool {
if let targetWindow = commandPaletteWindowForShortcutEvent(event),
isCommandPaletteEffectivelyVisible(in: targetWindow) {
return true
}
if let activePaletteWindow = activeCommandPaletteWindow(),
isCommandPaletteEffectivelyVisible(in: activePaletteWindow) {
return true
}
return false
}

/// Allow AppKit-backed browser surfaces (WKWebView) to route non-menu shortcuts
/// through the same app-level shortcut handler used by the local key monitor.
/// through the same app-level shortcut handler used by the local NSEvent monitor.
@discardableResult
func handleBrowserSurfaceKeyEquivalent(_ event: NSEvent) -> Bool {
handleConfiguredShortcutKeyEquivalent(event)
Expand Down Expand Up @@ -15594,6 +15649,12 @@ private extension NSWindow {
)
return true
}
if AppDelegate.shared?.handleUIScaleKeyEquivalent(event) == true {
#if DEBUG
cmuxDebugLog(" → consumed by handleUIScaleKeyEquivalent")
#endif
return true
}
if AppDelegate.shared?.shouldSuppressStaleCmuxMenuShortcut(event: event) == true {
if AppDelegate.shared?.handleConfiguredShortcutKeyEquivalent(event) == true {
#if DEBUG
Expand Down
Loading
Loading