From 7dd59ce45b196a52b3d213c9b332362a767599ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20=C5=81yp?= Date: Fri, 14 Jun 2024 16:53:57 +0200 Subject: [PATCH] Align macOS with new privacy dashboard API specifications (no functional changes) (#2864) Task/Issue URL: https://app.asana.com/0/72649045549333/1207379730878832/f **Description**: Implement an iOS experiment to validate the new design for the updated Site Breakage Report flow. This experiment aims to generate better data with more actionable reports, categorize breakages, and reduce triage times. **There are no functional changes for macOS.** --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 10 ++++---- .../View/PrivacyDashboardViewController.swift | 24 ++++++++++++++++--- .../DataBrokerProtection/Package.swift | 2 +- .../NetworkProtectionMac/Package.swift | 2 +- LocalPackages/SubscriptionUI/Package.swift | 2 +- 6 files changed, 30 insertions(+), 12 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 7be79ea49d..13088b58c6 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -13078,7 +13078,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 154.1.0; + version = 155.0.0; }; }; 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index a531ca401a..bbbe7f2f74 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "4a4735455ac5c49e3928fc841cbffdd80d9274e3", - "version" : "154.1.0" + "revision" : "ddb0eb213c081a5d6d3f78f4df5dff11bc974218", + "version" : "155.0.0" } }, { @@ -104,8 +104,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/privacy-dashboard", "state" : { - "revision" : "25b8903191a40b21b09525085fe325ae3386092e", - "version" : "3.6.0" + "revision" : "ff482d6169b153fd25afa079eef3989c30ca3682", + "version" : "4.0.0" } }, { @@ -174,7 +174,7 @@ { "identity" : "trackerradarkit", "kind" : "remoteSourceControl", - "location" : "https://github.com/duckduckgo/TrackerRadarKit.git", + "location" : "https://github.com/duckduckgo/TrackerRadarKit", "state" : { "revision" : "c01e6a59d000356b58ec77053e0a99d538be56a5", "version" : "2.1.1" diff --git a/DuckDuckGo/PrivacyDashboard/View/PrivacyDashboardViewController.swift b/DuckDuckGo/PrivacyDashboard/View/PrivacyDashboardViewController.swift index f29cee0cdc..444228f8b0 100644 --- a/DuckDuckGo/PrivacyDashboard/View/PrivacyDashboardViewController.swift +++ b/DuckDuckGo/PrivacyDashboard/View/PrivacyDashboardViewController.swift @@ -59,13 +59,17 @@ final class PrivacyDashboardViewController: NSViewController { }, keyValueStoring: UserDefaults.standard) }() - private let toggleReportEvents = EventMapping { event, _, parameters, _ in - let domainEvent: GeneralPixel + private let toggleReportEvents = EventMapping { event, _, parameters, _ in + let domainEvent: GeneralPixel? switch event { case .toggleReportDismiss: domainEvent = .toggleReportDismiss case .toggleReportDoNotSend: domainEvent = .toggleReportDoNotSend + case .showReportBrokenSite, .reportBrokenSiteShown, .breakageCategorySelected, .reportBrokenSiteSent, .overallCategorySelected: + domainEvent = nil + } + if let domainEvent { + PixelKit.fire(domainEvent, withAdditionalParameters: parameters) } - PixelKit.fire(domainEvent, withAdditionalParameters: parameters) } private let permissionHandler = PrivacyDashboardPermissionHandler() @@ -82,6 +86,7 @@ final class PrivacyDashboardViewController: NSViewController { privacyConfigurationManager: PrivacyConfigurationManaging = ContentBlocking.shared.privacyConfigurationManager) { self.privacyDashboardController = PrivacyDashboardController(privacyInfo: privacyInfo, dashboardMode: dashboardMode, + variant: .control, privacyConfigurationManager: privacyConfigurationManager, eventMapping: toggleReportEvents) super.init(nibName: nil, bundle: nil) @@ -190,6 +195,11 @@ final class PrivacyDashboardViewController: NSViewController { extension PrivacyDashboardViewController: PrivacyDashboardControllerDelegate { + func privacyDashboardController(_ privacyDashboardController: PrivacyDashboard.PrivacyDashboardController, + didSelectBreakageCategory category: String) { + // Not used in macOS + } + func privacyDashboardControllerDidRequestShowReportBrokenSite(_ privacyDashboardController: PrivacyDashboard.PrivacyDashboardController) { // Not used in macOS: PixelKit.fire(GeneralPixel.privacyDashboardReportBrokenSite) } @@ -252,6 +262,14 @@ extension PrivacyDashboardViewController: PrivacyDashboardNavigationDelegate { extension PrivacyDashboardViewController: PrivacyDashboardReportBrokenSiteDelegate { + func privacyDashboardControllerDidRequestShowAlertForMissingDescription(_ privacyDashboardController: PrivacyDashboardController) { + // Not used in macOS + } + + func privacyDashboardControllerDidRequestShowGeneralFeedback(_ privacyDashboardController: PrivacyDashboardController) { + // Not used in macOS + } + func privacyDashboardController(_ privacyDashboardController: PrivacyDashboard.PrivacyDashboardController, didRequestSubmitBrokenSiteReportWithCategory category: String, description: String) { diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index 6cbebb7363..bba94fab9c 100644 --- a/LocalPackages/DataBrokerProtection/Package.swift +++ b/LocalPackages/DataBrokerProtection/Package.swift @@ -29,7 +29,7 @@ let package = Package( targets: ["DataBrokerProtection"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "154.1.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "155.0.0"), .package(path: "../SwiftUIExtensions"), .package(path: "../XPCHelper"), ], diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index 6785a755d2..f5b3780070 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -32,7 +32,7 @@ let package = Package( .library(name: "VPNAppLauncher", targets: ["VPNAppLauncher"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "154.1.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "155.0.0"), .package(url: "https://github.com/airbnb/lottie-spm", exact: "4.4.1"), .package(path: "../AppLauncher"), .package(path: "../UDSHelper"), diff --git a/LocalPackages/SubscriptionUI/Package.swift b/LocalPackages/SubscriptionUI/Package.swift index 72b668d8ed..b0dd9bb4cd 100644 --- a/LocalPackages/SubscriptionUI/Package.swift +++ b/LocalPackages/SubscriptionUI/Package.swift @@ -12,7 +12,7 @@ let package = Package( targets: ["SubscriptionUI"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "154.1.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "155.0.0"), .package(path: "../SwiftUIExtensions") ], targets: [