From e53d1c7d863df3745aaa64cd522057f72b2cabb9 Mon Sep 17 00:00:00 2001 From: Axel Courty Date: Sun, 17 May 2026 19:40:54 +0200 Subject: [PATCH 1/2] Clean up 4 Swift 6 forward-compat warnings (FocusModeManager + MusicManager) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pré-requis pour passer le projet en Swift 6 strict mode plus tard. Compile en Swift 5 sans changement de comportement runtime. - FocusModeManager.isSandboxed : `nonisolated` ajouté. La classe est @MainActor mais ce static est lu par `runProcessDetached` qui est nonisolated. ProcessInfo.environment est thread-safe, init au premier accès est sûr. - MusicManager.updateArtwork : re-capture [weak self] dans le bloc MainActor.run au lieu de laisser le `self?` traverser deux frontières de closure (Task.detached nonisolated → MainActor.run main). - MusicManager.startShuffleRepeatPoll : wrap forceUpdate() dans Task { @MainActor in ... }. Le callback Timer est nonisolated même si la RunLoop est main — l'isolation explicite évite l'erreur Swift 6. Co-Authored-By: Claude Opus 4.7 --- NotchIA/managers/FocusModeManager.swift | 7 ++++++- NotchIA/managers/MusicManager.swift | 19 +++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/NotchIA/managers/FocusModeManager.swift b/NotchIA/managers/FocusModeManager.swift index 155243a..6bbfc32 100644 --- a/NotchIA/managers/FocusModeManager.swift +++ b/NotchIA/managers/FocusModeManager.swift @@ -931,7 +931,12 @@ final class ScreenRecordingManager: ObservableObject { // Process spawning is blocked by app-sandbox, so we skip the replayd/lsof path entirely // when sandboxed. Filesystem monitoring of the scratch dir is the sandbox-compatible signal. - private static let isSandboxed: Bool = { + // + // `nonisolated` requis : la classe est `@MainActor` donc ce static le serait + // implicitement, mais `runProcessDetached` (juste en-dessous) est `nonisolated` + // et doit pouvoir le lire. `ProcessInfo.environment` est thread-safe donc + // l'initialisation au premier accès est sûre depuis n'importe quel thread. + nonisolated private static let isSandboxed: Bool = { ProcessInfo.processInfo.environment["APP_SANDBOX_CONTAINER_ID"] != nil }() diff --git a/NotchIA/managers/MusicManager.swift b/NotchIA/managers/MusicManager.swift index a010ade..9bdbf42 100644 --- a/NotchIA/managers/MusicManager.swift +++ b/NotchIA/managers/MusicManager.swift @@ -586,11 +586,16 @@ class MusicManager: ObservableObject { private func updateArtwork(_ artworkData: Data) { // Decode artwork off the main actor, hop back on to mutate state. + // Re-capture [weak self] dans le bloc MainActor.run pour éviter le + // warning Swift 6 "reference to captured var 'self' in concurrently- + // executing code" — le `self?` traversait deux frontières de closure + // (Task.detached nonisolated → MainActor.run main). Task.detached(priority: .userInitiated) { [weak self] in guard let artworkImage = NSImage(data: artworkData) else { return } - await MainActor.run { - self?.usingAppIconForArtwork = false - self?.updateAlbumArt(newAlbumArt: artworkImage) + await MainActor.run { [weak self] in + guard let self else { return } + self.usingAppIconForArtwork = false + self.updateAlbumArt(newAlbumArt: artworkImage) } } } @@ -763,7 +768,13 @@ class MusicManager: ObservableObject { private func startShuffleRepeatPoll() { shuffleRepeatPollTimer?.invalidate() shuffleRepeatPollTimer = Timer.scheduledTimer(withTimeInterval: 2.5, repeats: true) { [weak self] _ in - self?.forceUpdate() + // `forceUpdate()` est @MainActor — wrap dans Task { @MainActor in } + // pour respecter l'isolation (le callback Timer est nonisolated même + // si la RunLoop est main). Évite le warning Swift 6 "call to main + // actor-isolated instance method in a synchronous nonisolated context". + Task { @MainActor in + self?.forceUpdate() + } } } From f3cbac7e969b9fc3b71bbbfb433341e778bcd34d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 17 May 2026 17:45:45 +0000 Subject: [PATCH 2/2] Update version to v2.8.1 and appcast --- updater/appcast.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/updater/appcast.xml b/updater/appcast.xml index 6697850..e4fb87a 100644 --- a/updater/appcast.xml +++ b/updater/appcast.xml @@ -32,6 +32,16 @@ --> + + 2.8.1 + Sun, 17 May 2026 17:45:44 +0000 + https://github.com/coaxel2/NotchIA/releases + 20801 + 2.8.1 + 15.0 + + + 2.8.0 Sat, 16 May 2026 16:56:37 +0000 @@ -348,16 +358,6 @@ - - 2.7.7 - Thu, 07 May 2026 12:40:54 +0000 - https://github.com/coaxel2/NotchIA/releases - 27 - 2.7.7 - 15.0 - - - 2.7.4-beta5 Wed, 06 May 2026 18:55:17 +0000