Skip to content

Commit

Permalink
Subscriptions: 27: Update navigation to use Push Views (#2659)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/414235014887631/1206942263287858/f

Description:

Updates Subscription navigation to use "Push" transitions instead of sheets
Adds .onFirstAppear() modifier to view as SwiftUI's .onAppear() might be called multiple times
Cache subscription in memory to prevent UI Glitches
Other minor fixes and renames
  • Loading branch information
afterxleep authored Apr 2, 2024
1 parent d2ce9b6 commit 82af9c2
Show file tree
Hide file tree
Showing 24 changed files with 725 additions and 701 deletions.
2 changes: 2 additions & 0 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ extension Pixel {
case privacyProPurchaseFailureAccountNotCreated
case privacyProPurchaseSuccess
case privacyProRestorePurchaseOfferPageEntry
case privacyProRestorePurchaseClick
case privacyProRestorePurchaseEmailStart
case privacyProRestorePurchaseStoreStart
case privacyProRestorePurchaseEmailSuccess
Expand Down Expand Up @@ -1164,6 +1165,7 @@ extension Pixel.Event {
case .privacyProPurchaseFailureBackendError: return "m_privacy-pro_app_subscription-purchase_failure_account-creation"
case .privacyProPurchaseSuccess: return "m_privacy-pro_app_subscription-purchase_success"
case .privacyProRestorePurchaseOfferPageEntry: return "m_privacy-pro_offer_restore-purchase_click"
case .privacyProRestorePurchaseClick: return "m_privacy-pro_app-settings_restore-purchase_click"
case .privacyProRestorePurchaseEmailStart: return "m_privacy-pro_activate-subscription_enter-email_click"
case .privacyProRestorePurchaseStoreStart: return "m_privacy-pro_activate-subscription_restore-purchase_click"
case .privacyProRestorePurchaseEmailSuccess: return "m_privacy-pro_app_subscription-restore-using-email_success"
Expand Down
20 changes: 12 additions & 8 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -820,15 +820,16 @@
D668D9272B6937D2008E2FF2 /* SubscriptionITPViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D668D9262B6937D2008E2FF2 /* SubscriptionITPViewModel.swift */; };
D668D9292B69681C008E2FF2 /* IdentityTheftRestorationPagesUserScript.swift in Sources */ = {isa = PBXBuildFile; fileRef = D668D9282B69681C008E2FF2 /* IdentityTheftRestorationPagesUserScript.swift */; };
D668D92B2B696840008E2FF2 /* IdentityTheftRestorationPagesFeature.swift in Sources */ = {isa = PBXBuildFile; fileRef = D668D92A2B696840008E2FF2 /* IdentityTheftRestorationPagesFeature.swift */; };
D66F683D2BB333C100AE93E2 /* SubscriptionContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66F683C2BB333C100AE93E2 /* SubscriptionContainerView.swift */; };
D670E5BB2BB6A75300941A42 /* SubscriptionNavigationCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = D670E5BA2BB6A75200941A42 /* SubscriptionNavigationCoordinator.swift */; };
D670E5BD2BB6AA0000941A42 /* View+AppearModifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = D670E5BC2BB6AA0000941A42 /* View+AppearModifiers.swift */; };
D68A21442B7EC08500BB372E /* SubscriptionExternalLinkView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D68A21432B7EC08500BB372E /* SubscriptionExternalLinkView.swift */; };
D68A21462B7EC16200BB372E /* SubscriptionExternalLinkViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D68A21452B7EC16200BB372E /* SubscriptionExternalLinkViewModel.swift */; };
D68DF81C2B58302E0023DBEA /* SubscriptionRestoreView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D68DF81B2B58302E0023DBEA /* SubscriptionRestoreView.swift */; };
D68DF81E2B5830380023DBEA /* SubscriptionRestoreViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D68DF81D2B5830380023DBEA /* SubscriptionRestoreViewModel.swift */; };
D69DBB502B72B1D300156310 /* View+TopMostController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69DBB4F2B72B1D200156310 /* View+TopMostController.swift */; };
D69FBF762B28BE3600B505F1 /* SettingsSubscriptionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D69FBF752B28BE3600B505F1 /* SettingsSubscriptionView.swift */; };
D6BFCB5F2B7524AA0051FF81 /* SubscriptionPIRView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BFCB5E2B7524AA0051FF81 /* SubscriptionPIRView.swift */; };
D6BFCB612B7525160051FF81 /* SubscriptionPIRViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BFCB602B7525160051FF81 /* SubscriptionPIRViewModel.swift */; };
D6D95CE12B6D52DA00960317 /* RootPresentationMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6D95CE02B6D52DA00960317 /* RootPresentationMode.swift */; };
D6D95CE32B6D9F8800960317 /* AsyncHeadlessWebViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6D95CE22B6D9F8800960317 /* AsyncHeadlessWebViewModel.swift */; };
D6E0C1832B7A2B1E00D5E1E9 /* DesktopDownloadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6E0C1822B7A2B1E00D5E1E9 /* DesktopDownloadView.swift */; };
D6E0C1852B7A2B9400D5E1E9 /* DesktopDownloadPlatformConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6E0C1842B7A2B9400D5E1E9 /* DesktopDownloadPlatformConstants.swift */; };
Expand Down Expand Up @@ -2493,15 +2494,16 @@
D668D9262B6937D2008E2FF2 /* SubscriptionITPViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubscriptionITPViewModel.swift; sourceTree = "<group>"; };
D668D9282B69681C008E2FF2 /* IdentityTheftRestorationPagesUserScript.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IdentityTheftRestorationPagesUserScript.swift; sourceTree = "<group>"; };
D668D92A2B696840008E2FF2 /* IdentityTheftRestorationPagesFeature.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IdentityTheftRestorationPagesFeature.swift; sourceTree = "<group>"; };
D66F683C2BB333C100AE93E2 /* SubscriptionContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionContainerView.swift; sourceTree = "<group>"; };
D670E5BA2BB6A75200941A42 /* SubscriptionNavigationCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionNavigationCoordinator.swift; sourceTree = "<group>"; };
D670E5BC2BB6AA0000941A42 /* View+AppearModifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+AppearModifiers.swift"; sourceTree = "<group>"; };
D68A21432B7EC08500BB372E /* SubscriptionExternalLinkView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubscriptionExternalLinkView.swift; sourceTree = "<group>"; };
D68A21452B7EC16200BB372E /* SubscriptionExternalLinkViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubscriptionExternalLinkViewModel.swift; sourceTree = "<group>"; };
D68DF81B2B58302E0023DBEA /* SubscriptionRestoreView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionRestoreView.swift; sourceTree = "<group>"; };
D68DF81D2B5830380023DBEA /* SubscriptionRestoreViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionRestoreViewModel.swift; sourceTree = "<group>"; };
D69DBB4F2B72B1D200156310 /* View+TopMostController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+TopMostController.swift"; sourceTree = "<group>"; };
D69FBF752B28BE3600B505F1 /* SettingsSubscriptionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsSubscriptionView.swift; sourceTree = "<group>"; };
D6BFCB5E2B7524AA0051FF81 /* SubscriptionPIRView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionPIRView.swift; sourceTree = "<group>"; };
D6BFCB602B7525160051FF81 /* SubscriptionPIRViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionPIRViewModel.swift; sourceTree = "<group>"; };
D6D95CE02B6D52DA00960317 /* RootPresentationMode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootPresentationMode.swift; sourceTree = "<group>"; };
D6D95CE22B6D9F8800960317 /* AsyncHeadlessWebViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncHeadlessWebViewModel.swift; sourceTree = "<group>"; };
D6E0C1822B7A2B1E00D5E1E9 /* DesktopDownloadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DesktopDownloadView.swift; sourceTree = "<group>"; };
D6E0C1842B7A2B9400D5E1E9 /* DesktopDownloadPlatformConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DesktopDownloadPlatformConstants.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4656,7 +4658,7 @@
isa = PBXGroup;
children = (
D664C7982B289AA000CBFA76 /* WKUserContentController+Handler.swift */,
D69DBB4F2B72B1D200156310 /* View+TopMostController.swift */,
D670E5BC2BB6AA0000941A42 /* View+AppearModifiers.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand All @@ -4665,15 +4667,16 @@
isa = PBXGroup;
children = (
D664C7AD2B289AA000CBFA76 /* PurchaseInProgressView.swift */,
D66F683C2BB333C100AE93E2 /* SubscriptionContainerView.swift */,
D664C7AE2B289AA000CBFA76 /* SubscriptionFlowView.swift */,
D68DF81B2B58302E0023DBEA /* SubscriptionRestoreView.swift */,
D64648AC2B59936B0033090B /* SubscriptionEmailView.swift */,
D668D9242B693778008E2FF2 /* SubscriptionITPView.swift */,
D68A21432B7EC08500BB372E /* SubscriptionExternalLinkView.swift */,
D6BFCB5E2B7524AA0051FF81 /* SubscriptionPIRView.swift */,
D6F93E3D2B50A8A0004C268D /* SubscriptionSettingsView.swift */,
D6D95CE02B6D52DA00960317 /* RootPresentationMode.swift */,
D60B1F262B9DDE5A00AE4760 /* SubscriptionGoogleView.swift */,
D670E5BA2BB6A75200941A42 /* SubscriptionNavigationCoordinator.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -6646,6 +6649,7 @@
020108A929A7C1CD00644F9D /* AppTrackerImageCache.swift in Sources */,
4B78074E2B183A1F009DB2CF /* SurveyURLBuilder.swift in Sources */,
3132FA2A27A0788F00DD7A12 /* QuickLookPreviewHelper.swift in Sources */,
D670E5BB2BB6A75300941A42 /* SubscriptionNavigationCoordinator.swift in Sources */,
C1D21E2D293A5965006E5A05 /* AutofillLoginSession.swift in Sources */,
4B53648A26718D0E001AA041 /* EmailWaitlist.swift in Sources */,
027F48762A4B5FBE001A1C6C /* AppTPLinkButton.swift in Sources */,
Expand Down Expand Up @@ -6752,6 +6756,7 @@
B60DFF072872B64B0061E7C2 /* JSAlertController.swift in Sources */,
981FED6E22025151008488D7 /* BlankSnapshotViewController.swift in Sources */,
98F3A1DC217B373E0011A0D4 /* DarkTheme.swift in Sources */,
D66F683D2BB333C100AE93E2 /* SubscriptionContainerView.swift in Sources */,
851B128822200575004781BC /* Onboarding.swift in Sources */,
3151F0EE2735800800226F58 /* VoiceSearchFeedbackView.swift in Sources */,
857EEB752095FFAC008A005C /* HomeRowInstructionsViewController.swift in Sources */,
Expand Down Expand Up @@ -6783,7 +6788,6 @@
31C70B5528045E3500FB6AD1 /* SecureVaultErrorReporter.swift in Sources */,
F4CE6D1B257EA33C00D0A6AA /* FireButtonAnimator.swift in Sources */,
85582E0029D7409700E9AE35 /* SyncSettingsViewController+PDFRendering.swift in Sources */,
D69DBB502B72B1D300156310 /* View+TopMostController.swift in Sources */,
EE0153EF2A70021E002A8B26 /* NetworkProtectionInviteView.swift in Sources */,
9888F77B2224980500C46159 /* FeedbackViewController.swift in Sources */,
D6E83C662B23936F006C8AFB /* SettingsDebugView.swift in Sources */,
Expand Down Expand Up @@ -6913,6 +6917,7 @@
984D035C24AE15CD0066CFB8 /* TabSwitcherSettings.swift in Sources */,
D6E83C562B21ECC1006C8AFB /* SettingsLegacyViewProvider.swift in Sources */,
98B31292218CCB8C00E54DE1 /* AppDependencyProvider.swift in Sources */,
D670E5BD2BB6AA0000941A42 /* View+AppearModifiers.swift in Sources */,
C13F3F6A2B7F883A0083BE40 /* AuthConfirmationPromptViewController.swift in Sources */,
02C57C4B2514FEFB009E5129 /* DoNotSellSettingsViewController.swift in Sources */,
02A54A9C2A097C95000C8FED /* AppTPHomeViewSectionRenderer.swift in Sources */,
Expand Down Expand Up @@ -6970,7 +6975,6 @@
D6E83C682B23B6A3006C8AFB /* FontSettings.swift in Sources */,
31EF52E1281B3BDC0034796E /* AutofillLoginListItemViewModel.swift in Sources */,
1E4FAA6627D8DFC800ADC5B3 /* CompleteDownloadRowViewModel.swift in Sources */,
D6D95CE12B6D52DA00960317 /* RootPresentationMode.swift in Sources */,
83004E862193E5ED00DA013C /* TabViewControllerBrowsingMenuExtension.swift in Sources */,
EE01EB402AFBD0000096AAC9 /* NetworkProtectionVPNSettingsViewModel.swift in Sources */,
EE72CA852A862D000043B5B3 /* NetworkProtectionDebugViewController.swift in Sources */,
Expand Down
Loading

0 comments on commit 82af9c2

Please sign in to comment.