privacy protection dashboard - #184
Conversation
# Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj
subsymbolic
left a comment
There was a problem hiding this comment.
Nice work Chris, this is coming along nicely, I've added a few comments and am ignoring assets for now as I know you're still waiting on them.
| } | ||
|
|
||
| private let suitName: String | ||
| private let suiteName: String |
| } | ||
|
|
||
|
|
||
| func testWhenUsingBlockedOnlCacheIsNotUsed() { |
| XCTAssertEqual(4, testee.siteScore(blockedOnly: false)) | ||
| } | ||
|
|
||
| // Test all the adverse contions together |
| "privacy.protection.major.trackers.found" = "%d Major Tracker Networks Found"; | ||
| "privacy.protection.tos.unknown" = "Unknown Privacy Practices"; | ||
| "privacy.protection.tos.good" = "Good Privacy Practices"; | ||
| "privacy.protection.tos.some" = "Some Privacy Practices"; |
There was a problem hiding this comment.
Should the "Some" be "Mixed"? https://app.asana.com/0/search/472359718529713/468767597251709
| return trackersBlocked.reduce(0) { $0 + $1.value } | ||
| } | ||
|
|
||
| private func majorTrackers(trackers: [Tracker: Int]) -> Int { |
There was a problem hiding this comment.
Same again, rename to uniqueMajorTrackerNetworks?
| return trackersDetected.contains(where: { $0.key.fromMajorNetwork } ) | ||
|
|
||
| public var majorTrackersDetected: Int { | ||
| return majorTrackers(trackers: trackersDetected) |
There was a problem hiding this comment.
This is really a count of the unique major tracker networks detected (not a total). Maybe rename to `uniqueMajorTrackerNetworksDetected?
|
|
||
| public var contrainsIpTracker: Bool { | ||
| return trackersDetected.contains(where: { $0.key.isIpTracker } ) | ||
| public var majorTrackersBlocked: Int { |
There was a problem hiding this comment.
Same as before, rename to uniqueMajorTrackerNetworksBlocked?
|
|
||
| public func length() -> Int { | ||
| return characters.count | ||
| return count |
| fileprivate func onSiteRatingChanged() { | ||
| delegate?.tab(self, didChangeSiteRating: siteRating) | ||
| contentBlockerPopover?.updateSiteRating(siteRating: siteRating!) | ||
| // contentBlockerPopover?.updateSiteRating(siteRating: siteRating!) |
| delegate?.tab(self, didChangeSiteRating: siteRating) | ||
| contentBlockerPopover?.updateSiteRating(siteRating: siteRating!) | ||
| // contentBlockerPopover?.updateSiteRating(siteRating: siteRating!) | ||
| privacyDashboard?.updateSiteRating(siteRating!) |
There was a problem hiding this comment.
This predates your code but while this is being edited let's protect it with a let statement rather than a force unwrap and maybe dismiss or clear the privacyDashboard for the nil case?
|
I've noticed a slight weirdness with the detection counts. We are currently counting items as detected even if we choose not to block them (maybe because they are first party). This seems odd when comparing the protect on / off results for facebook as we're telling the user that there is a tracker and then not blocking it. There was some discussion about this ages ago, you might need to check the latest algorithm that extensions are using for this |
|
@subsymbolic that's ready for review again. I think that's more of a UX issue tbh. It's accurate in terms of what the text says. I'll address it as part of the algorithm review task I've got. Thanks again! |
| delegate?.tab(self, didChangeSiteRating: siteRating) | ||
| contentBlockerPopover?.updateSiteRating(siteRating: siteRating!) | ||
| if let siteRating = siteRating { | ||
| delegate?.tab(self, didChangeSiteRating: siteRating) |
There was a problem hiding this comment.
didChangeSiteRating accepts an optional (as nil is a valid case) so should be outside the let check.
| public var containsMajorTracker: Bool { | ||
| return trackersDetected.contains(where: { $0.key.fromMajorNetwork } ) | ||
|
|
||
| public var uniqueMajorTrackersDetected: Int { |
There was a problem hiding this comment.
I still think the label for these is misleading. It's the number of unique major tracker networks detected not number of trackers. Sorry! If uniqueMajorTrackerNetworksDetected is too much how about uniqueMajorNetworksDetected? Happy with any label that captures the meaning!
|
Back to you @subsymbolic 🏸 :) |




Reviewer: Mia
Asana: https://app.asana.com/0/414235014887631/457416080701390
CC:
Description:
Removes old content blocking popover and replaces it with a new privacy protection dashboard.
Note: Zeppelin is not the source of truth yet. Assets used were provided and the site grade in the omnibar as per discussions in Asana.
Steps to test this PR:
Test 1:
Test 2:
Test 3:
Test 4:
Test 5:
Test 6:
Test 7:
Test 8:
Test 9:
Reviewer Checklist:
PR DRI Checklist: