Skip to content

Commit

Permalink
Privacy Dashboard 8.1.0: Improved breakage form (#5466)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1206594217596623/1209127604215385/f

### Description

Upgrades Privacy Dashboard to 8.0.0, which contains the new site
breakage flow as can be previewed
[here](https://duckduckgo.github.io/privacy-dashboard/app-debug/html/iframe.html?platforms=android%2Cios%2Cmacos%2Cwindows%2Cbrowser&screen=breakageForm)

Figma:
https://www.figma.com/design/eeVdakW2pjijbDlv8HUSgZ/O-E---Report-Broken-Site-Flow-(Design-Updates-2024-09)?node-id=4024-6272&m=dev

### Steps to test this PR

1. Trigger the breakage form in the two possible ways:
- Open the Privacy Dashboard and click on "Report a problem with this
site"
- Open the app menu ••• and click on "Report Broken Site"
- Complete the onboarding and refresh a site 3 times in quick
succession. Then click report broken site when the dialog appears

2. Confirm that the breakage form matches the Figma or the [web preview
](https://duckduckgo.github.io/privacy-dashboard/app-debug/html/iframe.html?platforms=android%2Cios%2Cmacos%2Cwindows%2Cbrowser&screen=breakageForm)

3. Attempt to complete a broken site report from both entry points
above. Things to keep an eye on:
- The “See what’s sent” toggle expands and collapses normally
- When the category is “Something else”, trying to submit the form
without a description should raise an alert
- The description is optional for all other categories 

### UI changes
| Before  | After |
| - | - |
|
![](https://raw.githubusercontent.com/duckduckgo/privacy-dashboard/9f4f108dfc398e9c4800dabf907b43f0226ad665/integration-tests/android.spec-int.js-snapshots/screen-breakage-form-android-darwin.png)
|
![](https://raw.githubusercontent.com/duckduckgo/privacy-dashboard/6d9c8e84bc4a7e412dbbb58c86e8b984e7b35af9/integration-tests/android.spec-int.js-snapshots/category-type-selection-android-darwin.png)
|
| |
![](https://raw.githubusercontent.com/duckduckgo/privacy-dashboard/6d9c8e84bc4a7e412dbbb58c86e8b984e7b35af9/integration-tests/android.spec-int.js-snapshots/category-selection-android-darwin.png)
|
| |
![](https://raw.githubusercontent.com/duckduckgo/privacy-dashboard/6d9c8e84bc4a7e412dbbb58c86e8b984e7b35af9/integration-tests/android.spec-int.js-snapshots/screen-breakage-form-android-darwin.png)
|
  • Loading branch information
mgurgel authored Jan 22, 2025
1 parent 33dabba commit df58f18
Show file tree
Hide file tree
Showing 44 changed files with 1,180 additions and 698 deletions.
17 changes: 0 additions & 17 deletions app/src/main/java/com/duckduckgo/app/browser/BrowserActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ import com.duckduckgo.common.utils.DispatcherProvider
import com.duckduckgo.common.utils.playstore.PlayStoreUtils
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.navigation.api.GlobalActivityStarter
import com.duckduckgo.privacy.dashboard.api.ui.DashboardOpener
import com.duckduckgo.privacy.dashboard.api.ui.PrivacyDashboardHybridScreenParams.PrivacyDashboardPrimaryScreen
import com.duckduckgo.privacy.dashboard.api.ui.PrivacyDashboardHybridScreenParams.PrivacyDashboardToggleReportScreen
import com.duckduckgo.savedsites.impl.bookmarks.BookmarksActivity.Companion.SAVED_SITE_URL_EXTRA
import com.duckduckgo.site.permissions.impl.ui.SitePermissionScreenNoParams
import javax.inject.Inject
Expand Down Expand Up @@ -465,20 +462,6 @@ open class BrowserActivity : DuckDuckGoActivity() {
return intent.getBooleanExtra(NEW_SEARCH_EXTRA, false)
}

fun launchPrivacyDashboard(toggle: Boolean) {
currentTab?.tabId?.let { tabId ->
val params = if (toggle) {
PrivacyDashboardToggleReportScreen(tabId, opener = DashboardOpener.DASHBOARD)
} else {
PrivacyDashboardPrimaryScreen(
tabId,
)
}
val intent = globalActivityStarter.startIntent(this, params)
intent?.let { startActivity(it) }
}
}

fun launchFire() {
pixel.fire(AppPixelName.FORGET_ALL_PRESSED_BROWSING)
val dialog = FireDialog(
Expand Down
30 changes: 25 additions & 5 deletions app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,11 @@ import com.duckduckgo.mobile.android.app.tracking.ui.AppTrackingProtectionScreen
import com.duckduckgo.navigation.api.GlobalActivityStarter
import com.duckduckgo.navigation.api.GlobalActivityStarter.DeeplinkActivityParams
import com.duckduckgo.privacy.dashboard.api.ui.DashboardOpener
import com.duckduckgo.privacy.dashboard.api.ui.PrivacyDashboardHybridScreenParams
import com.duckduckgo.privacy.dashboard.api.ui.PrivacyDashboardHybridScreenParams.BrokenSiteForm
import com.duckduckgo.privacy.dashboard.api.ui.PrivacyDashboardHybridScreenParams.BrokenSiteForm.BrokenSiteFormReportFlow
import com.duckduckgo.privacy.dashboard.api.ui.PrivacyDashboardHybridScreenParams.PrivacyDashboardPrimaryScreen
import com.duckduckgo.privacy.dashboard.api.ui.PrivacyDashboardHybridScreenParams.PrivacyDashboardToggleReportScreen
import com.duckduckgo.privacy.dashboard.api.ui.PrivacyDashboardHybridScreenResult
import com.duckduckgo.privacyprotectionspopup.api.PrivacyProtectionsPopup
import com.duckduckgo.privacyprotectionspopup.api.PrivacyProtectionsPopupFactory
import com.duckduckgo.privacyprotectionspopup.api.PrivacyProtectionsPopupViewState
Expand Down Expand Up @@ -619,6 +620,15 @@ class BrowserTabFragment :
}
}

private val activityResultPrivacyDashboard = registerForActivityResult(StartActivityForResult()) { result: ActivityResult ->
if (result.resultCode == PrivacyDashboardHybridScreenResult.REPORT_SUBMITTED) {
binding.rootView.makeSnackbarWithNoBottomInset(
resId = string.brokenSiteSubmittedReportMessage,
duration = Snackbar.LENGTH_LONG,
).show()
}
}

private val errorSnackbar: Snackbar by lazy {
binding.browserLayout.makeSnackbarWithNoBottomInset(R.string.crashedWebViewErrorMessage, Snackbar.LENGTH_INDEFINITE)
.setBehavior(NonDismissibleBehavior())
Expand Down Expand Up @@ -894,10 +904,10 @@ class BrowserTabFragment :
}

private fun onOmnibarCustomTabPrivacyDashboardPressed() {
val params = PrivacyDashboardHybridScreenParams.PrivacyDashboardPrimaryScreen(tabId)
val params = PrivacyDashboardPrimaryScreen(tabId)
val intent = globalActivityStarter.startIntent(requireContext(), params)
contentScopeScripts.sendSubscriptionEvent(createBreakageReportingEventData())
intent?.let { startActivity(it) }
intent?.let { activityResultPrivacyDashboard.launch(intent) }
pixel.fire(CustomTabPixelNames.CUSTOM_TABS_PRIVACY_DASHBOARD_OPENED)
}

Expand All @@ -915,7 +925,7 @@ class BrowserTabFragment :

private fun onOmnibarPrivacyShieldButtonPressed() {
contentScopeScripts.sendSubscriptionEvent(createBreakageReportingEventData())
browserActivity?.launchPrivacyDashboard(toggle = false)
launchPrivacyDashboard(toggle = false)
}

private fun onOmnibarVoiceSearchPressed() {
Expand Down Expand Up @@ -1875,6 +1885,16 @@ class BrowserTabFragment :
}
}

private fun launchPrivacyDashboard(toggle: Boolean) {
val params = if (toggle) {
PrivacyDashboardToggleReportScreen(tabId, opener = DashboardOpener.DASHBOARD)
} else {
PrivacyDashboardPrimaryScreen(tabId)
}
globalActivityStarter.startIntent(requireContext(), params)
?.let { activityResultPrivacyDashboard.launch(it) }
}

private fun launchBrokenSiteFeedback(data: BrokenSiteData) {
val context = context ?: return

Expand All @@ -1883,7 +1903,7 @@ class BrowserTabFragment :
else -> BrokenSiteFormReportFlow.MENU
}
globalActivityStarter.startIntent(context, BrokenSiteForm(tabId = tabId, reportFlow = reportFlow))
?.let { startActivity(it) }
?.let { activityResultPrivacyDashboard.launch(it) }
}

private fun launchToggleReportFeedback(opener: DashboardOpener) {
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values-bg/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,4 +785,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Страница с нов раздел</string>
<string name="showOnAppLaunchOptionSpecificPage">Конкретна страница</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Благодарим ви! Вашето докладване ни помага да направим DuckDuckGo по-добър за всички!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -789,4 +789,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Stránka Nová karta</string>
<string name="showOnAppLaunchOptionSpecificPage">Konkrétní stránka</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Děkujeme! Podrobnosti od tebe pomůžou zlepšit DuckDuckGo pro všechny!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,4 +785,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Ny faneside</string>
<string name="showOnAppLaunchOptionSpecificPage">Specifik side</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Tak! Din rapport hjælper med at gøre DuckDuckGo bedre for alle!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,4 +785,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Neue Tab-Seite</string>
<string name="showOnAppLaunchOptionSpecificPage">Bestimmte Seite</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Vielen Dank! Dein Bericht hilft, DuckDuckGo für alle zu verbessern!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-el/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,4 +785,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Σελίδα νέας καρτέλας</string>
<string name="showOnAppLaunchOptionSpecificPage">Συγκεκριμένη σελίδα</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Σε ευχαριστούμε! Η αναφορά σας βοηθάει ώστε να γίνει το DuckDuckGo καλύτερο για όλους!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,4 +785,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Página de nueva pestaña</string>
<string name="showOnAppLaunchOptionSpecificPage">Página específica</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">¡Gracias! ¡Tu notificación ayuda a que DuckDuckGo sea mejor para todos!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-et/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,4 +785,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Uue vahekaardi leht</string>
<string name="showOnAppLaunchOptionSpecificPage">Konkreetne lehekülg</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Aitäh! Sinu aruanne aitab muuta DuckDuckGo kõigi jaoks paremaks!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-fi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,4 +785,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Uusi välilehti -sivu</string>
<string name="showOnAppLaunchOptionSpecificPage">Tietty sivu</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Kiitos! Ilmoituksesi auttaa tekemään DuckDuckGosta paremman kaikille!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,4 +785,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Nouvelle page d\'onglet</string>
<string name="showOnAppLaunchOptionSpecificPage">Page spécifique</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Merci ! Votre signalement contribue à améliorer DuckDuckGo pour tous.</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-hr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -789,4 +789,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Nova stranica kartice</string>
<string name="showOnAppLaunchOptionSpecificPage">Specifična stranica</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Hvala! Tvoje prijave pomažu nam poboljšati DuckDuckGo za sve!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-hu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,4 +785,7 @@
<string name="showOnAppLaunchOptionNewTabPage">„Új lap” oldal</string>
<string name="showOnAppLaunchOptionSpecificPage">Speciális oldal</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Köszönjük! A jelentésed segít nekünk abban, hogy a DuckDuckGo mindenki számára jobb élményt nyújthasson!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,4 +785,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Pagina Nuova scheda</string>
<string name="showOnAppLaunchOptionSpecificPage">Pagina specifica</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Grazie. Il tuo rapporto aiuta a rendere DuckDuckGo migliore per tutti.</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-lt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -789,4 +789,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Naujas skirtuko puslapis</string>
<string name="showOnAppLaunchOptionSpecificPage">Konkretus puslapis</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Dėkojame! Jūsų pateikta informacija padeda tobulinti „DuckDuckGo“ visiems!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-lv/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -787,4 +787,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Jaunas cilnes lapa</string>
<string name="showOnAppLaunchOptionSpecificPage">Konkrēta lapa</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Paldies! Tavs ziņojums palīdz padarīt DuckDuckGo labāku visiem lietotājiem!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-nb/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,4 +785,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Ny faneside</string>
<string name="showOnAppLaunchOptionSpecificPage">Spesifikk side</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Takk! Rapporten din bidrar til å gjøre DuckDuckGo bedre for alle!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,4 +785,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Nieuwe tabbladpagina</string>
<string name="showOnAppLaunchOptionSpecificPage">Specifieke pagina</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Bedankt! Jouw melding helpt DuckDuckGo beter te maken voor iedereen!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -789,4 +789,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Strona nowej karty</string>
<string name="showOnAppLaunchOptionSpecificPage">Określona strona</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Dziękujemy! Twoje zgłoszenie pomoże ulepszyć DuckDuckGo u wszystkich użytkowników!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,4 +785,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Nova página de separador</string>
<string name="showOnAppLaunchOptionSpecificPage">Página específica</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Obrigado! O teu relatório ajuda a melhorar o DuckDuckGo para todos!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-ro/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -787,4 +787,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Filă nouă</string>
<string name="showOnAppLaunchOptionSpecificPage">Pagină specifică</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Mulțumim! Sesizarea ta ajută la îmbunătățirea DuckDuckGo pentru toată lumea!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -789,4 +789,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Страница новой вкладки</string>
<string name="showOnAppLaunchOptionSpecificPage">Конкретная страница</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Спасибо! Ваш отчет поможет улучшить DuckDuckGo для всех.</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-sk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -789,4 +789,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Stránka na novej karte</string>
<string name="showOnAppLaunchOptionSpecificPage">Špecifická stránka</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Ďakujeme! Vaše hlásenie pomáha zlepšovať DuckDuckGo pre všetkých!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-sl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -789,4 +789,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Stran z novim zavihkom</string>
<string name="showOnAppLaunchOptionSpecificPage">Določena stran</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Hvala! Vaše poročilo pripomore k temu, da lahko DuckDuckGo postane boljši za vse!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-sv/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,4 +785,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Ny fliksida</string>
<string name="showOnAppLaunchOptionSpecificPage">Specifik sida</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Tack! Din rapport hjälper till att göra DuckDuckGo bättre för alla!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-tr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,4 +785,7 @@
<string name="showOnAppLaunchOptionNewTabPage">Yeni Sekme Sayfası</string>
<string name="showOnAppLaunchOptionSpecificPage">Belirli Bir Sayfa</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Teşekkür ederiz! Raporunuz DuckDuckGo\'yu herkes için daha iyi hale getirmeye yardımcı oluyor!</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -784,4 +784,7 @@
<string name="showOnAppLaunchOptionNewTabPage">New Tab Page</string>
<string name="showOnAppLaunchOptionSpecificPage">Specific Page</string>

<!-- Privacy Dashboard -->
<string name="brokenSiteSubmittedReportMessage">Thank you! Your report helps make DuckDuckGo better for everyone!</string>

</resources>
Loading

0 comments on commit df58f18

Please sign in to comment.