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

Leo AI becomes an installable PWA #27025

Merged
merged 3 commits into from
Dec 17, 2024
Merged

Leo AI becomes an installable PWA #27025

merged 3 commits into from
Dec 17, 2024

Conversation

petemill
Copy link
Member

@petemill petemill commented Dec 16, 2024

Issues:

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • 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 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:

@petemill petemill self-assigned this Dec 16, 2024
@petemill petemill requested review from a team as code owners December 16, 2024 06:35
@github-actions github-actions bot added the CI/storybook-url Deploy storybook and provide a unique URL for each build label Dec 16, 2024
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@@ -0,0 +1,42 @@
// Copyright (c) 2024 The Brave Authors. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

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

IMO, it would be better to have this browser test in our test target because we don't run upstream browser test on all platforms.

Copy link
Member Author

Choose a reason for hiding this comment

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

moved to brave/browser/banners/

Copy link
Member Author

Choose a reason for hiding this comment

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

oops, I forgot to actually delete this file

Comment on lines 15 to 16
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{}, GetDisabledFeatures());
Copy link
Member

Choose a reason for hiding this comment

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

nit: I think it's not necessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

pushed

Comment on lines 29 to 36
{
base::RunLoop run_loop;
manager->PrepareDone(run_loop.QuitClosure());

ASSERT_TRUE(ui_test_utils::NavigateToURL(
browser(), GURL(base::StrCat({"chrome://", kAIChatUIHost}))));
run_loop.Run();
}
Copy link
Member

Choose a reason for hiding this comment

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

I think this could be simplifed.

  ASSERT_TRUE(ui_test_utils::NavigateToURL(
      browser(), GURL(base::StrCat({"chrome://", kAIChatUIHost}))));
  manager->WaitForInstallableCheck();

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure why the chromium browser test to check the same thing for chrome://password-manager doesn't do that

Copy link
Member Author

Choose a reason for hiding this comment

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

But great spot - this works!

Copy link
Member Author

Choose a reason for hiding this comment

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

pushed

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

string reviewers ++

@petemill petemill requested a review from a team as a code owner December 17, 2024 00:29
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.

++

# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at https://mozilla.org/MPL/2.0/.

if (!is_android) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we don't need this check as this browser_tests target is already filtered in test/BUILD.gn ?

@petemill
Copy link
Member Author

Windows CI failed with unrelated flakey test:

AdblockCustomResourcesTest.AddEditRemoveScriptlet 

@petemill petemill enabled auto-merge December 17, 2024 06:49
Copy link
Member

@goodov goodov left a comment

Choose a reason for hiding this comment

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

lgtm with few things to improve

@@ -0,0 +1,3 @@
include_rules = [
"+brave/components/constants",
Copy link
Member

Choose a reason for hiding this comment

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

this dependency should also appear in components/webapps/browser/BUILD.gn

bool IsValidWebAppUrl(const GURL& app_url) {
return IsValidWebAppUrl_ChromiumImpl(app_url) ||
(app_url.SchemeIs(content::kChromeUIScheme) &&
base::Contains(kInstallablePWAWebUIHosts, app_url.host()));
Copy link
Member

Choose a reason for hiding this comment

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

host_piece()

// Add some extra items to WebUI hosts considered valid for PWAs
#define kChromeUIPasswordManagerHost \
kChromeUIPasswordManagerHost && \
!base::Contains(kInstallablePWAWebUIHosts, url.host())
Copy link
Member

Choose a reason for hiding this comment

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

host_piece()

@petemill petemill requested review from a team as code owners December 17, 2024 07:54
@petemill petemill merged commit 10f7318 into master Dec 17, 2024
18 checks passed
@petemill petemill deleted the leo-pwa-manifest branch December 17, 2024 09:23
@github-actions github-actions bot added this to the 1.75.x - Nightly milestone Dec 17, 2024
@brave-builds
Copy link
Collaborator

Released in v1.75.105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/storybook-url Deploy storybook and provide a unique URL for each build
Projects
None yet
5 participants