Skip to content

Launch what's new page at major version update #17593

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

Merged
merged 1 commit into from
Mar 16, 2023
Merged

Launch what's new page at major version update #17593

merged 1 commit into from
Mar 16, 2023

Conversation

simonhong
Copy link
Member

@simonhong simonhong commented Mar 14, 2023

fix brave/brave-browser#28947

If griffin's target version is same with browser's current version,
browser will load whats-new url in the first foreground tab once per major version up.

Griffin will provide target_major_version params - https://github.com/brave/brave-variations/pull/544/files#diff-7ac2945ede68c73330363911678f6c9a2a6290b70e2dd170868295f65da7e872R1842
When whats_new::ShouldShowBraveWhatsNewForState() returns true,
chrome://whats-new/ url is added to startup tabs list.
For that loading that url, browser runs whats_new::StartBraveWhatsNew()
instead of loading it directly. And whats_new::StartBraveWhatsNew() loads
https://www.brave.com/whats-new/ in foreground first tab.

Resolves

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run lint, npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

BraveWhatsNewTest.*
BraveWhatsNewBrowserTest.*

Manual test

  1. Set current version as target version in griffin (ex, 1.51).
  2. Install 1.50 or earlier and use it
  3. Update to 1.51 and check whats-new url is loaded in the first tab afater launching.
    Note: Maybe need some relaunching to 1.51 as it need to get trial data from griffin

Note: brave.whats_new.last_version key in brave://local-state/ includes lastly shown whats-new version.

@simonhong simonhong self-assigned this Mar 14, 2023
@github-actions github-actions bot added the potential-layer-violation-fixes This PR touches a BUILD.gn file with check_includes=false label Mar 14, 2023
@simonhong simonhong force-pushed the whats_new branch 2 times, most recently from 7aa2ced to 5d362b4 Compare March 15, 2023 05:50
@simonhong simonhong marked this pull request as ready for review March 15, 2023 09:37
@simonhong simonhong requested a review from a team as a code owner March 15, 2023 09:37
@simonhong simonhong requested a review from spylogsster March 15, 2023 09:37
Copy link
Collaborator

@mkarolin mkarolin 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 ++

void StartBraveWhatsNew(Browser* browser) {
constexpr char kBraveWhatsNewURL[] = "https://brave.com/whats-new/";
// Load whats-new url in the first foreground tab.
chrome::AddTabAt(browser, GURL(kBraveWhatsNewURL), 0, true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

why does open the url directly instead of fetching it like chromium?

}

void RegisterLocalStatePrefs(PrefRegistrySimple* registry) {
registry->RegisterDoublePref(prefs::kWhatsNewLastVersion, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

why are we creating our pref for this instead of using upstream kLastWhatsNewVersion?

}

// Returns 1.xx or 2.xx as double.
absl::optional<double> GetCurrentBrowserVersion() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need all of this when the chromium code already does this on major version updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential-layer-violation-fixes This PR touches a BUILD.gn file with check_includes=false
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show What's New page in foreground after major version updates
4 participants