fix: silence macOS Periphery false positives for iOS icon UI

Apply the stored icon preference on every platform (no-op elsewhere) and
annotate iOS-only title/settings strings that the macOS scheme cannot see.
This commit is contained in:
Taksh 2026-07-31 11:53:56 +03:00
parent 29166fa1e8
commit 91df9ff6eb
3 changed files with 9 additions and 4 deletions

View File

@ -45,9 +45,10 @@ struct BitchatApp: App {
.onAppear {
appDelegate.runtime = runtime
runtime.start()
#if os(iOS)
// No-op on macOS / devices without alternate-icon support;
// kept outside `#if os(iOS)` so the macOS Periphery scan
// sees the launch-time apply path.
AlternateAppIconSettings.applyStoredPreference()
#endif
}
.onOpenURL { url in
runtime.handleOpenURL(url)

View File

@ -35,6 +35,8 @@ enum AlternateAppIconSettings {
}
}
// periphery:ignore - read from the iOS App Info icon picker; the macOS
// Periphery scheme cannot see that use site (#1447).
var title: String {
switch self {
case .primary:
@ -65,6 +67,8 @@ enum AlternateAppIconSettings {
}
}
// periphery:ignore - convenience for iOS settings; storage APIs below are
// what panic wipe and tests exercise on the macOS scan.
static var selected: Icon {
get { selected(in: .standard) }
set { setSelected(newValue, in: .standard, applySystem: true) }

View File

@ -64,8 +64,8 @@ struct AppInfoView: View {
static let tabSettings = String(localized: "app_info.tab.settings", defaultValue: "settings", comment: "Segmented control label for the settings pane of the app info sheet")
static let tabInfo = String(localized: "app_info.tab.info", defaultValue: "info", comment: "Segmented control label for the info pane of the app info sheet")
static let iconTitle = String(localized: "app_info.settings.icon.title", defaultValue: "HOME SCREEN ICON", comment: "Section header (uppercase) for alternate app icon picker")
static let iconSubtitle = String(localized: "app_info.settings.icon.subtitle", defaultValue: "optional low-profile icons. the real app name still shows in settings and search — this only changes the home-screen glyph.", comment: "Caption under the alternate app icon picker explaining the limits of disguise")
static let iconTitle = String(localized: "app_info.settings.icon.title", defaultValue: "HOME SCREEN ICON", comment: "Section header (uppercase) for alternate app icon picker") // periphery:ignore - iOS App Info settings UI
static let iconSubtitle = String(localized: "app_info.settings.icon.subtitle", defaultValue: "optional low-profile icons. the real app name still shows in settings and search — this only changes the home-screen glyph.", comment: "Caption under the alternate app icon picker explaining the limits of disguise") // periphery:ignore - iOS App Info settings UI
static let connectivityTitle = String(localized: "app_info.settings.connectivity.title", defaultValue: "CONNECTIVITY", comment: "Section header (uppercase) for the connectivity toggles: mesh bridge, internet gateway, tor routing")