refactor(macos): dedupe UI, pairing, and runtime helpers

This commit is contained in:
Peter Steinberger
2026-03-02 11:32:04 +00:00
parent cd011897d0
commit cf67e374c0
92 changed files with 1769 additions and 1802 deletions

View File

@@ -251,10 +251,7 @@ final class WebChatSwiftUIWindowController {
}
private func removeDismissMonitor() {
if let monitor = self.dismissMonitor {
NSEvent.removeMonitor(monitor)
self.dismissMonitor = nil
}
OverlayPanelFactory.clearGlobalEventMonitor(&self.dismissMonitor)
}
private static func makeWindow(
@@ -371,13 +368,6 @@ final class WebChatSwiftUIWindowController {
}
private static func color(fromHex raw: String?) -> Color? {
let trimmed = (raw ?? "").trimmingCharacters(in: .whitespacesAndNewlines)
guard !trimmed.isEmpty else { return nil }
let hex = trimmed.hasPrefix("#") ? String(trimmed.dropFirst()) : trimmed
guard hex.count == 6, let value = Int(hex, radix: 16) else { return nil }
let r = Double((value >> 16) & 0xFF) / 255.0
let g = Double((value >> 8) & 0xFF) / 255.0
let b = Double(value & 0xFF) / 255.0
return Color(red: r, green: g, blue: b)
ColorHexSupport.color(fromHex: raw)
}
}