From 3095bd106af697490fe5ecb7ca52b7dfe6b33f62 Mon Sep 17 00:00:00 2001 From: Gronod Date: Tue, 8 Sep 2026 15:18:07 +0100 Subject: [PATCH] fix(ui): restore Alerts sidebar row selection by replacing .badge (fixes #34) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Applying .badge after .tag on a List(selection:) row wrapped the tagged label in a view that no longer carried the tag, making the "Alerts & Notifications" row unselectable on macOS 14. Replaced with an explicit Label + HStack row showing the active-alert count as a styled capsule — tag stays on the row, count still renders when alerts are active. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- Sources/UI/ContentView.swift | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Sources/UI/ContentView.swift b/Sources/UI/ContentView.swift index 24420af..5e76b6f 100644 --- a/Sources/UI/ContentView.swift +++ b/Sources/UI/ContentView.swift @@ -87,9 +87,25 @@ public struct ContentView: View { } Section("Intelligence") { - Label("Alerts & Notifications", systemImage: "bell.badge") - .tag("Alerts") - .badge(store.alertEngine.activeAlerts.isEmpty ? nil : Text("\(store.alertEngine.activeAlerts.count)")) + // Custom row instead of .badge() — a badge applied after .tag + // detaches the tag from the list row and makes it unselectable. + Label { + HStack { + Text("Alerts & Notifications") + Spacer() + if !store.alertEngine.activeAlerts.isEmpty { + Text("\(store.alertEngine.activeAlerts.count)") + .font(.caption2.weight(.semibold)) + .padding(.horizontal, 6) + .padding(.vertical, 2) + .background(Color.red.opacity(0.85), in: Capsule()) + .foregroundStyle(.white) + } + } + } icon: { + Image(systemName: "bell.badge") + } + .tag("Alerts") } } .listStyle(.sidebar) -- 2.39.5