From ec5bc934ca49296d560d545bd5c1feb1f2c6166a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Pantale=C3=A3o?= <5808343+bgoncal@users.noreply.github.com> Date: Fri, 19 Jun 2026 17:18:23 +0200 Subject: [PATCH 1/2] Fix macOS menu-bar icon not activating the main window The primary webView WindowGroup was the only scene missing handlesExternalEvents(matching:), so a scene activation request carrying targetContentIdentifier "ha.webview" (issued when tapping the menu-bar item with no open window) had no WindowGroup to bind to and no window appeared. Match the identifier here, consistent with the other groups. Co-Authored-By: Claude Opus 4.8 --- Sources/App/HAApp.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/App/HAApp.swift b/Sources/App/HAApp.swift index a1f1ae745..8a9553aa1 100644 --- a/Sources/App/HAApp.swift +++ b/Sources/App/HAApp.swift @@ -14,6 +14,11 @@ struct HAApp: App { .onOpenURL { handleIncoming(url: $0) } .onContinueUserActivity(NSUserActivityTypeBrowsingWeb) { handleIncoming(userActivity: $0) } } + // Without this, `activateAnyScene(for: .webView)` (e.g. tapping the macOS menu-bar item) requests a + // new scene carrying `targetContentIdentifier == "ha.webview"`; with no `WindowGroup` advertising that + // identifier SwiftUI can't bind the scene to a group and no window appears. Matching it here — like the + // other groups below — routes the activation to this group so the window becomes visible. + .handlesExternalEvents(matching: [SceneActivity.webView.activityIdentifier]) // Mac Settings WindowGroup { From c78f262a0d153535f1f5c7f7954c1f80601a8603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Pantale=C3=A3o=20Gon=C3=A7alves?= <5808343+bgoncal@users.noreply.github.com> Date: Fri, 19 Jun 2026 17:21:12 +0200 Subject: [PATCH 2/2] Remove unnecessary comment in HAApp.swift Remove comment explaining scene activation for web view. --- Sources/App/HAApp.swift | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Sources/App/HAApp.swift b/Sources/App/HAApp.swift index 8a9553aa1..38a27f1b3 100644 --- a/Sources/App/HAApp.swift +++ b/Sources/App/HAApp.swift @@ -14,10 +14,6 @@ struct HAApp: App { .onOpenURL { handleIncoming(url: $0) } .onContinueUserActivity(NSUserActivityTypeBrowsingWeb) { handleIncoming(userActivity: $0) } } - // Without this, `activateAnyScene(for: .webView)` (e.g. tapping the macOS menu-bar item) requests a - // new scene carrying `targetContentIdentifier == "ha.webview"`; with no `WindowGroup` advertising that - // identifier SwiftUI can't bind the scene to a group and no window appears. Matching it here — like the - // other groups below — routes the activation to this group so the window becomes visible. .handlesExternalEvents(matching: [SceneActivity.webView.activityIdentifier]) // Mac Settings