Add DEV badge on iCloud settings for debug builds

Shows an orange "DEV" capsule next to the iCloud row in Settings and a
development environment notice at the top of iCloud settings, helping
distinguish CloudKit dev environment from production during development.
This commit is contained in:
Arkadiusz Fal
2026-02-13 18:13:04 +01:00
parent 3aadc9be70
commit 9587ab37f8
3 changed files with 52 additions and 1 deletions

View File

@@ -1810,6 +1810,36 @@
}
}
},
"settings.icloud.dev.badge" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "DEV"
}
}
}
},
"settings.icloud.dev.footer" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Using CloudKit development environment. Data is separate from production."
}
}
}
},
"settings.icloud.dev.title" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Development Environment"
}
}
}
},
"discovery.empty.description" : {
"comment" : "Description when no network shares are found",
"localizations" : {

View File

@@ -110,7 +110,18 @@ struct SettingsView: View {
NavigationLink {
iCloudSettingsView()
} label: {
Label(String(localized: "settings.icloud.title"), systemImage: "icloud")
HStack {
Label(String(localized: "settings.icloud.title"), systemImage: "icloud")
#if DEBUG
Spacer()
Text(String(localized: "settings.icloud.dev.badge"))
.font(.caption2.bold())
.foregroundStyle(.white)
.padding(.horizontal, 6)
.padding(.vertical, 2)
.background(.orange, in: Capsule())
#endif
}
}
NavigationLink {

View File

@@ -50,6 +50,16 @@ struct iCloudSettingsView: View {
var body: some View {
List {
#if DEBUG
Section {
Label(String(localized: "settings.icloud.dev.title"), systemImage: "hammer.fill")
.foregroundStyle(.orange)
.font(.subheadline)
} footer: {
Text(String(localized: "settings.icloud.dev.footer"))
}
#endif
Section {
Toggle(isOn: Binding(
get: { settingsManager?.iCloudSyncEnabled ?? false },