mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-04 23:21:40 +00:00
* fix(macos): stop dashboard windows flashing during reconnects * fix(macos): refresh native localization inventory
41 lines
1.3 KiB
Swift
41 lines
1.3 KiB
Swift
import AppKit
|
|
|
|
@MainActor
|
|
enum AppNavigationActions {
|
|
static func openDashboard() {
|
|
DashboardManager.shared.presentDashboard()
|
|
}
|
|
|
|
static func openChat(sessionKey: String? = nil, agentID: String? = nil, draft: String? = nil) {
|
|
NSApp.activate(ignoringOtherApps: true)
|
|
Task { @MainActor in
|
|
let resolvedSessionKey = if let sessionKey {
|
|
sessionKey
|
|
} else {
|
|
await WebChatManager.shared.preferredSessionKey()
|
|
}
|
|
WebChatManager.shared.show(sessionKey: resolvedSessionKey, agentID: agentID, draft: draft)
|
|
}
|
|
}
|
|
|
|
static func toggleCanvas() {
|
|
NSApp.activate(ignoringOtherApps: true)
|
|
Task { @MainActor in
|
|
if AppStateStore.shared.canvasPanelVisible {
|
|
CanvasManager.shared.hideAll()
|
|
} else {
|
|
let sessionKey = await GatewayConnection.shared.mainSessionKey()
|
|
_ = try? CanvasManager.shared.show(sessionKey: sessionKey, path: nil)
|
|
}
|
|
}
|
|
}
|
|
|
|
static func openSettings(tab: SettingsTab = .general) {
|
|
SettingsTabRouter.request(tab)
|
|
SettingsWindowOpener.shared.open()
|
|
DispatchQueue.main.async {
|
|
NotificationCenter.default.post(name: .openclawSelectSettingsTab, object: tab)
|
|
}
|
|
}
|
|
}
|