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

NTP: Add settings section for Dashboard options #5151

Merged
merged 4 commits into from
Apr 13, 2020
Merged

Conversation

cezaraugusto
Copy link
Contributor

@cezaraugusto cezaraugusto commented Apr 3, 2020

Close brave/brave-browser#8760

Submitter Checklist:

Test Plan:

  1. Toggling an option in New Tab Settings should reflect on the settings dashboard on New Tab itself. And vice-versa.
  2. If Background images toggle is OFF, Sponsored images should be disabled.

Screen Shot 2020-04-03 at 13 46 23

  1. New settings section should reflect order specified in Ability to modify New Tab Page Sponsored Images from Settings brave-browser#8760 (comment).

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@cezaraugusto cezaraugusto force-pushed the ca-8769 branch 2 times, most recently from 8da4192 to 08eb7d9 Compare April 3, 2020 18:11
@cezaraugusto cezaraugusto changed the title NTP: Add settings section for Dashboard options [WIP] NTP: Add settings section for Dashboard options Apr 3, 2020
@cezaraugusto cezaraugusto changed the title [WIP] NTP: Add settings section for Dashboard options NTP: Add settings section for Dashboard options Apr 3, 2020
checked={brandedWallpaperOptIn}
// This option can only be enabled if
// users opt in for background images
checked={showBackgroundImage && brandedWallpaperOptIn}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See https://bravesoftware.slack.com/archives/CQGTGBNH1/p1585937176040100 per @karenkliu comment users can't see branded images if background images are turned off so here I'm deliberately turning branded wallpapers off when a user opt-out form default background images. If they regret, it falls back to the branded wallpaper setting.

Copy link
Member

@simonhong simonhong Apr 4, 2020

Choose a reason for hiding this comment

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

@karenkliu , I'm curious if user turns off the bg option, sponsored images option should have same option value.
IMO, just disabling it seems fine because its value is not changed by turning bg option off. WDYT?
If you think this is fine from UX point of view, I'm also fine with this PR's change.

Choose a reason for hiding this comment

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

@simonhong The way we have it set up right now, turning off the Background Images toggle also turns off Sponsored Images and makes the toggle disabled until Background Images is turned back on. Settings should match that behavior.

In the future, we would like to give users more background options, so the Background Images toggle could have more sub-toggles that are independent of each other like this:

Background Images on/off
- Brave default images on/off
- Sponsored images on/off
- Set your own custom images on/off
Turning off background images would turn off all the sub-toggles, but turning off Brave default images could be independent of sponsored images and not affect that toggle.

Copy link
Member

Choose a reason for hiding this comment

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

Turning off background images would turn off all the sub-toggles, but turning off Brave default images could be independent of sponsored images and not affect that toggle

Ok - this PR meets above requirements. Thanks for explanation!

// If background image setting is not turned ON,
// inform the back-end to also disable the branded wallpaper setting.
// We will later disable interacting with the button as well.
if (isBackgroundEnabled === false) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See comment in https://github.com/brave/brave-core/pull/5151/files#r403256591. Branded wallpapers are visually disabled and with this change also turned off deliberately if default background wallpapers are turned off.

Copy link
Member

@simonhong simonhong left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@cezaraugusto cezaraugusto added this to the 1.9.x - Nightly milestone Apr 7, 2020
@cezaraugusto
Copy link
Contributor Author

@bridiver could you take a look? Merging is blocked on you as a code owner.

Copy link
Collaborator

@bridiver bridiver left a comment

Choose a reason for hiding this comment

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

chromium_src looks good

@bsclifton
Copy link
Member

deleted brave-browser branch and pushed a rebase - CI running now 😄

@simonhong
Copy link
Member

Rebased on latest master with lint error fix.

@cezaraugusto
Copy link
Contributor Author

All green, merging. Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to modify New Tab Page Sponsored Images from Settings
5 participants