Skip to content

Commit

Permalink
Merge branch 'main' into sam/delay-shutting-down-vpn-when-encounterin…
Browse files Browse the repository at this point in the history
…g-error

* main:
  Wrap subscription-related navigation links in `LazyView` (#3576)
  Set `dryRun` for VPN and alpha pixels (#3578)
  apply translations for zoom text (#3583)
  Prevent sending duplicate home tab pixel (#3580)
  • Loading branch information
samsymons committed Nov 18, 2024
2 parents 6a90bb9 + 700dcec commit 0af1673
Show file tree
Hide file tree
Showing 30 changed files with 374 additions and 56 deletions.
4 changes: 4 additions & 0 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@
6FEC0B852C999352006B4F6E /* FavoriteItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FEC0B842C999352006B4F6E /* FavoriteItem.swift */; };
6FEC0B882C999961006B4F6E /* FavoritesListInteractingAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FEC0B872C999961006B4F6E /* FavoritesListInteractingAdapter.swift */; };
6FF915822B88E07A0042AC87 /* AdAttributionFetcherTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FF915802B88E0750042AC87 /* AdAttributionFetcherTests.swift */; };
6FF9AD452CE766F700C5A406 /* NewTabPageControllerPixelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FF9AD442CE766F700C5A406 /* NewTabPageControllerPixelTests.swift */; };
7B1604E82CB685B400A44EC6 /* Logger+TipKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1604E72CB685B400A44EC6 /* Logger+TipKit.swift */; };
7B1604EC2CB68BDA00A44EC6 /* TipKitController+ConvenienceInitializers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1604EB2CB68BDA00A44EC6 /* TipKitController+ConvenienceInitializers.swift */; };
7B1604EE2CB68D2600A44EC6 /* TipKitDebugOptionsUIActionHandling.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1604ED2CB68D2600A44EC6 /* TipKitDebugOptionsUIActionHandling.swift */; };
Expand Down Expand Up @@ -1673,6 +1674,7 @@
6FEC0B842C999352006B4F6E /* FavoriteItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavoriteItem.swift; sourceTree = "<group>"; };
6FEC0B872C999961006B4F6E /* FavoritesListInteractingAdapter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavoritesListInteractingAdapter.swift; sourceTree = "<group>"; };
6FF915802B88E0750042AC87 /* AdAttributionFetcherTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdAttributionFetcherTests.swift; sourceTree = "<group>"; };
6FF9AD442CE766F700C5A406 /* NewTabPageControllerPixelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewTabPageControllerPixelTests.swift; sourceTree = "<group>"; };
7B1604E72CB685B400A44EC6 /* Logger+TipKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Logger+TipKit.swift"; sourceTree = "<group>"; };
7B1604EB2CB68BDA00A44EC6 /* TipKitController+ConvenienceInitializers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TipKitController+ConvenienceInitializers.swift"; sourceTree = "<group>"; };
7B1604ED2CB68D2600A44EC6 /* TipKitDebugOptionsUIActionHandling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TipKitDebugOptionsUIActionHandling.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3851,6 +3853,7 @@
6F03CAFF2C32ED22004179A8 /* NewTabPage */ = {
isa = PBXGroup;
children = (
6FF9AD442CE766F700C5A406 /* NewTabPageControllerPixelTests.swift */,
6F03CB002C32ED42004179A8 /* NewTabPageMessagesModelTests.swift */,
6F40D15C2C34436200BF22F0 /* HomePageDisplayDailyPixelBucketTests.swift */,
6F934F852C58DB00008364E4 /* NewTabPageSettingsPersistentStorageTests.swift */,
Expand Down Expand Up @@ -8148,6 +8151,7 @@
987130C8294AAB9F00AB05E0 /* BookmarksTestHelpers.swift in Sources */,
9F4CC51D2C48D240006A96EB /* CoreDataDatabaseTestUtilities.swift in Sources */,
C185ED672BD43DA100BAE9DC /* ImportPasswordsStatusHandlerTests.swift in Sources */,
6FF9AD452CE766F700C5A406 /* NewTabPageControllerPixelTests.swift in Sources */,
F198D7981E3A45D90088DA8A /* WKWebViewConfigurationExtensionTests.swift in Sources */,
6F3529FF2CDCEDFF00A59170 /* OmniBarLoadingStateBearerTests.swift in Sources */,
564DE45E2C45218500D23241 /* OnboardingNavigationDelegateTests.swift in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ import os.log
}
#endif

#if DEBUG && !ALPHA
#if DEBUG
Pixel.isDryRun = true
#else
Pixel.isDryRun = false
Expand Down
18 changes: 14 additions & 4 deletions DuckDuckGo/NewTabPageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ final class NewTabPageViewController: UIHostingController<AnyView>, NewTabPage {
private weak var daxDialogViewController: DaxDialogViewController?
private var daxDialogHeightConstraint: NSLayoutConstraint?

private let pixelFiring: PixelFiring.Type

var isDaxDialogVisible: Bool {
daxDialogViewController?.view.isHidden == false
}
Expand All @@ -54,12 +56,14 @@ final class NewTabPageViewController: UIHostingController<AnyView>, NewTabPage {
variantManager: VariantManager,
newTabDialogFactory: any NewTabDaxDialogProvider,
newTabDialogTypeProvider: NewTabDialogSpecProvider,
faviconLoader: FavoritesFaviconLoading) {
faviconLoader: FavoritesFaviconLoading,
pixelFiring: PixelFiring.Type = Pixel.self) {

self.associatedTab = tab
self.variantManager = variantManager
self.newTabDialogFactory = newTabDialogFactory
self.newTabDialogTypeProvider = newTabDialogTypeProvider
self.pixelFiring = pixelFiring

newTabPageViewModel = NewTabPageViewModel()
shortcutsSettingsModel = NewTabPageShortcutsSettingsModel()
Expand Down Expand Up @@ -96,14 +100,20 @@ final class NewTabPageViewController: UIHostingController<AnyView>, NewTabPage {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

view.backgroundColor = UIColor(designSystemColor: .background)

// If there's no tab switcher then this will be true, if there is a tabswitcher then only allow the
// stuff below to happen if it's being dismissed
guard presentedViewController?.isBeingDismissed ?? true else {
return
}

associatedTab.viewed = true

presentNextDaxDialog()

Pixel.fire(pixel: .homeScreenShown)
pixelFiring.fire(.homeScreenShown, withAdditionalParameters: [:])
sendDailyDisplayPixel()

view.backgroundColor = UIColor(designSystemColor: .background)
}

private func setUpDaxDialog() {
Expand Down
8 changes: 4 additions & 4 deletions DuckDuckGo/SettingsSubscriptionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ struct SettingsSubscriptionView: View {
private var subscriptionDetailsView: some View {

if settingsViewModel.state.subscription.entitlements.contains(.networkProtection) {
NavigationLink(destination: NetworkProtectionRootView(), isActive: $isShowingVPN) {
NavigationLink(destination: LazyView(NetworkProtectionRootView()), isActive: $isShowingVPN) {
SettingsCellView(
label: UserText.settingsPProVPNTitle,
image: Image("SettingsPrivacyProVPN"),
Expand All @@ -167,7 +167,7 @@ struct SettingsSubscriptionView: View {
}

if settingsViewModel.state.subscription.entitlements.contains(.dataBrokerProtection) {
NavigationLink(destination: SubscriptionPIRView(), isActive: $isShowingDBP) {
NavigationLink(destination: LazyView(SubscriptionPIRView()), isActive: $isShowingDBP) {
SettingsCellView(
label: UserText.settingsPProDBPTitle,
image: Image("SettingsPrivacyProPIR"),
Expand All @@ -178,7 +178,7 @@ struct SettingsSubscriptionView: View {

if settingsViewModel.state.subscription.entitlements.contains(.identityTheftRestoration) {
NavigationLink(
destination: SubscriptionITPView(),
destination: LazyView(SubscriptionITPView()),
isActive: $isShowingITP) {
SettingsCellView(
label: UserText.settingsPProITRTitle,
Expand All @@ -188,7 +188,7 @@ struct SettingsSubscriptionView: View {
}
}

NavigationLink(destination: SubscriptionSettingsView(configuration: .subscribed, settingsViewModel: settingsViewModel)
NavigationLink(destination: LazyView(SubscriptionSettingsView(configuration: .subscribed, settingsViewModel: settingsViewModel))
.environmentObject(subscriptionNavigationCoordinator)
) {
SettingsCustomCell(content: { manageSubscriptionView })
Expand Down
13 changes: 11 additions & 2 deletions DuckDuckGo/bg.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
/* Button label for OK action */
"action.ok" = "ОК";

/* Title for text zoom menu item. %d%% is replaced with percent, e.g. 56% so do not change that please. */
"action.text-zoom-menu-item" = "Мащабиране (%d%%)";

/* Text zoom menu item */
"action.text-zoom-sheet-menu-item" = "Мащабиране";

/* Title for text zoom sheet view. %d%% is replaced with percent, e.g. 56% so do not change that please. */
"action.text-zoom-sheet-title" = "Мащабиране на текста (%d%%)";

/* Add action - button shown in alert */
"action.title.add" = "Добавяне";

Expand Down Expand Up @@ -2253,7 +2262,7 @@
"settings.sync" = "Синхронизиране и архивиране";

/* Settings screen cell text for text size */
"settings.text.size" = "Размер на текста";
"settings.text.size" = "Мащабиране на текста по подразбиране";

/* Settings screen cell text for theme */
"settings.theme" = "Тема";
Expand Down Expand Up @@ -2601,7 +2610,7 @@
"tab.switcher.accessibility.label" = "Превключване на раздели";

/* Description text for the text size adjustment setting */
"textSize.description" = "Изберете предпочитания размер на текста. Уебсайтът, който разглеждате в DuckDuckGo, ще се регулира спрямо него.";
"textSize.description" = "Увеличете или намалете размера на текста във всички сайтове.";

/* Replacement string is a current percent value e.g. '120%' */
"textSize.footer" = "Размер на текста - %@";
Expand Down
13 changes: 11 additions & 2 deletions DuckDuckGo/cs.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
/* Button label for OK action */
"action.ok" = "DOBŘE";

/* Title for text zoom menu item. %d%% is replaced with percent, e.g. 56% so do not change that please. */
"action.text-zoom-menu-item" = "Zvětšení (%d%%)";

/* Text zoom menu item */
"action.text-zoom-sheet-menu-item" = "Zvětšení";

/* Title for text zoom sheet view. %d%% is replaced with percent, e.g. 56% so do not change that please. */
"action.text-zoom-sheet-title" = "Zvětšení textu (%d%%)";

/* Add action - button shown in alert */
"action.title.add" = "Přidat";

Expand Down Expand Up @@ -2251,7 +2260,7 @@
"settings.sync" = "Synchronizace a zálohování";

/* Settings screen cell text for text size */
"settings.text.size" = "Velikost textu";
"settings.text.size" = "Výchozí velikost textu";

/* Settings screen cell text for theme */
"settings.theme" = "Téma";
Expand Down Expand Up @@ -2599,7 +2608,7 @@
"tab.switcher.accessibility.label" = "Přepínač karet";

/* Description text for the text size adjustment setting */
"textSize.description" = "Vyberte preferovanou velikost textu. Webové stránky, které zobrazíte v DuckDuckGo, se tomu přizpůsobí.";
"textSize.description" = "Zvětši nebo zmenši text na všech webech.";

/* Replacement string is a current percent value e.g. '120%' */
"textSize.footer" = "Velikost textu – %@";
Expand Down
13 changes: 11 additions & 2 deletions DuckDuckGo/da.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
/* Button label for OK action */
"action.ok" = "Okay";

/* Title for text zoom menu item. %d%% is replaced with percent, e.g. 56% so do not change that please. */
"action.text-zoom-menu-item" = "Zoom (%d%%)";

/* Text zoom menu item */
"action.text-zoom-sheet-menu-item" = "Zoom";

/* Title for text zoom sheet view. %d%% is replaced with percent, e.g. 56% so do not change that please. */
"action.text-zoom-sheet-title" = "Tekst-zoom (%d%%)";

/* Add action - button shown in alert */
"action.title.add" = "Tilføj";

Expand Down Expand Up @@ -2251,7 +2260,7 @@
"settings.sync" = "Synkronisering og sikkerhedskopiering";

/* Settings screen cell text for text size */
"settings.text.size" = "Tekststørrelse";
"settings.text.size" = "Standard tekstzoom";

/* Settings screen cell text for theme */
"settings.theme" = "Tema";
Expand Down Expand Up @@ -2599,7 +2608,7 @@
"tab.switcher.accessibility.label" = "Faneskifter";

/* Description text for the text size adjustment setting */
"textSize.description" = "Vælg din foretrukne tekststørrelse. Websteder, som du ser i DuckDuckGo, tilpasser sig denne.";
"textSize.description" = "Forøg eller formindsk tekststørrelsen på tværs af alle websteder.";

/* Replacement string is a current percent value e.g. '120%' */
"textSize.footer" = "Tekststørrelse - %@";
Expand Down
13 changes: 11 additions & 2 deletions DuckDuckGo/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
/* Button label for OK action */
"action.ok" = "OK";

/* Title for text zoom menu item. %d%% is replaced with percent, e.g. 56% so do not change that please. */
"action.text-zoom-menu-item" = "Zoom (%d%%)";

/* Text zoom menu item */
"action.text-zoom-sheet-menu-item" = "Zoom";

/* Title for text zoom sheet view. %d%% is replaced with percent, e.g. 56% so do not change that please. */
"action.text-zoom-sheet-title" = "Textzoom (%d%%)";

/* Add action - button shown in alert */
"action.title.add" = "Hinzufügen";

Expand Down Expand Up @@ -2251,7 +2260,7 @@
"settings.sync" = "Synchronisieren und sichern";

/* Settings screen cell text for text size */
"settings.text.size" = "Textgröße";
"settings.text.size" = "Standardmäßiger Textzoom";

/* Settings screen cell text for theme */
"settings.theme" = "Design";
Expand Down Expand Up @@ -2599,7 +2608,7 @@
"tab.switcher.accessibility.label" = "Tabwechsel-Bildschirm";

/* Description text for the text size adjustment setting */
"textSize.description" = "Wähle die gewünschte Textgröße aus. In DuckDuckGo angezeigte Websites werden sich daran anpassen.";
"textSize.description" = "Erhöhe oder verringere die Textgröße auf allen Seiten.";

/* Replacement string is a current percent value e.g. '120%' */
"textSize.footer" = "Textgröße – %@";
Expand Down
13 changes: 11 additions & 2 deletions DuckDuckGo/el.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
/* Button label for OK action */
"action.ok" = "Εντάξει";

/* Title for text zoom menu item. %d%% is replaced with percent, e.g. 56% so do not change that please. */
"action.text-zoom-menu-item" = "Ζουμ (%d%%)";

/* Text zoom menu item */
"action.text-zoom-sheet-menu-item" = "Ζουμ";

/* Title for text zoom sheet view. %d%% is replaced with percent, e.g. 56% so do not change that please. */
"action.text-zoom-sheet-title" = "Ζουμ κειμένου (%d%%)";

/* Add action - button shown in alert */
"action.title.add" = "Προσθήκη";

Expand Down Expand Up @@ -2251,7 +2260,7 @@
"settings.sync" = "Συγχρονισμός και δημιουργία αντιγράφων ασφαλείας";

/* Settings screen cell text for text size */
"settings.text.size" = "Μέγεθος κειμένου";
"settings.text.size" = "Προεπιλεγμένο ζουμ κειμένου";

/* Settings screen cell text for theme */
"settings.theme" = "Θέμα";
Expand Down Expand Up @@ -2599,7 +2608,7 @@
"tab.switcher.accessibility.label" = "Εναλλαγή καρτελών";

/* Description text for the text size adjustment setting */
"textSize.description" = "Επιλέξτε το προτιμώμενο μέγεθος κειμένου. Οι ιστότοποι που βλέπετε στο DuckDuckGo θα προσαρμοστούν σε αυτό.";
"textSize.description" = "Αυξήστε ή μειώστε το μέγεθος του κειμένου σε όλους τους ιστότοπους.";

/* Replacement string is a current percent value e.g. '120%' */
"textSize.footer" = "Μέγεθος κειμένου - %@";
Expand Down
13 changes: 11 additions & 2 deletions DuckDuckGo/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
/* Button label for OK action */
"action.ok" = "De acuerdo";

/* Title for text zoom menu item. %d%% is replaced with percent, e.g. 56% so do not change that please. */
"action.text-zoom-menu-item" = "Zoom (%d%%)";

/* Text zoom menu item */
"action.text-zoom-sheet-menu-item" = "Zoom";

/* Title for text zoom sheet view. %d%% is replaced with percent, e.g. 56% so do not change that please. */
"action.text-zoom-sheet-title" = "Zoom de texto (%d%%)";

/* Add action - button shown in alert */
"action.title.add" = "Añadir";

Expand Down Expand Up @@ -2251,7 +2260,7 @@
"settings.sync" = "Sincronización y copia de seguridad";

/* Settings screen cell text for text size */
"settings.text.size" = "Tamaño del texto";
"settings.text.size" = "Zoom de texto predeterminado";

/* Settings screen cell text for theme */
"settings.theme" = "Tema";
Expand Down Expand Up @@ -2599,7 +2608,7 @@
"tab.switcher.accessibility.label" = "Cambiar pestañas";

/* Description text for the text size adjustment setting */
"textSize.description" = "Elige tu tamaño de texto preferido. Los sitios web que veas en DuckDuckGo se ajustarán a él.";
"textSize.description" = "Aumenta o disminuye el tamaño del texto en todos los sitios.";

/* Replacement string is a current percent value e.g. '120%' */
"textSize.footer" = "Tamaño del texto - %@";
Expand Down
13 changes: 11 additions & 2 deletions DuckDuckGo/et.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
/* Button label for OK action */
"action.ok" = "OK";

/* Title for text zoom menu item. %d%% is replaced with percent, e.g. 56% so do not change that please. */
"action.text-zoom-menu-item" = "Suurendus (%d%%)";

/* Text zoom menu item */
"action.text-zoom-sheet-menu-item" = "Suurendus";

/* Title for text zoom sheet view. %d%% is replaced with percent, e.g. 56% so do not change that please. */
"action.text-zoom-sheet-title" = "Teksti suumimine (%d%%)";

/* Add action - button shown in alert */
"action.title.add" = "Lisa";

Expand Down Expand Up @@ -2251,7 +2260,7 @@
"settings.sync" = "Sünkroonimine ja varundamine";

/* Settings screen cell text for text size */
"settings.text.size" = "Teksti suurus";
"settings.text.size" = "Vaikimisi teksti suumimine";

/* Settings screen cell text for theme */
"settings.theme" = "Teema";
Expand Down Expand Up @@ -2599,7 +2608,7 @@
"tab.switcher.accessibility.label" = "Vahekaardi vahetaja";

/* Description text for the text size adjustment setting */
"textSize.description" = "Valige soovitud teksti suurus. Veebisaidid, mida DuckDuckGos vaatate, kohanduvad sellega.";
"textSize.description" = "Suurendage või vähendage teksti suurust kõigil saitidel.";

/* Replacement string is a current percent value e.g. '120%' */
"textSize.footer" = "Teksti suurus - %@";
Expand Down
13 changes: 11 additions & 2 deletions DuckDuckGo/fi.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
/* Button label for OK action */
"action.ok" = "OK";

/* Title for text zoom menu item. %d%% is replaced with percent, e.g. 56% so do not change that please. */
"action.text-zoom-menu-item" = "Zoomaus (%d%%)";

/* Text zoom menu item */
"action.text-zoom-sheet-menu-item" = "Zoomaus";

/* Title for text zoom sheet view. %d%% is replaced with percent, e.g. 56% so do not change that please. */
"action.text-zoom-sheet-title" = "Tekstin zoomaus (%d%%)";

/* Add action - button shown in alert */
"action.title.add" = "Lisää";

Expand Down Expand Up @@ -2251,7 +2260,7 @@
"settings.sync" = "Synkronoi ja varmuuskopioi";

/* Settings screen cell text for text size */
"settings.text.size" = "Tekstin koko";
"settings.text.size" = "Tekstin oletuszoomaus";

/* Settings screen cell text for theme */
"settings.theme" = "Teema";
Expand Down Expand Up @@ -2599,7 +2608,7 @@
"tab.switcher.accessibility.label" = "Välilehtien vaihtotyökalu";

/* Description text for the text size adjustment setting */
"textSize.description" = "Valitse tekstin koko. DuckDuckGossa tarkastelemasi verkkosivustot käyttävät sitä.";
"textSize.description" = "Suurenna tai pienennä tekstin kokoa kaikilla sivustoilla.";

/* Replacement string is a current percent value e.g. '120%' */
"textSize.footer" = "Tekstin koko - %@";
Expand Down
Loading

0 comments on commit 0af1673

Please sign in to comment.