Skip to content

Commit

Permalink
Breakage report improvements (#2197)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/1205842942115003/1205692741026215/f
Tech Design URL: https://app.asana.com/0/1205842942115003/1205917507991804/f

**Description**:
This PR introduces a new version of BSK (PR: duckduckgo/BrowserServicesKit#578) that allows iOS and macOS to share the same web implementation of the `ReportBrokenSite` page and introduce improvements to Pixels and the broken site report data.

Additional changes
- The old native `Report broken site` page has been removed
- Added 2 new Pixels https://app.asana.com/0/1205842942115003/1205859726054342/f
- Removed legacy PrivacyDashboard.storyboard localised strings
  • Loading branch information
federicocappelli authored Dec 6, 2023
1 parent e4ec1a2 commit 97ebdd4
Show file tree
Hide file tree
Showing 143 changed files with 2,783 additions and 5,154 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ fastlane/test_output
# DuckDuckGo

Configuration/ExternalDeveloper.xcconfig
scripts/assets
13 changes: 8 additions & 5 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ extension Pixel {
case forgetAllDataCleared

case privacyDashboardOpened
case privacyDashboardProtectionDisabled
case privacyDashboardProtectionEnabled

case dashboardProtectionAllowlistAdd
case dashboardProtectionAllowlistRemove

case privacyDashboardReportBrokenSite
case privacyDashboardPixelFromJS(rawPixel: String)

Expand Down Expand Up @@ -553,9 +555,10 @@ extension Pixel.Event {
case .forgetAllDataCleared: return "mf_dc"

case .privacyDashboardOpened: return "mp"

case .privacyDashboardProtectionDisabled: return "mp_wla"
case .privacyDashboardProtectionEnabled: return "mp_wlr"

case .dashboardProtectionAllowlistAdd: return "mp_wla"
case .dashboardProtectionAllowlistRemove: return "mp_wlr"

case .privacyDashboardReportBrokenSite: return "mp_rb"
case .privacyDashboardPixelFromJS(let rawPixel): return rawPixel

Expand Down
94 changes: 17 additions & 77 deletions DuckDuckGo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/DuckDuckGo/BrowserServicesKit",
"state": {
"branch": null,
"revision": "bba78df5b33387502973387fd2a4f4ed0a80fce5",
"version": "90.0.0"
"revision": "822e284a50ebb42f0880ebcae87dc36e007f8c31",
"version": "91.0.1"
}
},
{
Expand Down Expand Up @@ -105,8 +105,8 @@
"repositoryURL": "https://github.com/duckduckgo/privacy-dashboard",
"state": {
"branch": null,
"revision": "daa9708223b4b4318fb6448ca44801dfabcddc6f",
"version": "3.0.0"
"revision": "38336a574e13090764ba09a6b877d15ee514e371",
"version": "3.1.1"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
version = "1.3">
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand Down Expand Up @@ -95,7 +95,8 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
allowLocationSimulation = "NO"
showNonLocalizedStrings = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
Expand Down Expand Up @@ -132,6 +133,10 @@
isEnabled = "NO">
</EnvironmentVariable>
</EnvironmentVariables>
<LocationScenarioReference
identifier = "London, England"
referenceType = "1">
</LocationScenarioReference>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/ActionSheetDaxDialogViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class ActionSheetDaxDialogViewController: UIViewController {
return
}

self.dismiss(animated: true)
dismiss(animated: true)
if let spec = spec {
Pixel.fire(pixel: spec.cancelActionPixelName)
}
Expand Down
63 changes: 9 additions & 54 deletions DuckDuckGo/Base.lproj/Feedback.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="h22-TC-N6i">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="c32-S5-kCk">
<device id="retina5_5" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -29,8 +28,8 @@
<scene sceneID="dQB-jL-THB">
<objects>
<viewController id="xnZ-YI-mV7" customClass="FeedbackViewController" customModule="DuckDuckGo" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="C2C-S7-btw">
<rect key="frame" x="0.0" y="0.0" width="414" height="672"/>
<view key="view" contentMode="scaleToFill" misplaced="YES" id="C2C-S7-btw">
<rect key="frame" x="0.0" y="0.0" width="414" height="666"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yS1-TL-7Xx">
Expand Down Expand Up @@ -149,7 +148,7 @@
<objects>
<viewController title="Share Feedback" id="rAY-cv-mjl" userLabel="Positive Feedback" customClass="PositiveFeedbackViewController" customModule="DuckDuckGo" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="zgc-vi-YZO">
<rect key="frame" x="0.0" y="0.0" width="414" height="672"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="666"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="YJu-FY-Z3R">
Expand Down Expand Up @@ -304,8 +303,8 @@
<scene sceneID="pU2-w2-HSD">
<objects>
<tableViewController storyboardIdentifier="FeedbackPicker" title="Share Feedback" id="lY6-5c-iu4" userLabel="Feedback Picker" customClass="FeedbackPickerViewController" customModule="DuckDuckGo" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="insetGrouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="r0Q-7K-kUf">
<rect key="frame" x="0.0" y="0.0" width="414" height="672"/>
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="insetGrouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="r0Q-7K-kUf">
<rect key="frame" x="0.0" y="0.0" width="414" height="666"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<view key="tableHeaderView" contentMode="scaleToFill" id="h6D-eT-YCX">
<rect key="frame" x="0.0" y="0.0" width="414" height="170"/>
Expand Down Expand Up @@ -372,11 +371,11 @@
<rect key="frame" x="20" y="225.33333206176758" width="374" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="has-ek-M3V" id="ZVE-Ej-2Dt">
<rect key="frame" x="0.0" y="0.0" width="343.66666666666669" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="347.66666666666669" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" usesAttributedText="YES" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Vp9-Jz-mUC">
<rect key="frame" x="20" y="0.0" width="315.66666666666669" height="44"/>
<rect key="frame" x="16" y="0.0" width="323.66666666666669" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<attributedString key="attributedText">
<fragment content="Title">
Expand Down Expand Up @@ -633,47 +632,6 @@
</objects>
<point key="canvasLocation" x="1361" y="924"/>
</scene>
<!--Themable Navigation Controller-->
<scene sceneID="4Cd-5O-E32">
<objects>
<navigationController id="h22-TC-N6i" customClass="ThemableNavigationController" customModule="DuckDuckGo" customModuleProvider="target" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" translucent="NO" id="7vH-Qe-IZl">
<rect key="frame" x="0.0" y="20" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="8h9-Oy-9xi" kind="relationship" relationship="rootViewController" id="fId-6e-Jea"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="i6L-q4-FDc" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-1384" y="1690"/>
</scene>
<!--Report Broken Site-->
<scene sceneID="F6V-Ex-sf0">
<objects>
<viewController id="8h9-Oy-9xi" customClass="ReportBrokenSiteViewController" customModule="DuckDuckGo" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="z30-di-tew">
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="Up8-9v-hR9"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
<toolbarItems/>
<navigationItem key="navigationItem" title="Report Broken Site" id="WjT-HM-yim">
<barButtonItem key="leftBarButtonItem" title="Close" id="cZl-qB-kSL">
<connections>
<action selector="onClosePressedWithSender:" destination="8h9-Oy-9xi" id="F2e-uB-ZF8"/>
</connections>
</barButtonItem>
</navigationItem>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<nil key="simulatedBottomBarMetrics"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8yo-EF-AhR" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-659.4202898550725" y="1689.9456521739132"/>
</scene>
</scenes>
<designables>
<designable name="TMj-NM-j3b">
Expand All @@ -683,8 +641,5 @@
<resources>
<image name="happyFace" width="48" height="48"/>
<image name="sadFace" width="48" height="48"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
12 changes: 6 additions & 6 deletions DuckDuckGo/Base.lproj/Settings.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22154" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="w88-u3-TgK">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="w88-u3-TgK">
<device id="retina6_5" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22130"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
<capability name="Image references" minToolsVersion="12.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="collection view cell content view" minToolsVersion="11.0"/>
Expand Down Expand Up @@ -1102,7 +1102,7 @@
<viewControllerPlaceholder storyboardName="HomeRow" id="4xy-dB-g65" sceneMemberID="viewController"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="f7V-ze-SNX" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2526" y="96"/>
<point key="canvasLocation" x="2564" y="-129"/>
</scene>
<!--Text Size-->
<scene sceneID="27H-Zj-xSY">
Expand Down Expand Up @@ -1278,15 +1278,15 @@
</viewControllerPlaceholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ztc-dF-sSr" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2540" y="-72"/>
<point key="canvasLocation" x="2573" y="-61"/>
</scene>
<!--Feedback-->
<scene sceneID="AdS-SO-faF">
<objects>
<viewControllerPlaceholder storyboardName="Feedback" referencedIdentifier="Feedback" id="Hvb-oi-0lX" sceneMemberID="viewController"/>
<viewControllerPlaceholder storyboardName="Feedback" id="Hvb-oi-0lX" sceneMemberID="viewController"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="TVx-JL-4ci" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2524" y="148"/>
<point key="canvasLocation" x="2572" y="53"/>
</scene>
<!--Automatically Clear Data-->
<scene sceneID="y9R-2c-mBz">
Expand Down
63 changes: 0 additions & 63 deletions DuckDuckGo/BrokenSiteCategories.swift

This file was deleted.

31 changes: 24 additions & 7 deletions DuckDuckGo/MainViewController+Segues.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import Common
import Core
import Bookmarks
import BrowserServicesKit
import PrivacyDashboard

extension MainViewController {

Expand Down Expand Up @@ -122,21 +123,37 @@ extension MainViewController {
os_log(#function, log: .generalLog, type: .debug)
hideAllHighlightsIfNeeded()

let storyboard = UIStoryboard(name: "Feedback", bundle: nil)
guard let controller: UINavigationController = storyboard.instantiateInitialViewController(),
let brokenSiteScreen = controller.topViewController as? ReportBrokenSiteViewController else {
assertionFailure()
let brokenSiteInfo = currentTab?.getCurrentWebsiteInfo()
guard let currentURL = currentTab?.url,
let privacyInfo = currentTab?.makePrivacyInfo(url: currentURL) else {
assertionFailure("Missing fundamental data")
return
}

brokenSiteScreen.brokenSiteInfo = currentTab?.getCurrentWebsiteInfo()

let storyboard = UIStoryboard(name: "PrivacyDashboard", bundle: nil)
let controller = storyboard.instantiateInitialViewController { coder in
PrivacyDashboardViewController(coder: coder,
privacyInfo: privacyInfo,
privacyConfigurationManager: ContentBlocking.shared.privacyConfigurationManager,
contentBlockingManager: ContentBlocking.shared.contentBlockingManager,
initMode: .reportBrokenSite)
}

guard let controller = controller else {
assertionFailure("PrivacyDashboardViewController not initialised")
return
}

currentTab?.privacyDashboard = controller
controller.popoverPresentationController?.delegate = controller
controller.brokenSiteInfo = brokenSiteInfo

if UIDevice.current.userInterfaceIdiom == .pad {
controller.modalPresentationStyle = .formSheet
} else {
controller.modalPresentationStyle = .pageSheet
}

present(controller, animated: true)
}

Expand Down
6 changes: 3 additions & 3 deletions DuckDuckGo/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -680,10 +680,10 @@ class MainViewController: UIViewController {
func onQuickFirePressed() {
wakeLazyFireButtonAnimator()

self.forgetAllWithAnimation {}
self.dismiss(animated: true)
forgetAllWithAnimation {}
dismiss(animated: true)
if KeyboardSettings().onAppLaunch {
self.enterSearch()
enterSearch()
}
}

Expand Down
Loading

0 comments on commit 97ebdd4

Please sign in to comment.