From 3e99e1417e5d0c3b081283519ee0ab764ce502ba Mon Sep 17 00:00:00 2001 From: superdooper86 Date: Thu, 7 May 2026 18:02:03 +0200 Subject: [PATCH] =?UTF-8?q?Release=20v1.1.0=20=E2=80=94=20always=20open=20?= =?UTF-8?q?to=20main=20window?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Post popoverWillOpen notification on show; ContentView resets showSettings on receive so reopening always lands on the main window, not Settings. --- ClaudeChecker/ClaudeCheckerApp.swift | 2 ++ ClaudeChecker/ContentView.swift | 3 +++ ClaudeChecker/Info.plist | 4 ++-- ClaudeChecker/UsageViewModel.swift | 1 + RELEASE_NOTES.md | 6 +++--- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ClaudeChecker/ClaudeCheckerApp.swift b/ClaudeChecker/ClaudeCheckerApp.swift index 52a773c..1181488 100644 --- a/ClaudeChecker/ClaudeCheckerApp.swift +++ b/ClaudeChecker/ClaudeCheckerApp.swift @@ -199,6 +199,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { @objc func showPopover() { guard let button = statusItem?.button, let popover else { return } if !popover.isShown { + NotificationCenter.default.post(name: .popoverWillOpen, object: nil) popover.show(relativeTo: button.bounds, of: button, preferredEdge: .minY) NSApp.activate(ignoringOtherApps: true) } @@ -209,6 +210,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { if popover.isShown { popover.performClose(nil) } else { + NotificationCenter.default.post(name: .popoverWillOpen, object: nil) popover.show(relativeTo: button.bounds, of: button, preferredEdge: .minY) NSApp.activate(ignoringOtherApps: true) } diff --git a/ClaudeChecker/ContentView.swift b/ClaudeChecker/ContentView.swift index b9b1cb0..0fef2b9 100644 --- a/ClaudeChecker/ContentView.swift +++ b/ClaudeChecker/ContentView.swift @@ -94,6 +94,9 @@ struct ContentView: View { } .frame(width: 480) .animation(.easeInOut(duration: 0.2), value: showSettings) + .onReceive(NotificationCenter.default.publisher(for: .popoverWillOpen)) { _ in + showSettings = false + } .onReceive(NotificationCenter.default.publisher(for: .openUpdateSheet)) { _ in showSettings = false showUpdateSheet = true diff --git a/ClaudeChecker/Info.plist b/ClaudeChecker/Info.plist index db4726a..a296b23 100644 --- a/ClaudeChecker/Info.plist +++ b/ClaudeChecker/Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.9 + 1.1.0 CFBundleVersion - 28 + 29 LSMinimumSystemVersion 13.0 LSUIElement diff --git a/ClaudeChecker/UsageViewModel.swift b/ClaudeChecker/UsageViewModel.swift index 160226d..8967c35 100644 --- a/ClaudeChecker/UsageViewModel.swift +++ b/ClaudeChecker/UsageViewModel.swift @@ -307,6 +307,7 @@ extension Notification.Name { static let refreshIntervalChanged = Notification.Name("refreshIntervalChanged") static let closePopover = Notification.Name("closePopover") static let showPopover = Notification.Name("showPopover") + static let popoverWillOpen = Notification.Name("popoverWillOpen") static let updateDetected = Notification.Name("updateDetected") static let limitWarning = Notification.Name("limitWarning") static let limitReset = Notification.Name("limitReset") diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 3816579..7f8ee64 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,4 +1,4 @@ -## What's new in v1.0.9 +## What's new in v1.1.0 -### Fixed update notification popup -The notification popup now correctly shows **"Tap to view release notes & update now!"** instead of the raw markdown release notes text. +### Main window always opens on click +Closing the app while Settings was open would cause the next click to reopen straight to Settings. The app now always returns to the main window when reopened.