From 26323c13dfcca42f9ce2dc5e51faa1a65acfc47a Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Tue, 9 Jun 2026 16:18:28 -0400 Subject: [PATCH] feat(bar-app): label settings clearly and confirm before quit Rename the footer 'Alerts' button to 'Settings' (gear icon) since it opens all preferences including the appearance/theme picker, which was undiscoverable behind an alerts label. Add a confirmation to the Quit button so a stray click no longer closes the whole menu-bar app with no easy way back. --- macos-bar/Sources/CCSBarApp/BarMenuView.swift | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/macos-bar/Sources/CCSBarApp/BarMenuView.swift b/macos-bar/Sources/CCSBarApp/BarMenuView.swift index bccc69dd..427c932a 100644 --- a/macos-bar/Sources/CCSBarApp/BarMenuView.swift +++ b/macos-bar/Sources/CCSBarApp/BarMenuView.swift @@ -9,6 +9,7 @@ struct BarMenuView: View { @ObservedObject var viewModel: BarViewModel /// Drives the preferences sheet from the footer gear. @State private var showingPrefs = false + @State private var confirmingQuit = false /// The prefs adapter the sheet edits; shares the standard suite with the /// view model so a write-through is visible on the next poll. private let prefs = BarPreferences() @@ -216,9 +217,9 @@ struct BarMenuView: View { Button { showingPrefs = true } label: { - Label("Alerts", systemImage: "bell.badge") + Label("Settings", systemImage: "gearshape") } - .help("Configure alerts and the menu-bar glance") + .help("Settings — appearance/theme, menu-bar glance, and alerts") Spacer() Button { viewModel.onOpen() @@ -226,12 +227,20 @@ struct BarMenuView: View { Image(systemName: "arrow.clockwise") } .help("Refresh") + // Quit confirms first — a stray click here previously closed the whole + // app (removing the menu-bar item) with no easy way back. Button { - NSApplication.shared.terminate(nil) + confirmingQuit = true } label: { Image(systemName: "power") } .help("Quit CCS Bar") + .confirmationDialog("Quit CCS Bar?", isPresented: $confirmingQuit) { + Button("Quit", role: .destructive) { NSApplication.shared.terminate(nil) } + Button("Cancel", role: .cancel) {} + } message: { + Text("This closes the menu-bar app. Reopen it from Applications.") + } } .buttonStyle(.borderless) .font(.caption)