fix(mac): restore session usage bar

This commit is contained in:
Peter Steinberger
2025-12-22 20:14:54 +01:00
parent 3412ff7003
commit f24d8473b1
3 changed files with 6 additions and 43 deletions

View File

@@ -34,12 +34,6 @@ enum SessionActions {
_ = try await ControlChannel.shared.request(method: "sessions.patch", params: params)
}
static func createSession(key: String) async throws {
_ = try await ControlChannel.shared.request(
method: "sessions.patch",
params: ["key": AnyHashable(key)])
}
static func resetSession(key: String) async throws {
_ = try await ControlChannel.shared.request(
method: "sessions.reset",
@@ -69,23 +63,6 @@ enum SessionActions {
return alert.runModal() == .alertFirstButtonReturn
}
@MainActor
static func promptForSessionKey() -> String? {
let alert = NSAlert()
alert.messageText = "New Session"
alert.informativeText = "Create a new session key (e.g. \"main\", \"group:dev\", \"scratch\")."
let field = NSTextField(frame: NSRect(x: 0, y: 0, width: 280, height: 24))
field.placeholderString = "session key"
alert.accessoryView = field
alert.addButton(withTitle: "Create")
alert.addButton(withTitle: "Cancel")
alert.alertStyle = .informational
let result = alert.runModal()
guard result == .alertFirstButtonReturn else { return nil }
let trimmed = field.stringValue.trimmingCharacters(in: .whitespacesAndNewlines)
return trimmed.isEmpty ? nil : trimmed
}
@MainActor
static func presentError(title: String, error: Error) {
let alert = NSAlert()
@@ -130,4 +107,3 @@ enum SessionActions {
NSWorkspace.shared.activateFileViewerSelecting([url])
}
}