diff --git a/DuckDuckGo/Assets.xcassets/Images/HomePage/RocketGrayscale.imageset/Contents.json b/DuckDuckGo/Assets.xcassets/Images/HomePage/RocketGrayscale.imageset/Contents.json new file mode 100644 index 0000000000..bbc07d016f --- /dev/null +++ b/DuckDuckGo/Assets.xcassets/Images/HomePage/RocketGrayscale.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "Rocket-16.svg", + "idiom" : "universal", + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" + } +} diff --git a/DuckDuckGo/Assets.xcassets/Images/HomePage/RocketGrayscale.imageset/Rocket-16.svg b/DuckDuckGo/Assets.xcassets/Images/HomePage/RocketGrayscale.imageset/Rocket-16.svg new file mode 100644 index 0000000000..efc2e7474c --- /dev/null +++ b/DuckDuckGo/Assets.xcassets/Images/HomePage/RocketGrayscale.imageset/Rocket-16.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/DuckDuckGo/Common/Localizables/UserText.swift b/DuckDuckGo/Common/Localizables/UserText.swift index d4dd80c098..e2683d67c6 100644 --- a/DuckDuckGo/Common/Localizables/UserText.swift +++ b/DuckDuckGo/Common/Localizables/UserText.swift @@ -1145,6 +1145,7 @@ struct UserText { static let newTabBottomPopoverTitle = NSLocalizedString("newTab.bottom.popover.title", value: "New Tab Page", comment: "Title of the popover that appears when pressing the bottom right button") static let newTabMenuItemShowSearchBar = NSLocalizedString("newTab.menu.item.show.search.bar", value: "Show Search Box", comment: "Title of the menu item in the home page to show/hide search box (search field)") static let newTabMenuItemShowFavorite = NSLocalizedString("newTab.menu.item.show.favorite", value: "Show Favorites", comment: "Title of the menu item in the home page to show/hide favorite section") + static let newTabMenuItemShowContinuteSetUp = NSLocalizedString("newTab.menu.item.show.continue.setup", value: "Show Next Steps", comment: "Title of the menu item in the home page to show/hide continue setup section") static let newTabMenuItemShowRecentActivity = NSLocalizedString("newTab.menu.item.show.recent.activity", value: "Show Recent Activity", comment: "Title of the menu item in the home page to show/hide recent activity section") // Search Bar diff --git a/DuckDuckGo/HomePage/View/HomePageSettings/HomeContentSectionsView.swift b/DuckDuckGo/HomePage/View/HomePageSettings/HomeContentSectionsView.swift index df2927f2c9..e49445017c 100644 --- a/DuckDuckGo/HomePage/View/HomePageSettings/HomeContentSectionsView.swift +++ b/DuckDuckGo/HomePage/View/HomePageSettings/HomeContentSectionsView.swift @@ -21,6 +21,7 @@ import SwiftUIExtensions extension HomePage.Views { struct HomeContentSectionsView: View { + let includeContinueSetUpCards: Bool @EnvironmentObject var model: AppearancePreferences @EnvironmentObject var addressBarModel: HomePage.Models.AddressBarModel @EnvironmentObject var continueSetUpModel: HomePage.Models.ContinueSetUpModel @@ -41,6 +42,19 @@ extension HomePage.Views { .toggleStyle(.switch) } + if includeContinueSetUpCards { + Toggle(isOn: $model.isContinueSetUpVisible) { + HStack { + Image(.rocketGrayscale) + .frame(width: iconSize, height: iconSize) + Text(UserText.newTabSetUpSectionTitle) + Spacer() + } + } + .toggleStyle(.switch) + .visibility(continueSetUpModel.hasContent ? .visible : .gone) + } + Toggle(isOn: $model.isFavoriteVisible) { HStack { Image(.favorite) diff --git a/DuckDuckGo/HomePage/View/HomePageSettings/HomePageSettingsView.swift b/DuckDuckGo/HomePage/View/HomePageSettings/HomePageSettingsView.swift index 76c7f2f18e..2ea65f9003 100644 --- a/DuckDuckGo/HomePage/View/HomePageSettings/HomePageSettingsView.swift +++ b/DuckDuckGo/HomePage/View/HomePageSettings/HomePageSettingsView.swift @@ -32,6 +32,7 @@ extension HomePage.Views { static let sectionSpacing = 36.0 } + let includingContinueSetUpCards: Bool @EnvironmentObject var model: HomePage.Models.SettingsModel @EnvironmentObject var appearancePreferences: AppearancePreferences @EnvironmentObject var continueSetUpModel: HomePage.Models.ContinueSetUpModel @@ -174,7 +175,7 @@ extension HomePage.Views { ThemePicker() } SettingsSection(title: UserText.homePageSections) { - HomeContentSectionsView() + HomeContentSectionsView(includeContinueSetUpCards: includingContinueSetUpCards) } rootViewFooter } @@ -232,13 +233,42 @@ extension HomePage.Views.BackgroundCategoryView { } #if DEBUG -#Preview { +#Preview("including continue set up cards") { @State var isSettingsVisible: Bool = true let settingsModel = HomePage.Models.SettingsModel() settingsModel.customBackground = .solidColor(.color10) - return HomePage.Views.SettingsView( isSettingsVisible: $isSettingsVisible) + return HomePage.Views.SettingsView(includingContinueSetUpCards: true, isSettingsVisible: $isSettingsVisible) + .frame(width: 236, height: 600) + .environmentObject(settingsModel) + .environmentObject(AppearancePreferences.shared) + .environmentObject(HomePage.Models.ContinueSetUpModel( + defaultBrowserProvider: SystemDefaultBrowserProvider(), + dockCustomizer: DockCustomizer(), + dataImportProvider: BookmarksAndPasswordsImportStatusProvider(), + tabCollectionViewModel: TabCollectionViewModel(), + duckPlayerPreferences: DuckPlayerPreferencesUserDefaultsPersistor() + )) + .environmentObject(HomePage.Models.FavoritesModel( + open: { _, _ in }, + removeFavorite: { _ in }, + deleteBookmark: { _ in }, + add: {}, + edit: { _ in }, + moveFavorite: { _, _ in }, + onFaviconMissing: {} + )) + .environmentObject(HomePage.Models.AddressBarModel(tabCollectionViewModel: TabCollectionViewModel(), privacyConfigurationManager: MockPrivacyConfigurationManager())) +} + +#Preview("no continue set up cards") { + @State var isSettingsVisible: Bool = true + + let settingsModel = HomePage.Models.SettingsModel() + settingsModel.customBackground = .solidColor(.color10) + + return HomePage.Views.SettingsView(includingContinueSetUpCards: false, isSettingsVisible: $isSettingsVisible) .frame(width: 236, height: 600) .environmentObject(settingsModel) .environmentObject(AppearancePreferences.shared) diff --git a/DuckDuckGo/HomePage/View/HomePageView.swift b/DuckDuckGo/HomePage/View/HomePageView.swift index 63dbbf161b..b8f9391591 100644 --- a/DuckDuckGo/HomePage/View/HomePageView.swift +++ b/DuckDuckGo/HomePage/View/HomePageView.swift @@ -104,7 +104,8 @@ extension HomePage.Views { .contextMenu(menuItems: sectionsVisibilityContextMenuItems) if settingsVisibilityModel.isSettingsVisible { - SettingsView(isSettingsVisible: $settingsVisibilityModel.isSettingsVisible) + SettingsView(includingContinueSetUpCards: model.isContinueSetUpAvailable && !model.isContinueSetUpCardsViewOutdated, + isSettingsVisible: $settingsVisibilityModel.isSettingsVisible) .frame(width: Self.settingsPanelWidth) .transition(.move(edge: .trailing)) .layoutPriority(1) @@ -239,6 +240,11 @@ extension HomePage.Views { Toggle(UserText.newTabMenuItemShowSearchBar, isOn: $model.isSearchBarVisible) .toggleStyle(.checkbox) } + if model.isContinueSetUpAvailable && !model.isContinueSetUpCardsViewOutdated { + Toggle(UserText.newTabMenuItemShowContinuteSetUp, isOn: $model.isContinueSetUpVisible) + .toggleStyle(.checkbox) + .visibility(continueSetUpModel.hasContent ? .visible : .gone) + } Toggle(UserText.newTabMenuItemShowFavorite, isOn: $model.isFavoriteVisible) .toggleStyle(.checkbox) Toggle(UserText.newTabMenuItemShowRecentActivity, isOn: $model.isRecentActivityVisible) diff --git a/DuckDuckGo/InfoPlist.xcstrings b/DuckDuckGo/InfoPlist.xcstrings index ef75ed805d..42ce7f4c7f 100644 --- a/DuckDuckGo/InfoPlist.xcstrings +++ b/DuckDuckGo/InfoPlist.xcstrings @@ -67,55 +67,55 @@ "localizations" : { "de" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Lade Fotos und Videos hoch" } }, "en" : { "stringUnit" : { "state" : "new", - "value" : "Allows you to upload photographs and videos" + "value" : "Lets websites ask permission to use your camera for video calls, recording and uploading videos, or taking and uploading photos." } }, "es" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Te permite subir fotos y vídeos" } }, "fr" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Vous permet de télécharger des photos et des vidéos" } }, "it" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Consente il caricamento di foto e video" } }, "nl" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Hiermee kun je foto's en video's uploaden" } }, "pl" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Umożliwia przesyłanie zdjęć i filmów" } }, "pt" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Permite-lhe carregar fotografias e vídeos" } }, "ru" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Позволяет загружать фото и видео" } } @@ -127,55 +127,55 @@ "localizations" : { "de" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Speichere heruntergeladene Dateien in diesem Ordner." } }, "en" : { "stringUnit" : { "state" : "new", - "value" : "Allows you to save downloaded files to this folder." + "value" : "Lets you save files to the Desktop folder on your computer." } }, "es" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Te permite guardar los archivos descargados en esta carpeta." } }, "fr" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Permet d'enregistrer les fichiers téléchargés dans ce dossier." } }, "it" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Consente di salvare in questa cartella i file scaricati." } }, "nl" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Hiermee kun je gedownloade bestanden opslaan in deze map." } }, "pl" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Umożliwia zapisywanie pobranych plików w tym folderze." } }, "pt" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Permite guardar ficheiros transferidos nesta pasta." } }, "ru" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Позволяет сохранять загруженные файлы в эту папку." } } @@ -187,55 +187,55 @@ "localizations" : { "de" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Speichere heruntergeladene Dateien in diesem Ordner." } }, "en" : { "stringUnit" : { "state" : "new", - "value" : "Allows you to save downloaded files to this folder." + "value" : "Lets you save files to the Documents folder on your computer." } }, "es" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Te permite guardar los archivos descargados en esta carpeta." } }, "fr" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Permet d'enregistrer les fichiers téléchargés dans ce dossier." } }, "it" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Consente di salvare in questa cartella i file scaricati." } }, "nl" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Hiermee kun je gedownloade bestanden opslaan in deze map." } }, "pl" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Umożliwia zapisywanie pobranych plików w tym folderze." } }, "pt" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Permite guardar ficheiros transferidos nesta pasta." } }, "ru" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Позволяет сохранять загруженные файлы в эту папку." } } @@ -247,55 +247,55 @@ "localizations" : { "de" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Speichere heruntergeladene Dateien in diesem Ordner." } }, "en" : { "stringUnit" : { "state" : "new", - "value" : "Allows you to save downloaded files to this folder." + "value" : "Lets you save files to the Downloads folder on your computer." } }, "es" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Te permite guardar los archivos descargados en esta carpeta." } }, "fr" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Permet d'enregistrer les fichiers téléchargés dans ce dossier." } }, "it" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Consente di salvare in questa cartella i file scaricati." } }, "nl" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Hiermee kun je gedownloade bestanden opslaan in deze map." } }, "pl" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Umożliwia zapisywanie pobranych plików w tym folderze." } }, "pt" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Permite guardar ficheiros transferidos nesta pasta." } }, "ru" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Позволяет сохранять загруженные файлы в эту папку." } } @@ -367,55 +367,55 @@ "localizations" : { "de" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Teile deinen Standort" } }, "en" : { "stringUnit" : { "state" : "new", - "value" : "Allows you to share your geolocation" + "value" : "Lets websites ask permission to use your location to improve search results, provide weather and directions, or show nearby map locations." } }, "es" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Te permite compartir tu ubicación" } }, "fr" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Vous permet de partager votre géolocalisation" } }, "it" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Consente la condivisione della tua geolocalizzazione" } }, "nl" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Hiermee kun je je geolocatie delen" } }, "pl" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Umożliwia udostępnianie geolokalizacji" } }, "pt" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Permite-te partilhar a tua localização geográfica" } }, "ru" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Позволяет делиться геопозицией" } } @@ -423,7 +423,7 @@ }, "NSLocationWhenInUseUsageDescription" : { "comment" : "Privacy - Location When In Use Usage Description", - "extractionState" : "extracted_with_value", + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -487,55 +487,55 @@ "localizations" : { "de" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Teile deine Aufzeichnungen" } }, "en" : { "stringUnit" : { "state" : "new", - "value" : "Allows you to share recordings" + "value" : "Lets websites ask permission to use your microphone for audio and video calls or for recording and uploading audio." } }, "es" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Te permite compartir grabaciones" } }, "fr" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Vous permet de partager des enregistrements" } }, "it" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Consente la condivisione delle registrazioni" } }, "nl" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Hiermee kun je opnames delen" } }, "pl" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Umożliwia udostępnianie nagrań" } }, "pt" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Permite-lhe partilhar gravações" } }, "ru" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "Позволяет делиться аудиозаписями" } } diff --git a/DuckDuckGo/Localizable.xcstrings b/DuckDuckGo/Localizable.xcstrings index b98083b2d3..7b47106108 100644 --- a/DuckDuckGo/Localizable.xcstrings +++ b/DuckDuckGo/Localizable.xcstrings @@ -36981,6 +36981,66 @@ } } }, + "newTab.menu.item.show.continue.setup" : { + "comment" : "Title of the menu item in the home page to show/hide continue setup section", + "extractionState" : "extracted_with_value", + "localizations" : { + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Nächste Schritte anzeigen" + } + }, + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "Show Next Steps" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mostrar pasos siguientes" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Afficher les étapes suivantes" + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mostra i passaggi successivi" + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Volgende stappen weergeven" + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Pokaż dalsze kroki" + } + }, + "pt" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mostrar passos seguintes" + } + }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "Показать дальнейшие шаги" + } + } + } + }, "newTab.menu.item.show.favorite" : { "comment" : "Title of the menu item in the home page to show/hide favorite section", "extractionState" : "extracted_with_value", diff --git a/DuckDuckGo/Preferences/Model/AppearancePreferences.swift b/DuckDuckGo/Preferences/Model/AppearancePreferences.swift index 796e43e8a5..bee2e1c6e3 100644 --- a/DuckDuckGo/Preferences/Model/AppearancePreferences.swift +++ b/DuckDuckGo/Preferences/Model/AppearancePreferences.swift @@ -242,7 +242,7 @@ final class AppearancePreferences: ObservableObject { if let continueSetUpCardsLastDemonstrated = persistor.continueSetUpCardsLastDemonstrated { // how many days has passed since last Continue Setup demonstration let daysSinceLastDemonstration = Calendar.current.dateComponents([.day], from: continueSetUpCardsLastDemonstrated, to: dateTimeProvider()).day! - if daysSinceLastDemonstration > 0 { + if daysSinceLastDemonstration > 0 || true { persistor.continueSetUpCardsLastDemonstrated = Date() persistor.continueSetUpCardsNumberOfDaysDemonstrated += 1 diff --git a/DuckDuckGo/Preferences/View/PreferencesAppearanceView.swift b/DuckDuckGo/Preferences/View/PreferencesAppearanceView.swift index 7b467340eb..a796eb5caf 100644 --- a/DuckDuckGo/Preferences/View/PreferencesAppearanceView.swift +++ b/DuckDuckGo/Preferences/View/PreferencesAppearanceView.swift @@ -108,6 +108,9 @@ extension Preferences { if addressBarModel.shouldShowAddressBar { ToggleMenuItem(UserText.newTabSearchBarSectionTitle, isOn: $model.isSearchBarVisible) } + if model.isContinueSetUpAvailable && !model.isContinueSetUpCardsViewOutdated { + ToggleMenuItem(UserText.newTabSetUpSectionTitle, isOn: $model.isContinueSetUpVisible) + } ToggleMenuItem(UserText.newTabFavoriteSectionTitle, isOn: $model.isFavoriteVisible).accessibilityIdentifier("Preferences.AppearanceView.showFavoritesToggle") ToggleMenuItem(UserText.newTabRecentActivitySectionTitle, isOn: $model.isRecentActivityVisible) }