Skip to content

Set report flow to form when launchiung hybrid site from the prompt#5324

Merged
CrisBarreiro merged 3 commits intodevelopfrom
fix/cris/broken-site/fix-report-flow
Nov 28, 2024
Merged

Set report flow to form when launchiung hybrid site from the prompt#5324
CrisBarreiro merged 3 commits intodevelopfrom
fix/cris/broken-site/fix-report-flow

Conversation

@CrisBarreiro
Copy link
Collaborator

@CrisBarreiro CrisBarreiro commented Nov 27, 2024

Task/Issue URL: https://app.asana.com/0/1163321984198618/1208852264436742/f

Description

Set report flow to form (not menu) when launching hybrid site from the prompt
Rename pixels according to spec

Steps to test this PR

Feature 1

  • Fresh install, complete onboarding
  • Load a site and refresh 3 times
  • Check on the button to report broken site
  • Submit a report
  • Check the reportFlow parameter on epbf pixel is prompt instead of menu

UI changes

Before After
!(Upload before screenshot) (Upload after screenshot)

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@CrisBarreiro CrisBarreiro force-pushed the fix/cris/broken-site/fix-report-flow branch from e95a1cd to d8bdb6c Compare November 27, 2024 13:52
Copy link
Contributor

@lmac012 lmac012 left a comment

Choose a reason for hiding this comment

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

Left a couple of comments, but those are small nits. Looks good overall and works as expected.

@@ -96,7 +96,13 @@ class PrivacyDashboardHybridActivity : DuckDuckGoActivity() {
onSubmitBrokenSiteReport = { payload ->
val reportFlow = when (params) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: you could assign params to local variable to avoid having to manually cast a few lines below

Suggested change
val reportFlow = when (params) {
val reportFlow = when (val params = params) {

Comment on lines +100 to +104
if ((params as BrokenSiteForm).reportFlow == BrokenSiteForm.BrokenSiteFormReportFlow.MENU) {
ReportFlow.MENU
} else {
ReportFlow.PROMPT
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: You could map both values here explicitly, so that when someone adds new value to BrokenSiteForm.BrokenSiteFormReportFlow enum, it won't get implicitly translated to ReportFlow.PROMPT

Suggested change
if ((params as BrokenSiteForm).reportFlow == BrokenSiteForm.BrokenSiteFormReportFlow.MENU) {
ReportFlow.MENU
} else {
ReportFlow.PROMPT
}
when (params.reportFlow) {
BrokenSiteForm.BrokenSiteFormReportFlow.MENU -> ReportFlow.MENU
BrokenSiteForm.BrokenSiteFormReportFlow.PROMPT -> ReportFlow.PROMPT
}

@CrisBarreiro CrisBarreiro force-pushed the fix/cris/broken-site/fix-report-flow branch from 46aa3e3 to 1c7dbfa Compare November 28, 2024 14:48
@CrisBarreiro CrisBarreiro force-pushed the fix/cris/broken-site/fix-report-flow branch from 1c7dbfa to 29e8164 Compare November 28, 2024 14:49
@CrisBarreiro CrisBarreiro enabled auto-merge (squash) November 28, 2024 14:50
@CrisBarreiro CrisBarreiro merged commit c9b3f86 into develop Nov 28, 2024
@CrisBarreiro CrisBarreiro deleted the fix/cris/broken-site/fix-report-flow branch November 28, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants