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

New Onboarding WebUI #15637

Merged
merged 6 commits into from
Nov 22, 2022
Merged

New Onboarding WebUI #15637

merged 6 commits into from
Nov 22, 2022

Conversation

nullhook
Copy link
Contributor

@nullhook nullhook commented Oct 24, 2022

Resolves brave/brave-browser#26378

DO NOT MERGE BEFORE: #15674

The PR adds the new onboarding UI. It replaces the previous brave://welcome UI.

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, npm run lint, 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:

Visit brave://welcome and go through the steps to ensure all functionality is working

  1. Ensure single import is working
  2. Ensure bulk import (multiple profiles) is working
  3. Ensure importing from Safari is working

Background animations only work if hardware acceleration is enabled and "Reduce motion" flag disabled. The is to avoid animating on the CPU and respect accessibility. We need to ensure animations are not playing in the following scenarios:

  1. Disable HW accel --disable-gpu
  2. Enable HW accel and Reduced motion should be checked

@github-actions github-actions bot added the CI/storybook-url Deploy storybook and provide a unique URL for each build label Oct 24, 2022
@nullhook nullhook changed the title Onboarding/webui New Onboarding WebUI Oct 24, 2022
@nullhook nullhook force-pushed the onboarding/webui branch 3 times, most recently from 472e696 to 583c8b7 Compare October 25, 2022 20:34
@nullhook nullhook force-pushed the onboarding/webui branch 7 times, most recently from abef180 to 70da9fe Compare October 28, 2022 23:40
@nullhook nullhook requested a review from petemill October 29, 2022 00:25
@nullhook nullhook force-pushed the onboarding/webui branch 2 times, most recently from aec2dd9 to a5a8f75 Compare November 5, 2022 18:58
@nullhook nullhook requested a review from bsclifton November 8, 2022 01:43
@nullhook nullhook marked this pull request as ready for review November 8, 2022 01:43
@nullhook nullhook requested a review from a team as a code owner November 8, 2022 01:43
@Sam-Sibley
Copy link

@nullhook Here are the assets, if theyre not as you need them, lets discuss.

For the Browser icons, i can set up them all up and export them, but we will need a list of browsers we support. Or we can see if there is a someway we can get them online so we don't have to update them.
Assets.zip

@nullhook nullhook force-pushed the onboarding/webui branch 3 times, most recently from 8bea808 to 8b1b778 Compare November 10, 2022 18:57
@brave-builds
Copy link
Collaborator

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

}
});

+ currentAnimation.addEventListener("complete", setCompleteEvent);
Copy link
Member

Choose a reason for hiding this comment

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

If you want to change this whole patch to a 1-liner then perhaps you can try:

currentAnimation.addEventListener("complete", () => postMessage({ name: 'COMPLETE' });

Copy link
Contributor Author

Choose a reason for hiding this comment

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

patch updated

@nullhook nullhook force-pushed the onboarding/webui branch 3 times, most recently from 36d7308 to 0ef9fcb Compare November 12, 2022 23:23
@nullhook nullhook requested a review from petemill November 21, 2022 17:21
@brave-builds
Copy link
Collaborator

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

@brave-builds
Copy link
Collaborator

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

@brave-builds
Copy link
Collaborator

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

@nullhook nullhook force-pushed the onboarding/webui branch 2 times, most recently from 61b9e35 to a73bbdd Compare November 22, 2022 01:41
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 ++ (see a couple other comments).

@github-actions
Copy link
Contributor

⚠️ PR head is an unsigned commit
commit: a73bbdd9ead0fa67594999fc13b0e77ee1e93382
reason: unsigned
Please follow the handbook to configure commit signing
cc: @nullhook

@brave-builds
Copy link
Collaborator

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

@brave-builds
Copy link
Collaborator

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

@petemill
Copy link
Member

petemill commented Nov 22, 2022

Fixed the SonarCloud error. It was complaining about Math.random, which is used in a safe context here. Asked linux to re-run as it's the only remaining fail.

Copy link
Member

@petemill petemill left a comment

Choose a reason for hiding this comment

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

Looks good to go for me once this minor feedback is resolved, @mkarolin 's too. I'm approving since I'm on PTO and not as accessible, but please address non-nit feedback.

RecordP3AHistogram(screen_number_, finished_);
}

void WelcomeDOMHandler::HandleOpenSettingsPage(const base::Value::List& args) {
Copy link
Member

@petemill petemill Nov 22, 2022

Choose a reason for hiding this comment

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

nit: I don't think you need to do this - can just have <a href="chrome://settings/privacy" target="_blank">

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have tried adding an anchor and it doesn't seem to allow internal links to open. I believe there's an allow list somewhere?

Comment on lines +19 to +25
let results = profiles
.filter((profile) => profile.name !== 'Bookmarks HTML File')
.map((profile) => {
const browserType = getBrowserName(profile.name)
// Introducing a new property here
return { ...profile, browserType }
})
Copy link
Member

Choose a reason for hiding this comment

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

React.useMemo this calculation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why memoize it? It just get called once, on mount.

Comment on lines +72 to +70
const [shouldPlayAnimations] = React.useState(
loadTimeData.getBoolean('hardwareAccelerationEnabledAtStartup') &&
!window.matchMedia('(prefers-reduced-motion: reduce)').matches
)
Copy link
Member

Choose a reason for hiding this comment

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

Since this doesn't change, seems like this doesn't need to be state, but could use memo

const shouldPlayAnimations = React.useMemo(() =>
    loadTimeData.getBoolean('hardwareAccelerationEnabledAtStartup') &&
    !window.matchMedia('(prefers-reduced-motion: reduce)').matches
  , [])

At least saves calling matchMedia on every render.

@brave-builds
Copy link
Collaborator

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

@nullhook nullhook merged commit 459f8ff into master Nov 22, 2022
@nullhook nullhook deleted the onboarding/webui branch November 22, 2022 18:21
@github-actions github-actions bot added this to the 1.47.x - Nightly milestone Nov 22, 2022
goodov added a commit that referenced this pull request Jul 17, 2023
Allow WebSerial API to be enabled via brave://flags.
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
Development

Successfully merging this pull request may close these issues.

Update onboarding to new design and flow
5 participants