From 35a25c3dc2a9c8d5fb1bee723143562aae34ca3d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 20 Dec 2025 21:17:32 +0100 Subject: [PATCH] refactor(macos): collapse control channel status --- .../Sources/Clawdis/GeneralSettings.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/macos/Sources/Clawdis/GeneralSettings.swift b/apps/macos/Sources/Clawdis/GeneralSettings.swift index 2f3f85106..fb26f4fc9 100644 --- a/apps/macos/Sources/Clawdis/GeneralSettings.swift +++ b/apps/macos/Sources/Clawdis/GeneralSettings.swift @@ -197,15 +197,15 @@ struct GeneralSettings: View { VStack(alignment: .leading, spacing: 4) { Text("Control channel") .font(.caption.weight(.semibold)) - if !self.isControlStatusDuplicate { - Text(self.controlStatusLine) - .font(.caption) - .foregroundStyle(.secondary) - } - if let ping = ControlChannel.shared.lastPingMs { - Text("Last ping: \(Int(ping)) ms") - .font(.caption) - .foregroundStyle(.secondary) + if !self.isControlStatusDuplicate || ControlChannel.shared.lastPingMs != nil { + let status = self.isControlStatusDuplicate ? nil : self.controlStatusLine + let ping = ControlChannel.shared.lastPingMs.map { "Ping \(Int($0)) ms" } + let line = [status, ping].compactMap { $0 }.joined(separator: " ยท ") + if !line.isEmpty { + Text(line) + .font(.caption) + .foregroundStyle(.secondary) + } } if let hb = HeartbeatStore.shared.lastEvent { let ageText = age(from: Date(timeIntervalSince1970: hb.ts / 1000))