-
Notifications
You must be signed in to change notification settings - Fork 885
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
[ads] Add search result ad clicked InfoBar #25393
base: master
Are you sure you want to change the base?
Conversation
f681d88
to
8c14a7c
Compare
...r/brave_ads/creatives/search_result_ad/creative_search_result_ad_clicked_infobar_delegate.cc
Outdated
Show resolved
Hide resolved
...ts/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_handler.cc
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (see comments)
Apologies if I missed a request for review. I'd suggest we amend the notice slightly to read "Thank you for supporting Brave Search by clicking on a private ad! Unlike Big Tech, we measure ad performance anonymously and preserve your privacy. [Learn more / your opt-out choices] We needs to link to clear simple info/guidance including choices available and how a user can delete data stored on their device. I know @fmarier has been working on this inc liaising with Brendan |
@PrivacyMatters, suggested link page content is available in the spec. Would you able to check if it needs to be changed, please? |
The text is not finalized yet (I will mention here once ready), but the current version is:
This PR is also blocked on having a page to link to for the "Learn more" link above. It's coming soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chromium_src lgtm
ios/brave-ios/Sources/Brave/Frontend/Browser/SearchResultAdClickedInfoBar.swift
Outdated
Show resolved
Hide resolved
ios/brave-ios/Sources/Brave/Frontend/Browser/SearchResultAdClickedInfoBar.swift
Outdated
Show resolved
Hide resolved
ios/brave-ios/Sources/Brave/Frontend/Browser/SearchResultAdClickedInfoBar.swift
Outdated
Show resolved
Hide resolved
ios/brave-ios/Sources/Brave/Frontend/Browser/SearchResultAdClickedInfoBar.swift
Outdated
Show resolved
Hide resolved
ios/brave-ios/Sources/Brave/Frontend/Browser/SearchResultAdClickedInfoBar.swift
Outdated
Show resolved
Hide resolved
ios/brave-ios/Sources/Brave/Frontend/Browser/SearchResultAdClickedInfoBar.swift
Outdated
Show resolved
Hide resolved
ios/brave-ios/Sources/Brave/Frontend/Browser/SearchResultAdClickedInfoBar.swift
Outdated
Show resolved
Hide resolved
ios/brave-ios/Sources/Brave/Frontend/Browser/SearchResultAdClickedInfoBar.swift
Outdated
Show resolved
Hide resolved
ios/brave-ios/Sources/Brave/Frontend/Browser/SearchResultAdClickedInfoBar.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strings
++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposed text and user experience looks fine (modulo the linked help page actually working)
9c839b3
to
c3fdf69
Compare
@fmarier @ShivanKaul if a user deletes the data stored on their device in clicking an ad I assume the next time they click an ad they will see the notice |
c3fdf69
to
214ca81
Compare
That's correct. After Brave Ads data deletion, user will get the notice again when they click an ad |
addSubview(toastView) | ||
toastView.snp.makeConstraints { make in | ||
make.left.right.height.equalTo(self) | ||
self.animationConstraint = make.top.equalTo(self).offset(SimpleToastUX.toastHeight).constraint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SimpleToastUX.toastHeight
is used for an animation constraint, because it is suitable for what we have for dismiss animation in the parent class here: https://github.com/brave/brave-core/blob/master/ios/brave-ios/Sources/Brave/Frontend/Browser/Toast.swift#L84
UIView.animate(
withDuration: duration,
animations: {
self.animationConstraint?.update(offset: SimpleToastUX.toastHeight)
self.layoutIfNeeded()
},
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're going to have issues with this though since this copy is multiline and will get translated to likely be much taller whereas other toasts typically are capped at a certain height.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, this affects starting/ending Toast heights during animation.
I will try to find a way of animation basing on the actual Toast height, not the predefined constants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
The PR description is updated with screenshots with the new Infobar text. |
8eede73
to
b4fe7f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Icons stuff LGTM - sorry don't know anything about iOS so I can't provide a more helpful review!
The current PR is blocked by brave/brave-browser#40952: we need |
5869709
to
9a6c7c6
Compare
constexpr int kIconSize = 20; | ||
|
||
constexpr char kLearnMoreUrl[] = | ||
"https://support.brave.com/hc/en-us/articles/360026361072-Brave-Ads-FAQ"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to point to https://search.brave.com/help/conversion-reporting once it's live.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
static let toastCloseButtonWidth: CGFloat = 20.0 | ||
static let toastLabelFont = UIFont.preferredFont(forTextStyle: .subheadline) | ||
static let toastBackgroundColor = UIColor(braveSystemName: .schemesOnPrimaryFixed) | ||
static let learnMoreUrl = "https://support.brave.com/hc/en-us/articles/360026361072-Brave-Ads-FAQ" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one will also need to be https://search.brave.com/help/conversion-reporting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There is another aspect to add the to test plan here:
|
Added 👍 |
@@ -585,6 +585,7 @@ brave_chrome_browser_ui_allow_circular_includes_from += | |||
brave_chrome_browser_allow_circular_includes_from = [ | |||
"//brave/browser/ui", | |||
"//brave/browser/brave_ads:impl", | |||
"//brave/browser/brave_ads/creatives/search_result_ad", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allowed a circular dependency from search_result_ad
target.
cc @bridiver
CreateConfirmInfoBar(std::unique_ptr<ConfirmInfoBarDelegate>( | ||
new CreativeSearchResultAdClickedInfoBarDelegate()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this use std::make_unique
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
InfoBar on Desktop:
InfoBar on iOS:
InfoBar on Android:
Resolves brave/brave-browser#39625
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
The functionality should be tested for iOS, Android and Desktop
Test case 1
search.brave.software
in a new tabLearn more
search.brave.software
in a new tabTest case 2
search.brave.software
in a new tabsearch.brave.software
in a new tabTest case 3
search.brave.software
in a new tabsearch.brave.software
in a new tab