Skip to content

Commit

Permalink
Remove priming modal experiment (#3373)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1201011656765697/1208493680548174/f

**Description**:
Remove priming modal experiment code
  • Loading branch information
Bunn authored Oct 10, 2024
1 parent 0c243dc commit 24cf340
Show file tree
Hide file tree
Showing 17 changed files with 5 additions and 773 deletions.
50 changes: 0 additions & 50 deletions DuckDuckGo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion DuckDuckGo/Menus/MainMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,6 @@ final class MainMenu: NSMenu {
NSMenuItem(title: "Reset Pixels Storage", action: #selector(MainViewController.resetDailyPixels))
NSMenuItem(title: "Reset Remote Messages", action: #selector(AppDelegate.resetRemoteMessages))
NSMenuItem(title: "Reset CPM Experiment Cohort (needs restart)", action: #selector(AppDelegate.resetCpmCohort))
NSMenuItem(title: "Reset Duck Player Onboarding", action: #selector(MainViewController.resetDuckPlayerOnboarding))
NSMenuItem(title: "Reset Duck Player Preferences", action: #selector(MainViewController.resetDuckPlayerPreferences))
NSMenuItem(title: "Reset Sync Promo prompts", action: #selector(MainViewController.resetSyncPromoPrompts))

Expand Down
5 changes: 0 additions & 5 deletions DuckDuckGo/Menus/MainMenuActions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -834,11 +834,6 @@ extension MainViewController {
UserDefaults.standard.set(true, forKey: UserDefaultsWrapper<Bool>.Key.homePageShowEmailProtection.rawValue)
}

@objc func resetDuckPlayerOnboarding(_ sender: Any?) {
DefaultDuckPlayerOnboardingDecider().reset()
DuckPlayerOnboardingExperiment().reset()
}

@objc func resetDuckPlayerPreferences(_ sender: Any?) {
DuckPlayerPreferences.shared.reset()
}
Expand Down
3 changes: 2 additions & 1 deletion DuckDuckGo/Statistics/GeneralPixel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,7 @@ enum GeneralPixel: PixelKitEventV2 {
case .onboardingDuckplayerUsed5to7(let cohort):
return [PixelKit.Parameters.experimentCohort: cohort]

/// Duck Player pixels
case .duckPlayerDailyUniqueView,
.duckPlayerViewFromYoutubeViaMainOverlay,
.duckPlayerViewFromYoutubeViaHoverButton,
Expand All @@ -1196,7 +1197,7 @@ enum GeneralPixel: PixelKitEventV2 {
.duckPlayerContingencySettingsDisplayed,
.duckPlayerWeeklyUniqueView,
.duckPlayerContingencyLearnMoreClicked:
return DuckPlayerOnboardingExperiment().getPixelParameters()
return nil

case .bookmarksSortButtonClicked(let origin),
.bookmarksSortButtonDismissed(let origin),
Expand Down
3 changes: 0 additions & 3 deletions DuckDuckGo/Tab/Model/Tab+Navigation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ extension Tab: NavigationResponder {
// Duck Player overlay navigations handling
.weak(nullable: self.duckPlayer),

// Duck Player onboarding banner
.weak(nullable: self.duckPlayerOnboarding),

// open external scheme link in another app
.weak(nullable: self.externalAppSchemeHandler),

Expand Down

This file was deleted.

6 changes: 1 addition & 5 deletions DuckDuckGo/Tab/TabExtensions/DuckPlayerTabExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,17 @@ final class DuckPlayerTabExtension {
private weak var youtubePlayerScript: YoutubePlayerUserScript?
private let onboardingDecider: DuckPlayerOnboardingDecider
private var shouldSelectNextNewTab: Bool?
private let experimentManager: OnboardingExperimentManager

init(duckPlayer: DuckPlayer,
isBurner: Bool,
scriptsPublisher: some Publisher<some YoutubeScriptsProvider, Never>,
webViewPublisher: some Publisher<WKWebView, Never>,
preferences: DuckPlayerPreferences = .shared,
onboardingDecider: DuckPlayerOnboardingDecider,
experimentManager: OnboardingExperimentManager = DuckPlayerOnboardingExperiment()) {
onboardingDecider: DuckPlayerOnboardingDecider) {
self.duckPlayer = duckPlayer
self.isBurner = isBurner
self.preferences = preferences
self.onboardingDecider = onboardingDecider
self.experimentManager = experimentManager
webViewPublisher.sink { [weak self] webView in
self?.webView = webView
}.store(in: &cancellables)
Expand Down Expand Up @@ -378,7 +375,6 @@ extension DuckPlayerTabExtension: NavigationResponder {
frequency: .legacyDaily,
withAdditionalParameters: params)

experimentManager.fireWeeklyUniqueViewPixel(extraParams: params)
}
}

Expand Down
4 changes: 0 additions & 4 deletions DuckDuckGo/Tab/TabExtensions/TabExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,6 @@ extension TabExtensionsBuilder {
onboardingDecider: duckPlayerOnboardingDecider)
}

add {
DuckPlayerOnboardingTabExtension(onboardingDecider: duckPlayerOnboardingDecider)
}

add {
SpecialErrorPageTabExtension(webViewPublisher: args.webViewFuture,
scriptsPublisher: userScripts.compactMap { $0 },
Expand Down
13 changes: 0 additions & 13 deletions DuckDuckGo/Tab/View/BrowserTabViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ final class BrowserTabViewController: NSViewController {
self.subscribeToTabContent(of: selectedTabViewModel)
self.subscribeToHoveredLink(of: selectedTabViewModel)
self.subscribeToUserDialogs(of: selectedTabViewModel)
self.subscribeToDuckPlayerOnboardingPrompt(of: selectedTabViewModel)

self.adjustFirstResponder(force: true)
self.presentContextualOnboarding()
Expand Down Expand Up @@ -534,18 +533,6 @@ final class BrowserTabViewController: NSViewController {
#endif
}

private func subscribeToDuckPlayerOnboardingPrompt(of tabViewModel: TabViewModel?) {
tabViewModel?.tab.duckPlayerOnboardingPublisher.sink { [weak self, weak tab = tabViewModel?.tab] onboardingState in

guard let self, tab != nil, let onboardingState = onboardingState, onboardingState.onboardingDecider.canDisplayOnboarding else {
self?.duckPlayerOnboardingModalManager.close(animated: false, completion: nil)
return
}

self.duckPlayerOnboardingModalManager.show(on: self.view, animated: true)
}.store(in: &tabViewModelCancellables)
}

private func shouldMakeContentViewFirstResponder(for tabContent: Tab.TabContent) -> Bool {
// always steal focus when first responder is not a text field
guard view.window?.firstResponder is NSText else {
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 24cf340

Please sign in to comment.