8 Commits
Author SHA1 Message Date
gronod 070cf67796 Merge pull request 'fix(ui): Remove Deployment Target attribute from Host Architecture view' (#58) from fix/remove-deployment-target-ui into develop 2026-10-01 13:23:40 +01:00
gronod e68a053740 fix(ui): Remove Deployment Target display from Host Architecture view 2026-10-01 13:23:03 +01:00
gronod 05669f1b41 Merge pull request 'fix: Type string interpolations in ContentView for Swift 5.7 compatibility' (#57) from hotfix/macos12-string-interpolation into develop
MacMonitor CI/CD Pipeline / Build & Test (Intel x86_64) (push) Successful in 1m13s
MacMonitor CI/CD Pipeline / Package Release Artifact (push) Successful in 1m11s
2026-10-01 12:57:05 +01:00
gronod 8dafffdd6e fix: Type string interpolations in ContentView for Swift 5.7 compatibility 2026-10-01 12:56:45 +01:00
gronod 68e6df2938 Merge pull request 'fix: Isolate views to @MainActor and use @ObservedObject for Swift 5.7 compatibility' (#56) from hotfix/macos12-mainactor-views into develop
MacMonitor CI/CD Pipeline / Build & Test (Intel x86_64) (push) Failing after 20s
MacMonitor CI/CD Pipeline / Package Release Artifact (push) Skipped
2026-10-01 12:53:48 +01:00
gronod 7473e95635 fix: Isolate views to @MainActor and use @ObservedObject for Swift 5.7 compatibility 2026-10-01 12:53:17 +01:00
gronod 57e2ddd225 Merge pull request 'fix: Replace Swift 5.9 switch expression for Xcode 14 compatibility' (#55) from hotfix/macos12-switch-expr into develop
MacMonitor CI/CD Pipeline / Build & Test (Intel x86_64) (push) Failing after 13s
MacMonitor CI/CD Pipeline / Package Release Artifact (push) Skipped
2026-10-01 12:45:41 +01:00
gronod 33bee371f1 fix: Replace Swift 5.9 switch expression for Xcode 14 compatibility 2026-10-01 12:45:11 +01:00
6 changed files with 22 additions and 11 deletions
@@ -118,11 +118,12 @@ public final class UNAlertNotificationDispatcher: NSObject, AlertNotificationDis
didReceive response: UNNotificationResponse, didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void withCompletionHandler completionHandler: @escaping () -> Void
) { ) {
let targetTab: String? = switch response.actionIdentifier { let targetTab: String?
switch response.actionIdentifier {
case AlertNotificationAction.viewProcessesIdentifier: case AlertNotificationAction.viewProcessesIdentifier:
"Processes" targetTab = "Processes"
default: default:
nil targetTab = nil
} }
Task { @MainActor in Task { @MainActor in
AppNavigationBus.shared.request(tab: targetTab) AppNavigationBus.shared.request(tab: targetTab)
+2 -1
View File
@@ -4,8 +4,9 @@ import SwiftUI
/// Sidebar tab showing currently breached thresholds and the in-app /// Sidebar tab showing currently breached thresholds and the in-app
/// alert history log maintained by `AlertEngine`. /// alert history log maintained by `AlertEngine`.
@MainActor
public struct AlertsView: View { public struct AlertsView: View {
@State private var engine = AlertEngine.shared @ObservedObject private var engine = AlertEngine.shared
public init() {} public init() {}
+12 -6
View File
@@ -1,5 +1,6 @@
import SwiftUI import SwiftUI
@MainActor
public struct ContentView: View { public struct ContentView: View {
@StateObject private var store = SystemTelemetryStore.shared @StateObject private var store = SystemTelemetryStore.shared
@State private var selectedTab: String? = "Dashboard" @State private var selectedTab: String? = "Dashboard"
@@ -168,7 +169,7 @@ public struct ContentView: View {
} }
.padding(24) .padding(24)
} }
.navigationTitle("MacMonitor — \(selectedTab)") .navigationTitle("MacMonitor — \(selectedTab ?? "Dashboard")")
} }
// MARK: - Dashboard Composite View // MARK: - Dashboard Composite View
@@ -1005,8 +1006,6 @@ public struct ContentView: View {
HStack { HStack {
Text("Target Architecture:").foregroundStyle(.secondary) Text("Target Architecture:").foregroundStyle(.secondary)
Text("Intel x86_64").bold() Text("Intel x86_64").bold()
Text("Deployment Target:").foregroundStyle(.secondary)
Text("macOS 14.0 (Sonoma)").bold()
} }
} }
} }
@@ -1220,6 +1219,7 @@ public struct ContentView: View {
} }
// MARK: - Process Detail Inspector Sheet // MARK: - Process Detail Inspector Sheet
@MainActor
struct ProcessDetailSheet: View { struct ProcessDetailSheet: View {
let inspector: MMProcessDetailInspector let inspector: MMProcessDetailInspector
let pid: Int32 let pid: Int32
@@ -1248,8 +1248,9 @@ struct ProcessDetailSheet: View {
if selectedDetailTab == "Threads" { if selectedDetailTab == "Threads" {
List(threads.indices, id: \.self) { idx in List(threads.indices, id: \.self) { idx in
let t = threads[idx] let t = threads[idx]
let threadID = "\(t["threadID"] ?? idx)"
HStack { HStack {
Text("Thread \(t["threadID"] ?? idx)").bold() Text("Thread \(threadID)").bold()
Spacer() Spacer()
Text("CPU: \(String(format: "%.1f%%", (t["cpuPercent"] as? Double) ?? 0.0))").monospacedDigit() Text("CPU: \(String(format: "%.1f%%", (t["cpuPercent"] as? Double) ?? 0.0))").monospacedDigit()
Text(t["state"] as? String ?? "").foregroundStyle(.secondary) Text(t["state"] as? String ?? "").foregroundStyle(.secondary)
@@ -1262,10 +1263,15 @@ struct ProcessDetailSheet: View {
} else { } else {
List(sockets.indices, id: \.self) { idx in List(sockets.indices, id: \.self) { idx in
let s = sockets[idx] let s = sockets[idx]
let proto = s["protocol"] as? String ?? "TCP"
let localAddr = (s["localAddress"] as? String) ?? ""
let localPort = (s["localPort"] as? Int) ?? 0
let remoteAddr = (s["remoteAddress"] as? String) ?? ""
let remotePort = (s["remotePort"] as? Int) ?? 0
HStack { HStack {
Text(s["protocol"] as? String ?? "TCP").bold() Text(proto).bold()
Spacer() Spacer()
Text("\(s["localAddress"] ?? ""):\(s["localPort"] ?? 0) → \(s["remoteAddress"] ?? ""):\(s["remotePort"] ?? 0)") Text("\(localAddr):\(localPort) → \(remoteAddr):\(remotePort)")
.mmMonospaced() .mmMonospaced()
Text(s["tcpState"] as? String ?? "").foregroundStyle(.secondary) Text(s["tcpState"] as? String ?? "").foregroundStyle(.secondary)
} }
@@ -1,7 +1,8 @@
import SwiftUI import SwiftUI
@MainActor
public struct QuickGlancePopoverView: View { public struct QuickGlancePopoverView: View {
var store: SystemTelemetryStore @ObservedObject var store: SystemTelemetryStore
public init(store: SystemTelemetryStore) { public init(store: SystemTelemetryStore) {
self.store = store self.store = store
@@ -5,6 +5,7 @@ import UserNotifications
/// Preferences UI for threshold alert rules. Bound directly to /// Preferences UI for threshold alert rules. Bound directly to
/// `AlertEngine.shared.configuration`, which auto-persists to `UserDefaults`. /// `AlertEngine.shared.configuration`, which auto-persists to `UserDefaults`.
@MainActor
public struct AlertsSettingsView: View { public struct AlertsSettingsView: View {
@ObservedObject private var engine = AlertEngine.shared @ObservedObject private var engine = AlertEngine.shared
@State private var authorizationStatus: UNAuthorizationStatus = .notDetermined @State private var authorizationStatus: UNAuthorizationStatus = .notDetermined
+1
View File
@@ -2,6 +2,7 @@ import XCTest
import SwiftUI import SwiftUI
@testable import MacMonitor @testable import MacMonitor
@MainActor
final class MMMenuBarTests: XCTestCase { final class MMMenuBarTests: XCTestCase {
func testMenuBarStatusViewInitialization() { func testMenuBarStatusViewInitialization() {