diff --git a/Core/PixelExperiment.swift b/Core/PixelExperiment.swift index a2cc5d8f5b..10f0b675b6 100644 --- a/Core/PixelExperiment.swift +++ b/Core/PixelExperiment.swift @@ -75,6 +75,8 @@ extension PixelExperiment { final internal class PixelExperimentLogic { var cohort: PixelExperiment? { + return .newSettings + guard isInstalled else { return nil } if let allocatedCohort, diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 48c6b2d1e6..a499d57367 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -121,7 +121,6 @@ 1DEAADF22BA4716C00E25A97 /* SettingsStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DEAADF12BA4716C00E25A97 /* SettingsStatus.swift */; }; 1DEAADF42BA47B5300E25A97 /* WebTrackingProtectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DEAADF32BA47B5300E25A97 /* WebTrackingProtectionView.swift */; }; 1DEAADF62BA4809400E25A97 /* CookiePopUpProtectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DEAADF52BA4809400E25A97 /* CookiePopUpProtectionView.swift */; }; - 1DEAADF92BA4892600E25A97 /* SettingsPrivacyProDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DEAADF82BA4892600E25A97 /* SettingsPrivacyProDetailView.swift */; }; 1DEAADFB2BA71E9A00E25A97 /* SettingsPrivacyProtectionDescriptionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DEAADFA2BA71E9A00E25A97 /* SettingsPrivacyProtectionDescriptionView.swift */; }; 1DEAADFF2BA7832F00E25A97 /* EmailProtectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DEAADFE2BA7832F00E25A97 /* EmailProtectionView.swift */; }; 1E016AB42949FEB500F21625 /* OmniBarNotificationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E016AB32949FEB500F21625 /* OmniBarNotificationViewModel.swift */; }; @@ -1276,7 +1275,6 @@ 1DEAADF12BA4716C00E25A97 /* SettingsStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsStatus.swift; sourceTree = ""; }; 1DEAADF32BA47B5300E25A97 /* WebTrackingProtectionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebTrackingProtectionView.swift; sourceTree = ""; }; 1DEAADF52BA4809400E25A97 /* CookiePopUpProtectionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CookiePopUpProtectionView.swift; sourceTree = ""; }; - 1DEAADF82BA4892600E25A97 /* SettingsPrivacyProDetailView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsPrivacyProDetailView.swift; sourceTree = ""; }; 1DEAADFA2BA71E9A00E25A97 /* SettingsPrivacyProtectionDescriptionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsPrivacyProtectionDescriptionView.swift; sourceTree = ""; }; 1DEAADFE2BA7832F00E25A97 /* EmailProtectionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmailProtectionView.swift; sourceTree = ""; }; 1E016AB32949FEB500F21625 /* OmniBarNotificationViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OmniBarNotificationViewModel.swift; sourceTree = ""; }; @@ -3268,7 +3266,6 @@ isa = PBXGroup; children = ( 1D5216AB2BAC1F11002FE1ED /* SettingsPrivacyProView.swift */, - 1DEAADF82BA4892600E25A97 /* SettingsPrivacyProDetailView.swift */, D69FBF752B28BE3600B505F1 /* SettingsSubscriptionView.swift */, ); name = "Privacy Pro"; @@ -6710,7 +6707,6 @@ D68DF81C2B58302E0023DBEA /* SubscriptionRestoreView.swift in Sources */, D664C7CE2B289AA200CBFA76 /* SubscriptionPagesUseSubscriptionFeature.swift in Sources */, EE9D68DC2AE16AE100B55EF4 /* NotificationsAuthorizationController.swift in Sources */, - 1DEAADF92BA4892600E25A97 /* SettingsPrivacyProDetailView.swift in Sources */, AA3D854923DA1DFB00788410 /* AppIcon.swift in Sources */, D6E83C2E2B1EA06E006C8AFB /* SettingsViewModel.swift in Sources */, 8590CB612684D0600089F6BF /* CookieDebugViewController.swift in Sources */, diff --git a/DuckDuckGo/PrivateSearchView.swift b/DuckDuckGo/PrivateSearchView.swift index d5195e8562..b7151cfe60 100644 --- a/DuckDuckGo/PrivateSearchView.swift +++ b/DuckDuckGo/PrivateSearchView.swift @@ -53,25 +53,19 @@ struct PrivateSearchViewSettings: View { @State var shouldShowNoMicrophonePermissionAlert = false var body: some View { - Section(header: Text(UserText.searchSettings)) { + Section(header: Text(UserText.searchSettings), + footer: Text(viewModel.autocompleteSubtitle ?? "")) { // Autocomplete Suggestions SettingsCellView(label: UserText.settingsAutocomplete, - subtitle: viewModel.autocompleteSubtitle, accesory: .toggle(isOn: viewModel.autocompletePrivateSearchBinding)) + } + Section(footer: Text(UserText.voiceSearchFooter)) { // Private Voice Search if viewModel.state.speechRecognitionAvailable { SettingsCellView(label: UserText.settingsVoiceSearch, - subtitle: UserText.voiceSearchFooter, accesory: .toggle(isOn: viewModel.voiceSearchEnabledPrivateSearchBinding)) } - - // More Search Settings - SettingsCellView(label: UserText.moreSearchSettings, - subtitle: UserText.moreSearchSettingsExplanation, - action: { viewModel.openMoreSearchSettings() }, - disclosureIndicator: true, - isButton: true) } .alert(isPresented: $shouldShowNoMicrophonePermissionAlert) { Alert(title: Text(UserText.noVoicePermissionAlertTitle), @@ -85,6 +79,15 @@ struct PrivateSearchViewSettings: View { .onChange(of: viewModel.shouldShowNoMicrophonePermissionAlert) { value in shouldShowNoMicrophonePermissionAlert = value } + + Section { + // More Search Settings + SettingsCellView(label: UserText.moreSearchSettings, + subtitle: UserText.moreSearchSettingsExplanation, + action: { viewModel.openMoreSearchSettings() }, + disclosureIndicator: true, + isButton: true) + } } } diff --git a/DuckDuckGo/SettingsGeneralView.swift b/DuckDuckGo/SettingsGeneralView.swift index ee283c4cab..fc80dacce3 100644 --- a/DuckDuckGo/SettingsGeneralView.swift +++ b/DuckDuckGo/SettingsGeneralView.swift @@ -37,12 +37,13 @@ struct SettingsGeneralView: View { } Section(header: Text(UserText.privateSearch), - footer: Text(UserText.voiceSearchFooter)) { + footer: Text(viewModel.autocompleteSubtitle ?? "")) { // Autocomplete Suggestions SettingsCellView(label: UserText.settingsAutocomplete, - subtitle: viewModel.autocompleteSubtitle, accesory: .toggle(isOn: viewModel.autocompleteGeneralBinding)) + } + Section(footer: Text(UserText.voiceSearchFooter)) { // Private Voice Search if viewModel.state.speechRecognitionAvailable { SettingsCellView(label: UserText.settingsVoiceSearch, diff --git a/DuckDuckGo/SettingsPrivacyProDetailView.swift b/DuckDuckGo/SettingsPrivacyProDetailView.swift deleted file mode 100644 index 9c56cedb0c..0000000000 --- a/DuckDuckGo/SettingsPrivacyProDetailView.swift +++ /dev/null @@ -1,39 +0,0 @@ -// -// SettingsPrivacyProDetailView.swift -// DuckDuckGo -// -// Copyright © 2023 DuckDuckGo. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import SwiftUI -import UIKit - -struct SettingsPrivacyProDetailView: View { - - @EnvironmentObject var viewModel: SettingsViewModel - - var body: some View { -#if SUBSCRIPTION - if #available(iOS 15, *) { - List { - SettingsSubscriptionView() - } - .applySettingsListModifiers(displayMode: .inline, - viewModel: viewModel) - } -#endif - } - -} diff --git a/DuckDuckGo/SettingsPrivacyProView.swift b/DuckDuckGo/SettingsPrivacyProView.swift index ef7c7ecb90..dfaa28628a 100644 --- a/DuckDuckGo/SettingsPrivacyProView.swift +++ b/DuckDuckGo/SettingsPrivacyProView.swift @@ -28,15 +28,7 @@ struct SettingsPrivacyProView: View { var body: some View { #if SUBSCRIPTION if #available(iOS 15, *) { - if viewModel.state.subscription.enabled { - Section { - // Privacy Pro - NavigationLink(destination: SettingsPrivacyProDetailView().environmentObject(viewModel)) { - SettingsCellView(label: UserText.settingsPProSection, - image: Image("SettingsPrivacyPro")) - } - } - } + SettingsSubscriptionView() } #endif } diff --git a/DuckDuckGo/SettingsStatus.swift b/DuckDuckGo/SettingsStatus.swift index e5cfc65a49..6a58e82622 100644 --- a/DuckDuckGo/SettingsStatus.swift +++ b/DuckDuckGo/SettingsStatus.swift @@ -50,7 +50,7 @@ struct StatusIndicatorView: View { } Text(status.text) - .daxSubheadRegular() + .daxBodyRegular() .foregroundColor(Color(designSystemColor: .textSecondary)) } } diff --git a/DuckDuckGo/SettingsViewModel.swift b/DuckDuckGo/SettingsViewModel.swift index 839e07118e..970926d45d 100644 --- a/DuckDuckGo/SettingsViewModel.swift +++ b/DuckDuckGo/SettingsViewModel.swift @@ -791,7 +791,6 @@ extension SettingsViewModel { pushViewController(legacyViewProvider.netP) } #endif - } }