Skip to content

Commit

Permalink
Align macOS with new privacy dashboard API specifications (no functio…
Browse files Browse the repository at this point in the history
…nal 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.**
  • Loading branch information
jaceklyp authored Jun 14, 2024
1 parent e08d540 commit 7dd59ce
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 12 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
Expand Down Expand Up @@ -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"
}
},
{
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,17 @@ final class PrivacyDashboardViewController: NSViewController {
}, keyValueStoring: UserDefaults.standard)
}()

private let toggleReportEvents = EventMapping<ToggleReportEvents> { event, _, parameters, _ in
let domainEvent: GeneralPixel
private let toggleReportEvents = EventMapping<PrivacyDashboardEvents> { 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()
Expand All @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/DataBrokerProtection/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
],
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/NetworkProtectionMac/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/SubscriptionUI/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down

0 comments on commit 7dd59ce

Please sign in to comment.