Bug: 'Alerts & Notifications' sidebar row renders badge but is not selectable #34

Closed
opened 2026-09-08 14:49:29 +01:00 by gronod · 0 comments
Owner

Purpose

The sidebar's "Alerts & Notifications" row (Intelligence section, Sources/UI/ContentView.swift) renders correctly — including the active-alert count badge showing "1" — but clicking it does not navigate to the Alerts tab. The header warning pill works because it sets selectedTab = "Alerts" directly.

Suspected Root Cause

The row is declared as:

Label("Alerts & Notifications", systemImage: "bell.badge")
    .tag("Alerts")
    .badge(store.alertEngine.activeAlerts.isEmpty ? nil : Text("\(store.alertEngine.activeAlerts.count)"))

The conditional .badge(Text?) modifier applied after .tag inside List(selection: $selectedTab) likely interferes with row selection/tag association on macOS 14 — either by wrapping the label in a presentation context that detaches the tag, or by swallowing hit-testing.

Suggested Fix / Investigation

  • Verify whether .badge is the culprit (remove it → selection should work).
  • Alternatives that keep the count visible:
    • Embed the count in the label: Label("Alerts & Notifications (\(count))", ...) or an HStack row with a styled count Text.
    • Apply .badge before .tag, or move the badge to the row's Label title via Text concatenation.
    • Wrap row content explicitly: HStack { Label(...); Spacer(); if count>0 { Text(...) } }.tag("Alerts").contentShape(Rectangle()).
  • Stretch: make the active-alert cards in AlertsView actionable (tap → navigate to the relevant telemetry tab via AppNavigationBus), matching the "View Processes" notification action behavior.

Acceptance Criteria

  • Clicking the sidebar row navigates to the Alerts tab.
  • The active-alert count badge still renders when alerts exist and hides when clear.
  • (Stretch) Tapping an active alert navigates to the relevant section.

Dependencies

  • None.
### Purpose The sidebar's "Alerts & Notifications" row (Intelligence section, `Sources/UI/ContentView.swift`) renders correctly — including the active-alert count badge showing "1" — but clicking it does not navigate to the Alerts tab. The header warning pill works because it sets `selectedTab = "Alerts"` directly. ### Suspected Root Cause The row is declared as: ```swift Label("Alerts & Notifications", systemImage: "bell.badge") .tag("Alerts") .badge(store.alertEngine.activeAlerts.isEmpty ? nil : Text("\(store.alertEngine.activeAlerts.count)")) ``` The conditional `.badge(Text?)` modifier applied after `.tag` inside `List(selection: $selectedTab)` likely interferes with row selection/tag association on macOS 14 — either by wrapping the label in a presentation context that detaches the tag, or by swallowing hit-testing. ### Suggested Fix / Investigation - Verify whether `.badge` is the culprit (remove it → selection should work). - Alternatives that keep the count visible: - Embed the count in the label: `Label("Alerts & Notifications (\(count))", ...)` or an `HStack` row with a styled count `Text`. - Apply `.badge` before `.tag`, or move the badge to the row's `Label` title via `Text` concatenation. - Wrap row content explicitly: `HStack { Label(...); Spacer(); if count>0 { Text(...) } }.tag("Alerts").contentShape(Rectangle())`. - Stretch: make the active-alert cards in `AlertsView` actionable (tap → navigate to the relevant telemetry tab via `AppNavigationBus`), matching the "View Processes" notification action behavior. ### Acceptance Criteria - [ ] Clicking the sidebar row navigates to the Alerts tab. - [ ] The active-alert count badge still renders when alerts exist and hides when clear. - [ ] (Stretch) Tapping an active alert navigates to the relevant section. ### Dependencies - None.
gronod added this to the M6: Bugfix & Stability milestone 2026-09-08 14:49:30 +01:00
gronod added the Bug/UIKind/Bug
Priority
Medium
3
Project/Antigravity
labels 2026-09-08 14:49:35 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gronod/MacMonitor#34