diff --git a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift index 77a441b4..32afd21d 100644 --- a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift +++ b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift @@ -27,6 +27,7 @@ struct SettingsTabs: View { appSection accountsSection generalSection + otherSections } .scrollContentBackground(.hidden) .background(theme.secondaryBackgroundColor) @@ -91,6 +92,12 @@ struct SettingsTabs: View { NavigationLink(destination: remoteLocalTimelinesView) { Label("settings.general.remote-timelines", systemImage: "dot.radiowaves.right") } + } + .listRowBackground(theme.primaryBackgroundColor) + } + + private var otherSections: some View { + Section("settings.section.other") { if !ProcessInfo.processInfo.isiOSAppOnMac { Picker(selection: $preferences.preferredBrowser) { ForEach(PreferredBrowser.allCases, id: \.rawValue) { browser in @@ -105,6 +112,9 @@ struct SettingsTabs: View { Label("settings.general.browser", systemImage: "network") } } + Toggle(isOn: $preferences.isOpenAIEnabled) { + Label("settings.other.hide-openai", systemImage: "faxmachine") + } } .listRowBackground(theme.primaryBackgroundColor) } diff --git a/IceCubesApp/Resources/Localization/de.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/de.lproj/Localizable.strings index f8599926..a3072076 100644 --- a/IceCubesApp/Resources/Localization/de.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/de.lproj/Localizable.strings @@ -100,6 +100,8 @@ "settings.timeline.add" = "Lokale Timeline hinzufügen"; "settings.title" = "Einstellungen"; "settings.rate" = "Bewerte Ice Cubes"; +"settings.section.other" = "Other"; +"settings.other.hide-openai" = "Enable 🤖 helper"; // MARK: Tabs "tab.explore" = "Entdecken"; diff --git a/IceCubesApp/Resources/Localization/en.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/en.lproj/Localizable.strings index 6bd30b02..97df9111 100644 --- a/IceCubesApp/Resources/Localization/en.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/en.lproj/Localizable.strings @@ -100,6 +100,8 @@ "settings.timeline.add" = "Add a local timeline"; "settings.title" = "Settings"; "settings.rate" = "Rate Ice Cubes"; +"settings.section.other" = "Other"; +"settings.other.hide-openai" = "Enable 🤖 helper"; // MARK: Tabs "tab.explore" = "Explore"; diff --git a/IceCubesApp/Resources/Localization/es.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/es.lproj/Localizable.strings index d357b154..1eddfe0c 100644 --- a/IceCubesApp/Resources/Localization/es.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/es.lproj/Localizable.strings @@ -100,6 +100,8 @@ "settings.timeline.add" = "Añadir cronología local"; "settings.title" = "Ajustes"; "settings.rate" = "Valora Ice Cubes"; +"settings.section.other" = "Other"; +"settings.other.hide-openai" = "Enable 🤖 helper"; // MARK: Tabs "tab.explore" = "Explorar"; diff --git a/IceCubesApp/Resources/Localization/it.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/it.lproj/Localizable.strings index 67925e82..54175a4a 100644 --- a/IceCubesApp/Resources/Localization/it.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/it.lproj/Localizable.strings @@ -100,6 +100,8 @@ "settings.timeline.add" = "Aggiungi una timeline locale"; "settings.title" = "Impostazioni"; "settings.rate" = "Valuta Ice Cubes"; +"settings.section.other" = "Other"; +"settings.other.hide-openai" = "Enable 🤖 helper"; // MARK: Tabs "tab.explore" = "Esplora"; diff --git a/IceCubesApp/Resources/Localization/nl.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/nl.lproj/Localizable.strings index 90cfd8a4..982915d8 100644 --- a/IceCubesApp/Resources/Localization/nl.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/nl.lproj/Localizable.strings @@ -100,6 +100,8 @@ "settings.support.four.subtitle" = "Daarmee kan Ice Cubes nog een tijdje vooruit!"; "settings.timeline.add" = "Een lokale tijdlijn toevoegen"; "settings.title" = "Instellingen"; +"settings.section.other" = "Other"; +"settings.other.hide-openai" = "Enable 🤖 helper"; // MARK: Tabs "tab.explore" = "Ontdekken"; diff --git a/IceCubesApp/Resources/Localization/zh-Hans.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/zh-Hans.lproj/Localizable.strings index 769fea01..896e80b7 100644 --- a/IceCubesApp/Resources/Localization/zh-Hans.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/zh-Hans.lproj/Localizable.strings @@ -100,6 +100,8 @@ "settings.timeline.add" = "添加远程时间线"; "settings.title" = "设置"; "settings.rate" = "给 Ice Cubes 评分"; +"settings.section.other" = "Other"; +"settings.other.hide-openai" = "Enable 🤖 helper"; // MARK: Tabs "tab.explore" = "探索"; diff --git a/Packages/Env/Sources/Env/UserPreferences.swift b/Packages/Env/Sources/Env/UserPreferences.swift index d4dfae71..e0252b24 100644 --- a/Packages/Env/Sources/Env/UserPreferences.swift +++ b/Packages/Env/Sources/Env/UserPreferences.swift @@ -15,6 +15,7 @@ public class UserPreferences: ObservableObject { @AppStorage("draft_posts") public var draftsPosts: [String] = [] @AppStorage("font_size_scale") public var fontSizeScale: Double = 1 @AppStorage("show_translate_button_inline") public var showTranslateButton: Bool = true + @AppStorage("is_open_ai_enabled") public var isOpenAIEnabled: Bool = true public var pushNotificationsCount: Int { get { diff --git a/Packages/Status/Sources/Status/Editor/StatusEditorView.swift b/Packages/Status/Sources/Status/Editor/StatusEditorView.swift index 2cb14791..e3208b73 100644 --- a/Packages/Status/Sources/Status/Editor/StatusEditorView.swift +++ b/Packages/Status/Sources/Status/Editor/StatusEditorView.swift @@ -100,9 +100,11 @@ public struct StatusEditorView: View { Text(viewModel.postingError ?? "") }) .toolbar { - ToolbarItem(placement: .navigationBarTrailing) { - AIMenu - .disabled(!viewModel.canPost) + if preferences.isOpenAIEnabled { + ToolbarItem(placement: .navigationBarTrailing) { + AIMenu + .disabled(!viewModel.canPost) + } } ToolbarItem(placement: .navigationBarTrailing) { Button {