From ebe40fb020f0f36bac8f0d2ae5b65b442b69fc55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Thu, 19 Feb 2026 16:50:14 +0800 Subject: [PATCH] Fix iCloud profile --- .../Views/Dashboard/Cards/ProfileCard.swift | 4 +-- .../Dashboard/Cards/ProfilePickerSheet.swift | 12 ++++----- .../Profile/ProfileType+Presentation.swift | 27 +++++++++++++++++++ Extension/Extension.entitlements | 12 --------- .../IntentsExtension.entitlements | 12 +++++++++ 5 files changed, 47 insertions(+), 20 deletions(-) create mode 100644 ApplicationLibrary/Views/Profile/ProfileType+Presentation.swift diff --git a/ApplicationLibrary/Views/Dashboard/Cards/ProfileCard.swift b/ApplicationLibrary/Views/Dashboard/Cards/ProfileCard.swift index 2e75e40..a33a157 100644 --- a/ApplicationLibrary/Views/Dashboard/Cards/ProfileCard.swift +++ b/ApplicationLibrary/Views/Dashboard/Cards/ProfileCard.swift @@ -436,10 +436,10 @@ public struct ProfileCard: View { private func profileInfo(for profile: ProfilePreview) -> some View { HStack(spacing: 8) { HStack(spacing: 4) { - Image(systemName: profile.type == .remote ? "cloud.fill" : "doc.fill") + Image(systemName: profile.type.presentationSymbol) .font(.system(size: 12)) .foregroundColor(.secondary) - Text(profile.type == .remote ? "Remote" : "Local") + Text(profile.type.presentationLabel) .font(.caption) .foregroundColor(.primary) } diff --git a/ApplicationLibrary/Views/Dashboard/Cards/ProfilePickerSheet.swift b/ApplicationLibrary/Views/Dashboard/Cards/ProfilePickerSheet.swift index 31d0515..faf0697 100644 --- a/ApplicationLibrary/Views/Dashboard/Cards/ProfilePickerSheet.swift +++ b/ApplicationLibrary/Views/Dashboard/Cards/ProfilePickerSheet.swift @@ -1025,10 +1025,10 @@ private struct ProfilePickerRow: View { private var profileInfo: some View { HStack(spacing: 8) { HStack(spacing: 4) { - Image(systemName: profile.type == .remote ? "cloud.fill" : "doc.fill") + Image(systemName: profile.type.presentationSymbol) .font(.system(size: 12)) .foregroundStyle(.secondary) - Text(profile.type == .remote ? "Remote" : "Local") + Text(profile.type.presentationLabel) .font(.caption) .foregroundStyle(.secondary) } @@ -1110,10 +1110,10 @@ private struct ProfilePickerRow: View { HStack(spacing: 8) { HStack(spacing: 4) { - Image(systemName: profile.type == .remote ? "cloud.fill" : "doc.fill") + Image(systemName: profile.type.presentationSymbol) .font(.system(size: 12)) .foregroundStyle(.secondary) - Text(profile.type == .remote ? "Remote" : "Local") + Text(profile.type.presentationLabel) .font(.caption) .foregroundStyle(.secondary) } @@ -1414,10 +1414,10 @@ private struct ProfilePickerRow: View { private var profileInfo: some View { HStack(spacing: 8) { HStack(spacing: 4) { - Image(systemName: profile.type == .remote ? "cloud.fill" : "doc.fill") + Image(systemName: profile.type.presentationSymbol) .font(.system(size: 12)) .foregroundStyle(.secondary) - Text(profile.type == .remote ? "Remote" : "Local") + Text(profile.type.presentationLabel) .font(.caption) .foregroundStyle(.secondary) } diff --git a/ApplicationLibrary/Views/Profile/ProfileType+Presentation.swift b/ApplicationLibrary/Views/Profile/ProfileType+Presentation.swift new file mode 100644 index 0000000..486dc2b --- /dev/null +++ b/ApplicationLibrary/Views/Profile/ProfileType+Presentation.swift @@ -0,0 +1,27 @@ +import Library +import SwiftUI + +extension ProfileType { + // UI presentation intentionally keeps iCloud distinct from Local/Remote export semantics. + var presentationLabel: LocalizedStringKey { + switch self { + case .local: + return "Local" + case .icloud: + return "iCloud" + case .remote: + return "Remote" + } + } + + var presentationSymbol: String { + switch self { + case .local: + return "doc.fill" + case .icloud: + return "icloud.fill" + case .remote: + return "cloud.fill" + } + } +} diff --git a/Extension/Extension.entitlements b/Extension/Extension.entitlements index da63dda..0cddf12 100644 --- a/Extension/Extension.entitlements +++ b/Extension/Extension.entitlements @@ -2,14 +2,6 @@ - com.apple.developer.icloud-container-identifiers - - iCloud.io.nekohasekai.sfavt - - com.apple.developer.icloud-services - - CloudDocuments - com.apple.developer.networking.networkextension packet-tunnel-provider @@ -18,10 +10,6 @@ com.apple.developer.networking.wifi-info - com.apple.developer.ubiquity-container-identifiers - - iCloud.io.nekohasekai.sfavt - com.apple.security.app-sandbox com.apple.security.application-groups diff --git a/IntentsExtension/IntentsExtension.entitlements b/IntentsExtension/IntentsExtension.entitlements index 62a5b8e..03699a3 100644 --- a/IntentsExtension/IntentsExtension.entitlements +++ b/IntentsExtension/IntentsExtension.entitlements @@ -2,6 +2,18 @@ + com.apple.developer.icloud-container-identifiers + + iCloud.io.nekohasekai.sfavt + + com.apple.developer.icloud-services + + CloudDocuments + + com.apple.developer.ubiquity-container-identifiers + + iCloud.io.nekohasekai.sfavt + com.apple.security.app-sandbox com.apple.security.application-groups