Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakage report improvements #2168

Merged
merged 23 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
68a3c30
experiments and tests
federicocappelli Nov 8, 2023
ca24499
test 2
federicocappelli Nov 9, 2023
8d46332
PrivacyDashboard localised strings removed, old report broken website…
federicocappelli Nov 14, 2023
eb667da
Merge branch 'fcappelli/breakage_report_improvements' of https://gith…
federicocappelli Nov 14, 2023
a39eb5b
Web Report broken status adopted everywhere
federicocappelli Nov 15, 2023
0e7e34e
2 new pixels added for protection toggled from report broken site, re…
federicocappelli Nov 15, 2023
80a398e
only height changed
federicocappelli Nov 15, 2023
8e886b7
comments added, old code removed
federicocappelli Nov 16, 2023
0352c8c
cleanup
federicocappelli Nov 16, 2023
5b6693b
Merge branch 'develop' of https://github.com/duckduckgo/iOS into fcap…
federicocappelli Nov 16, 2023
4ede0e0
IDELaunchSchemeLanguageDoubleLocalizedStrings removed
federicocappelli Nov 16, 2023
fa933f1
old files removed
federicocappelli Nov 16, 2023
f066d70
fixed some unit tests, submodule updated
federicocappelli Nov 16, 2023
32e9340
swift lint run with --strict, so the local execution is the same as t…
federicocappelli Nov 16, 2023
30ce95f
schema improved
federicocappelli Nov 16, 2023
6a9b35e
Pixels name and param aligned with mac/win
federicocappelli Nov 17, 2023
15eb9a3
unused files removed, privacy dashboard dependency is now driven by BSK
federicocappelli Nov 20, 2023
16474c1
Merge branch 'develop' of https://github.com/duckduckgo/iOS into fcap…
federicocappelli Nov 20, 2023
b7fa2cd
old user text removed
federicocappelli Nov 20, 2023
64a8ae0
code cleanup
federicocappelli Nov 20, 2023
17a0300
translations applied, too many from VPN
federicocappelli Nov 21, 2023
8262e63
BSK version 85.0.0
federicocappelli Nov 23, 2023
31ea764
Merge branch 'develop' into fcappelli/breakage_report_improvements
federicocappelli Nov 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -533,9 +535,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
96 changes: 18 additions & 78 deletions DuckDuckGo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"package": "BrowserServicesKit",
"repositoryURL": "https://github.com/DuckDuckGo/BrowserServicesKit",
"state": {
"branch": null,
"revision": "b97c451037f7a24aef6389be8252df301d2294cd",
"version": "84.1.1"
"branch": "fcappelli/breakage_report_improvements",
"revision": "60cc52d888adb482519495b73277b5f15d128ab4",
"version": null
}
},
{
Expand Down Expand Up @@ -105,8 +105,8 @@
"repositoryURL": "https://github.com/duckduckgo/privacy-dashboard",
"state": {
"branch": null,
"revision": "b4ac92a444e79d5651930482623b9f6dc9265667",
"version": "2.0.0"
"revision": "59dedf0f4ff1e9147de0806a54c6043861eb0870",
"version": "3.1.0"
}
},
{
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
63 changes: 9 additions & 54 deletions DuckDuckGo/Base.lproj/Feedback.storyboard
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReportBrokenWebsite part removed from this 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>
14 changes: 7 additions & 7 deletions DuckDuckGo/Base.lproj/Settings.storyboard
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReportBrokenWebsite segue removed and replaced with the PrivacyDashboardVC

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 Expand Up @@ -2346,7 +2346,7 @@
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="secondaryLabelColor">
<color red="0.23529411764705882" green="0.23529411764705882" blue="0.2627450980392157" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
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
Loading
Loading