Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for controlling sections visibility on HTML New Tab Page #3551

Merged
merged 50 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
6adffd3
Define experimental feature and enable switching between HTML and nat…
ayoy Oct 31, 2024
53afdce
Add NewTabPageUserScript with init action
ayoy Nov 6, 2024
e86c338
Use single instance of NTP user script and implement context menu
ayoy Nov 6, 2024
803a9f0
Enable developer tools on HTML NTP
ayoy Nov 6, 2024
ee77f47
PoC RMF support
ayoy Nov 6, 2024
d70a446
Use a separate web view for NTP
ayoy Nov 7, 2024
2a33e64
Set up NTP user script in a dedicated webView
ayoy Nov 7, 2024
b546100
Define experimental feature and enable switching between HTML and nat…
ayoy Oct 31, 2024
7717a8f
Extract Experimental Features menu into its own class
ayoy Nov 7, 2024
b20088a
Remove AppDelegate.toggleHTMLNTP
ayoy Nov 7, 2024
ddd4ca0
Revert changes to ReleaseNotesUserScript
ayoy Nov 7, 2024
e2b7dfe
Add ExperimentalFeatures.swift
ayoy Nov 7, 2024
48f308d
WIP internal user decider
ayoy Nov 7, 2024
89fc44e
Integrate ExperimentalFeatures with FeatureFlagger
ayoy Nov 8, 2024
c195b03
ExperimentalFeatures -> FeatureFlagOverrides
ayoy Nov 8, 2024
7a46dad
Only allow for overridding HTML NTP flag
ayoy Nov 8, 2024
037d823
Fix SwiftLint violation
ayoy Nov 8, 2024
9cd1810
Merge branch 'main' into dominik/experimental-features
ayoy Nov 12, 2024
95cd2bc
Move FeatureFlagOverrides to BSK
ayoy Nov 12, 2024
03221fe
Update overrides menu
ayoy Nov 12, 2024
fe3999a
Update BSK
ayoy Nov 13, 2024
03bc3dc
Merge branch 'main' into dominik/feature-flag-overrides
ayoy Nov 13, 2024
05e9407
Update overrides menu
ayoy Nov 13, 2024
0b7c142
Update mocks
ayoy Nov 13, 2024
70f4916
Use feature flag in DuckURLSchemeHandler
ayoy Nov 13, 2024
1396f7b
FeatureFlagProtocol -> FeatureFlagDescribing
ayoy Nov 13, 2024
83ba686
Revert "PoC RMF support"
ayoy Nov 13, 2024
54605a3
Merge branch 'dominik/feature-flag-overrides' into dominik/htmlntp-se…
ayoy Nov 13, 2024
fbebacb
Clean up code
ayoy Nov 13, 2024
779379a
Use local featureFlagger property and pass newTabPageUserScript in Br…
ayoy Nov 13, 2024
8dd5ab9
Clean up code
ayoy Nov 13, 2024
4a10dfa
Clean up ReleaseNotesUserScript
ayoy Nov 13, 2024
e49f0be
Add placeholder empty Favorites
ayoy Nov 13, 2024
58b2d02
Make developer tools work with the NTP webView
ayoy Nov 13, 2024
c1dc66e
Clean up UserDefaultsWrapper
ayoy Nov 14, 2024
530278f
Add Asana project link to htmlNewTabPage flag
ayoy Nov 14, 2024
3d1e051
Merge branch 'dominik/feature-flag-overrides' into dominik/htmlntp-se…
ayoy Nov 14, 2024
76a6a1f
Remove unused experimentalFeaturesMenu
ayoy Nov 14, 2024
66bda16
Merge branch 'dominik/feature-flag-overrides' into dominik/htmlntp-se…
ayoy Nov 14, 2024
ed7425a
Merge branch 'main' into dominik/htmlntp-sections
ayoy Nov 14, 2024
68916f0
Clean up the code
ayoy Nov 14, 2024
5c7b72c
Add placeholder Privacy Stats view
ayoy Nov 14, 2024
5eee236
Update MainMenuActions
ayoy Nov 14, 2024
98c252c
Add NewTabPageWebView
ayoy Nov 14, 2024
c164e41
Remove @preconcurrency until we're on Xcode 16
ayoy Nov 14, 2024
80b8641
Use 1 User Script per Web View
ayoy Nov 14, 2024
16cbe5c
Merge branch 'main' into dominik/htmlntp-sections
ayoy Nov 15, 2024
466cf23
Merge branch 'main' into dominik/htmlntp-sections
ayoy Nov 18, 2024
53e787e
Add NewTabPageViewModel
ayoy Nov 19, 2024
555053c
Update comment
ayoy Nov 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,8 @@
372A0FED2B2379310033BF7F /* SyncMetricsEventsHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 372A0FEB2B2379310033BF7F /* SyncMetricsEventsHandler.swift */; };
372BC2A12A4AFA47001D8FD5 /* SyncCredentialsAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 372BC2A02A4AFA47001D8FD5 /* SyncCredentialsAdapter.swift */; };
372BC2A22A4AFA47001D8FD5 /* SyncCredentialsAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 372BC2A02A4AFA47001D8FD5 /* SyncCredentialsAdapter.swift */; };
372ED7C22CDD481B002287EC /* NewTabPageUserContentController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 372ED7C12CDD4815002287EC /* NewTabPageUserContentController.swift */; };
372ED7C32CDD481B002287EC /* NewTabPageUserContentController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 372ED7C12CDD4815002287EC /* NewTabPageUserContentController.swift */; };
3739326529AE4B39009346AE /* DDGSync in Frameworks */ = {isa = PBXBuildFile; productRef = 3739326429AE4B39009346AE /* DDGSync */; };
3739326729AE4B42009346AE /* DDGSync in Frameworks */ = {isa = PBXBuildFile; productRef = 3739326629AE4B42009346AE /* DDGSync */; };
373A1AA8283ED1B900586521 /* BookmarkHTMLReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 373A1AA7283ED1B900586521 /* BookmarkHTMLReader.swift */; };
Expand All @@ -1133,6 +1135,8 @@
37534CA3281132CB002621E7 /* TabLazyLoaderDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37534CA2281132CB002621E7 /* TabLazyLoaderDataSource.swift */; };
37534CA52811987D002621E7 /* AdjacentItemEnumeratorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37534CA42811987D002621E7 /* AdjacentItemEnumeratorTests.swift */; };
37534CA8281198CD002621E7 /* AdjacentItemEnumerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37534CA62811988E002621E7 /* AdjacentItemEnumerator.swift */; };
3758CBAB2CE63D540089FC2D /* NewTabPageWebViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3758CBAA2CE63D510089FC2D /* NewTabPageWebViewModel.swift */; };
3758CBAC2CE63D540089FC2D /* NewTabPageWebViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3758CBAA2CE63D510089FC2D /* NewTabPageWebViewModel.swift */; };
376113CC2B29CD5B00E794BB /* CriticalPathsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 565E46DF2B2725DD0013AC2A /* CriticalPathsTests.swift */; };
376705AF27EB488600DD8D76 /* RoundedSelectionRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B0511B3262CAA5A00F6079C /* RoundedSelectionRowView.swift */; };
376731822C7E226A00EB097B /* HomePageViewBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = 376731812C7E226A00EB097B /* HomePageViewBackground.swift */; };
Expand Down Expand Up @@ -1271,6 +1275,10 @@
37F44A5F298C17830025E7FE /* Navigation in Frameworks */ = {isa = PBXBuildFile; productRef = 37F44A5E298C17830025E7FE /* Navigation */; };
37F8ABD32CE3EE5B00CB0294 /* FeatureFlagOverridesMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37F8ABD22CE3EE5B00CB0294 /* FeatureFlagOverridesMenu.swift */; };
37F8ABD42CE3EE5B00CB0294 /* FeatureFlagOverridesMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37F8ABD22CE3EE5B00CB0294 /* FeatureFlagOverridesMenu.swift */; };
37FB430E2CDB84A500479A1E /* NewTabPageUserScript.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37FB430D2CDB84A200479A1E /* NewTabPageUserScript.swift */; };
37FB430F2CDB84A500479A1E /* NewTabPageUserScript.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37FB430D2CDB84A200479A1E /* NewTabPageUserScript.swift */; };
37FB43112CDB883B00479A1E /* NewTabPageActionsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37FB43102CDB883700479A1E /* NewTabPageActionsManager.swift */; };
37FB43122CDB883B00479A1E /* NewTabPageActionsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37FB43102CDB883700479A1E /* NewTabPageActionsManager.swift */; };
37FD78112A29EBD100B36DB1 /* SyncErrorHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37FD78102A29EBD100B36DB1 /* SyncErrorHandler.swift */; };
37FD78122A29EBD100B36DB1 /* SyncErrorHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37FD78102A29EBD100B36DB1 /* SyncErrorHandler.swift */; };
4B0135CE2729F1AA00D54834 /* NSPasteboardExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B0135CD2729F1AA00D54834 /* NSPasteboardExtension.swift */; };
Expand Down Expand Up @@ -3590,6 +3598,7 @@
37219B3C2CC27DB300C9D7A8 /* NewTabPageSearchBoxExperimentTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewTabPageSearchBoxExperimentTests.swift; sourceTree = "<group>"; };
372A0FEB2B2379310033BF7F /* SyncMetricsEventsHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncMetricsEventsHandler.swift; sourceTree = "<group>"; };
372BC2A02A4AFA47001D8FD5 /* SyncCredentialsAdapter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncCredentialsAdapter.swift; sourceTree = "<group>"; };
372ED7C12CDD4815002287EC /* NewTabPageUserContentController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewTabPageUserContentController.swift; sourceTree = "<group>"; };
373A1AA7283ED1B900586521 /* BookmarkHTMLReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarkHTMLReader.swift; sourceTree = "<group>"; };
373A1AA9283ED86C00586521 /* BookmarksHTMLReaderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksHTMLReaderTests.swift; sourceTree = "<group>"; };
373A1AAF2842C4EA00586521 /* BookmarkHTMLImporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarkHTMLImporter.swift; sourceTree = "<group>"; };
Expand All @@ -3607,6 +3616,7 @@
37534CA2281132CB002621E7 /* TabLazyLoaderDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabLazyLoaderDataSource.swift; sourceTree = "<group>"; };
37534CA42811987D002621E7 /* AdjacentItemEnumeratorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdjacentItemEnumeratorTests.swift; sourceTree = "<group>"; };
37534CA62811988E002621E7 /* AdjacentItemEnumerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdjacentItemEnumerator.swift; sourceTree = "<group>"; };
3758CBAA2CE63D510089FC2D /* NewTabPageWebViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewTabPageWebViewModel.swift; sourceTree = "<group>"; };
376113C52B29BCD600E794BB /* SyncE2EUITests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = SyncE2EUITests.xcconfig; sourceTree = "<group>"; };
376113D42B29CD5B00E794BB /* SyncE2EUITests App Store.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SyncE2EUITests App Store.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
376113D72B29D0F800E794BB /* SyncE2EUITestsAppStore.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = SyncE2EUITestsAppStore.xcconfig; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3715,6 +3725,8 @@
37F19A6628E1B43200740DC6 /* DuckPlayerPreferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DuckPlayerPreferences.swift; sourceTree = "<group>"; };
37F19A6928E2F2D000740DC6 /* DuckPlayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DuckPlayer.swift; sourceTree = "<group>"; };
37F8ABD22CE3EE5B00CB0294 /* FeatureFlagOverridesMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeatureFlagOverridesMenu.swift; sourceTree = "<group>"; };
37FB430D2CDB84A200479A1E /* NewTabPageUserScript.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewTabPageUserScript.swift; sourceTree = "<group>"; };
37FB43102CDB883700479A1E /* NewTabPageActionsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewTabPageActionsManager.swift; sourceTree = "<group>"; };
37FD78102A29EBD100B36DB1 /* SyncErrorHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncErrorHandler.swift; sourceTree = "<group>"; };
4B0135CD2729F1AA00D54834 /* NSPasteboardExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSPasteboardExtension.swift; sourceTree = "<group>"; };
4B02197F25E05FAC00ED7DEA /* FireproofingURLExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FireproofingURLExtensions.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -8752,6 +8764,10 @@
AAE71DB225F66A0900D74437 /* HomePage */ = {
isa = PBXGroup;
children = (
37FB43102CDB883700479A1E /* NewTabPageActionsManager.swift */,
372ED7C12CDD4815002287EC /* NewTabPageUserContentController.swift */,
37FB430D2CDB84A200479A1E /* NewTabPageUserScript.swift */,
3758CBAA2CE63D510089FC2D /* NewTabPageWebViewModel.swift */,
85589E8527BBB8DD0038AD11 /* Model */,
AAE71DB325F66A3F00D74437 /* View */,
85AC7ADA27BD628400FFB69B /* HomePage.swift */,
Expand Down Expand Up @@ -11220,6 +11236,7 @@
EED4D3D92C874AE200C79EEA /* PopoverInfoViewController.swift in Sources */,
3707C722294B5D2900682A9F /* WKWebViewExtension.swift in Sources */,
3706FAD9293F65D500E42796 /* FirefoxFaviconsReader.swift in Sources */,
37FB430E2CDB84A500479A1E /* NewTabPageUserScript.swift in Sources */,
3706FADB293F65D500E42796 /* ContentBlockingRulesUpdateObserver.swift in Sources */,
3706FADC293F65D500E42796 /* FirefoxLoginReader.swift in Sources */,
3706FADD293F65D500E42796 /* AtbParser.swift in Sources */,
Expand Down Expand Up @@ -11377,6 +11394,7 @@
4B9DB0362A983B24000927DB /* WaitlistTermsAndConditionsView.swift in Sources */,
37197EA82942443D00394917 /* BrowserTabViewController.swift in Sources */,
3706FB39293F65D500E42796 /* PrivacyDashboardPopover.swift in Sources */,
372ED7C32CDD481B002287EC /* NewTabPageUserContentController.swift in Sources */,
3706FB3B293F65D500E42796 /* RootView.swift in Sources */,
3706FB3C293F65D500E42796 /* AddressBarTextField.swift in Sources */,
3706FB3D293F65D500E42796 /* FocusRingView.swift in Sources */,
Expand Down Expand Up @@ -11643,6 +11661,7 @@
3706FBCD293F65D500E42796 /* LocaleExtension.swift in Sources */,
37D0469E2C7D0EDD00AEAA50 /* CustomBackground.swift in Sources */,
3706FBCE293F65D500E42796 /* SavePaymentMethodViewController.swift in Sources */,
3758CBAB2CE63D540089FC2D /* NewTabPageWebViewModel.swift in Sources */,
9FA5A0A62BC8F34900153786 /* UserDefaultsBookmarkFoldersStore.swift in Sources */,
1DDC85002B835BC000670238 /* SearchPreferences.swift in Sources */,
3706FBD0293F65D500E42796 /* WebKitVersionProvider.swift in Sources */,
Expand Down Expand Up @@ -11783,6 +11802,7 @@
3706FC16293F65D500E42796 /* PasswordManagementLoginModel.swift in Sources */,
3706FC17293F65D500E42796 /* TabViewModel.swift in Sources */,
3706FC18293F65D500E42796 /* TabDragAndDropManager.swift in Sources */,
37FB43112CDB883B00479A1E /* NewTabPageActionsManager.swift in Sources */,
1DC669712B6CF0D700AA0645 /* TabSnapshotStore.swift in Sources */,
3706FC19293F65D500E42796 /* NSNotificationName+Favicons.swift in Sources */,
3706FC1A293F65D500E42796 /* PinningManager.swift in Sources */,
Expand Down Expand Up @@ -13020,6 +13040,7 @@
37054FCE2876472D00033B6F /* WebViewSnapshotView.swift in Sources */,
560EB9392C789A450080DBC8 /* OnboardingSuggestedSearchesProvider.swift in Sources */,
4BBC16A027C4859400E00A38 /* DeviceAuthenticationService.swift in Sources */,
37FB43122CDB883B00479A1E /* NewTabPageActionsManager.swift in Sources */,
C181945C2C7CDCC700381092 /* PromotionView.swift in Sources */,
CB24F70C29A3D9CB006DCC58 /* AppConfigurationURLProvider.swift in Sources */,
1DEF3BAD2BD145A9004A2FBA /* AutoClearHandler.swift in Sources */,
Expand Down Expand Up @@ -13061,6 +13082,7 @@
AA68C3D32490ED62001B8783 /* NavigationBarViewController.swift in Sources */,
AA585DAF2490E6E600E9A3E2 /* MainViewController.swift in Sources */,
F1D43AEE2B98D8DF00BAB743 /* MainMenuActions+VanillaBrowser.swift in Sources */,
3758CBAC2CE63D540089FC2D /* NewTabPageWebViewModel.swift in Sources */,
37F19A6A28E2F2D000740DC6 /* DuckPlayer.swift in Sources */,
AA5FA69A275F91C700DCE9C9 /* Favicon.swift in Sources */,
AABEE69A24A902A90043105B /* SuggestionContainerViewModel.swift in Sources */,
Expand Down Expand Up @@ -13189,6 +13211,7 @@
56D6A3D629DB2BAB0055215A /* ContinueSetUpView.swift in Sources */,
B6B5F5842B03580A008DB58A /* RequestFilePermissionView.swift in Sources */,
4B1E6EEE27AB5E5100F51793 /* PasswordManagementListSection.swift in Sources */,
372ED7C22CDD481B002287EC /* NewTabPageUserContentController.swift in Sources */,
31C9ADE52AF0564500CEF57D /* WaitlistFeatureSetupHandler.swift in Sources */,
AA222CB92760F74E00321475 /* FaviconReferenceCache.swift in Sources */,
4B9292A126670D2A00AD2C21 /* BookmarkTreeController.swift in Sources */,
Expand Down Expand Up @@ -13424,6 +13447,7 @@
CB63DECB2CDC0BBE0097986A /* PageRefreshMonitor.swift in Sources */,
B6040856274B830F00680351 /* DictionaryExtension.swift in Sources */,
3199AF772C80734A003AEBDC /* DuckPlayerOnboardingViewController.swift in Sources */,
37FB430F2CDB84A500479A1E /* NewTabPageUserScript.swift in Sources */,
B684592725C93C0500DC17B6 /* Publishers.NestedObjectChanges.swift in Sources */,
B6DA06E62913F39400225DE2 /* MenuItemSelectors.swift in Sources */,
3712092C2C23383C003ADF3D /* RemoteMessagingStoreErrorHandling.swift in Sources */,
Expand Down
3 changes: 3 additions & 0 deletions DuckDuckGo/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
let bookmarksManager = LocalBookmarkManager.shared
var privacyDashboardWindow: NSWindow?

let newTabPageActionsManager: NewTabPageActionsManaging
let activeRemoteMessageModel: ActiveRemoteMessageModel
let homePageSettingsModel = HomePage.Models.SettingsModel()
let remoteMessagingClient: RemoteMessagingClient!
Expand Down Expand Up @@ -308,6 +309,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
freemiumDBPUserStateManager: freemiumDBPUserStateManager)
freemiumDBPPromotionViewCoordinator = FreemiumDBPPromotionViewCoordinator(freemiumDBPUserStateManager: freemiumDBPUserStateManager,
freemiumDBPFeature: freemiumDBPFeature)

newTabPageActionsManager = NewTabPageActionsManager(appearancePreferences: .shared)
}

func applicationWillFinishLaunching(_ notification: Notification) {
Expand Down
Loading
Loading