From 9073a517873d75b76610e6efa6a3a74108a72028 Mon Sep 17 00:00:00 2001 From: SilverLABS Date: Sun, 5 Apr 2026 12:13:04 +0100 Subject: [PATCH] fix(build): resolve Xcode 26 compilation errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add ServerConfigView stub (referenced in SilverAppleApp.swift) - Add HardeningListView stub (referenced in DashboardView.swift) - Fix .accentColor → Color.accentColor (ShapeStyle removed member) - Fix withCheckedThrowingContinuation explicit type annotation - Make AppEnvironment.serverUrl internal for ServerConfigView access Co-Authored-By: Claude Sonnet 4.6 --- SilverApple/App/AppEnvironment.swift | 2 +- SilverApple/Auth/PassportAuthService.swift | 2 +- .../Hardening/Views/HardeningListView.swift | 16 ++++++++++ .../Onboarding/Views/MDMEnrollmentView.swift | 2 +- .../Settings/Views/ServerConfigView.swift | 29 +++++++++++++++++++ 5 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 SilverApple/Hardening/Views/HardeningListView.swift create mode 100644 SilverApple/Settings/Views/ServerConfigView.swift diff --git a/SilverApple/App/AppEnvironment.swift b/SilverApple/App/AppEnvironment.swift index 5571929..7cddcda 100644 --- a/SilverApple/App/AppEnvironment.swift +++ b/SilverApple/App/AppEnvironment.swift @@ -12,7 +12,7 @@ final class AppEnvironment: ObservableObject { let apiClient: SilverAPIClient let mdmService: MDMEnrollmentService - private var serverUrl: String { + var serverUrl: String { UserDefaults.standard.string(forKey: "silverapple.serverUrl") ?? "" } diff --git a/SilverApple/Auth/PassportAuthService.swift b/SilverApple/Auth/PassportAuthService.swift index 11cf8c7..a61ca67 100644 --- a/SilverApple/Auth/PassportAuthService.swift +++ b/SilverApple/Auth/PassportAuthService.swift @@ -28,7 +28,7 @@ final class PassportAuthService: NSObject, ObservableObject, ASWebAuthentication let authUrl = buildAuthURL(challenge: challenge) - let callbackUrl = try await withCheckedThrowingContinuation { continuation in + let callbackUrl: URL = try await withCheckedThrowingContinuation { (continuation: CheckedContinuation) in let session = ASWebAuthenticationSession(url: authUrl, callbackURLScheme: "silverapple") { url, error in if let error { continuation.resume(throwing: error); return } guard let url else { continuation.resume(throwing: AuthError.noCallback); return } diff --git a/SilverApple/Hardening/Views/HardeningListView.swift b/SilverApple/Hardening/Views/HardeningListView.swift new file mode 100644 index 0000000..4134ba9 --- /dev/null +++ b/SilverApple/Hardening/Views/HardeningListView.swift @@ -0,0 +1,16 @@ +import SwiftUI + +struct HardeningListView: View { + var body: some View { + NavigationStack { + List { + Section { + Label("Privacy hardening checks coming soon.", systemImage: "lock.shield") + .foregroundStyle(.secondary) + .font(.subheadline) + } + } + .navigationTitle("Hardening") + } + } +} diff --git a/SilverApple/Onboarding/Views/MDMEnrollmentView.swift b/SilverApple/Onboarding/Views/MDMEnrollmentView.swift index dca987d..6d30b13 100644 --- a/SilverApple/Onboarding/Views/MDMEnrollmentView.swift +++ b/SilverApple/Onboarding/Views/MDMEnrollmentView.swift @@ -15,7 +15,7 @@ struct MDMEnrollmentView: View { VStack(spacing: 32) { Image(systemName: "iphone.badge.play") .font(.system(size: 56)) - .foregroundStyle(.accentColor) + .foregroundStyle(Color.accentColor) VStack(spacing: 12) { Text("Device Management") diff --git a/SilverApple/Settings/Views/ServerConfigView.swift b/SilverApple/Settings/Views/ServerConfigView.swift new file mode 100644 index 0000000..5b82d7c --- /dev/null +++ b/SilverApple/Settings/Views/ServerConfigView.swift @@ -0,0 +1,29 @@ +import SwiftUI + +struct ServerConfigView: View { + @EnvironmentObject var env: AppEnvironment + + var body: some View { + NavigationStack { + List { + Section("Server") { + HStack { + Text("URL") + Spacer() + Text(env.serverUrl.isEmpty ? "Not configured" : env.serverUrl) + .foregroundStyle(.secondary) + .lineLimit(1) + .truncationMode(.middle) + } + } + + Section { + Button("Sign Out", role: .destructive) { + env.authService.signOut() + } + } + } + .navigationTitle("Settings") + } + } +}