From 4e7d905783a411e8bcc1757a3250985157b1724e Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 6 Dec 2025 02:08:25 +0100 Subject: [PATCH] mac: lock onboarding page width to 640 --- apps/macos/Sources/Clawdis/AppMain.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/macos/Sources/Clawdis/AppMain.swift b/apps/macos/Sources/Clawdis/AppMain.swift index 4eb76afba..27802fb34 100644 --- a/apps/macos/Sources/Clawdis/AppMain.swift +++ b/apps/macos/Sources/Clawdis/AppMain.swift @@ -1258,6 +1258,10 @@ final class VoiceWakeTester { throw NSError(domain: "VoiceWakeTester", code: 1, userInfo: [NSLocalizedDescriptionKey: "Speech recognition unavailable"]) } + guard Self.hasPrivacyStrings else { + throw NSError(domain: "VoiceWakeTester", code: 3, userInfo: [NSLocalizedDescriptionKey: "Missing mic/speech privacy strings. Rebuild the mac app (scripts/restart-mac.sh) to include usage descriptions."]) + } + let granted = try await Self.ensurePermissions() guard granted else { throw NSError(domain: "VoiceWakeTester", code: 2, userInfo: [NSLocalizedDescriptionKey: "Microphone or speech permission denied"]) @@ -1335,6 +1339,12 @@ final class VoiceWakeTester { return false } } + + private static var hasPrivacyStrings: Bool { + let speech = Bundle.main.object(forInfoDictionaryKey: "NSSpeechRecognitionUsageDescription") as? String + let mic = Bundle.main.object(forInfoDictionaryKey: "NSMicrophoneUsageDescription") as? String + return speech?.isEmpty == false && mic?.isEmpty == false + } } @MainActor @@ -2043,7 +2053,7 @@ struct OnboardingView: View { .interactiveSpring(response: 0.5, dampingFraction: 0.86, blendDuration: 0.25), value: currentPage ) - .frame(height: contentHeight, alignment: .top) + .frame(width: pageWidth, height: contentHeight, alignment: .top) .clipped() } .frame(height: 260)