-
Notifications
You must be signed in to change notification settings - Fork 871
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
presenting the Oscar winning welcome page #894
Conversation
7629f9a
to
760703b
Compare
@cezaraugusto ping on this since this is 22 days old |
c0c68b5
to
25bfe83
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.
This is very cool!
Left some comments, mainly nits and some tiny cleanup.
One thing would be great to do is move the images from brave-core/components/img
to as local to where they are used as possible, continuing with out as much as possible self-containing component architecture. e.g. if the asset is imported in brave_welcome_ui/components/screens
, lets put the images there. If it's actually needed by a brave-ui
component and it never changes (e.g. <ShieldsImage />
), then we can leave the assets in brave-ui and we don't need the additional complication of passing the url down as a prop. The other thing is that we don't need to specify the generated image names and paths in c++ - webpack will put the files in the right place, and the build will pick them up and make sure they are served at runtime.
If you do change these, please use import myUrl from 'my.svg'
syntax instead of require
. It's good for us to consistently use es-module style instead of nodejs style for webpack which only supports tree shaking and code splitting using es module syntax.
If you don't, please at least remove the image definitions from the GRD and c++.
Have the SVG graphics been optimized with svgo(mg)? It's probably yes because these are complicated images so that may be why they are still big, so just checking... If not, please do.
Second, a UX point: when experiencing this page for the first time, I wonder if the transitions feel pretty slow. The brave logo hovering timing seems perfect. The initial fade-in seems maybe a little slow and the slide animation feels very slow. We've got the slide animation at around 2.5s. Various research I've read in the past suggests micro-transitions should be around 250ms or less and more general page transitions like this could be double that and at least < 1s. Should easing be ease-in-out
(or some variant) since content is both exiting and entering. I think we have that set to ease-out
.
If you and @rossmoody don't feel that this needs to be changed then ok. If you want to adjust this in brave-ui before pushing this PR, then go for it. If you want to do it later or want someone else to do it, then we can merge this as long as @rossmoody is happy with the timings as they are potentially going in to a Release.
{ "59ec9e5cdea1df1630f8c6e2b7a27ede.png", IDR_BRAVE_WELCOME_SLIDE_4_IMAGE }, | ||
{ "c2217e15737be3c82f5fef818d3fd26c.png", IDR_BRAVE_WELCOME_SLIDE_5_IMAGE }, | ||
{ "e9d936c617aad55fe1bc7a001f2defb4.svg", IDR_BRAVE_WELCOME_BACKGROUND_IMAGE } | ||
{ "9e31ed86a2f12b6d4a22041f62ed412e.svg", IDR_BRAVE_WELCOME_SLIDE_1_IMAGE }, |
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.
These images don't need to be specified here, they will be automatically included if generated via webpack build
get actions () { | ||
return this.props.actions | ||
get totalScreensSize () { | ||
return 6 |
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.
nit: this can be a const variable in the module, instead of a function, since it does not change
default: | ||
return <BraveScreen onGoToFirstSlide={this.onGoToFirstSlide} /> | ||
} | ||
get backgroundPosition () { |
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 does not seem to be called from anywhere - can be removed
|
||
// Utils | ||
import * as welcomeActions from '../actions/welcome_actions' | ||
|
||
// Assets | ||
const background = require('../../img/welcome/welcomebg.svg') | ||
const background = require('../../img/welcome/welcome_bg.svg') |
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.
nit: the webpack loaders will return a URL string for asset file imports, so a more readable name IMO would be backgroundUrl
in these cases
|
||
// Shared components | ||
import { ArrowRightIcon } from 'brave-ui/components/icons' | ||
import { Button } from 'brave-ui/components' |
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.
please use import { Button } from 'brave-ui'
for consistency in order to preserve tree shaking. At least the important thing is to be consistent within a brave-core webui, so if you want to leave it as this for all of them, then that should be technically ok.
import { Content, Title, ThemeImage, Paragraph } from 'brave-ui/features/welcome/' | ||
|
||
// Shared components | ||
import { Button } from 'brave-ui/components' |
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.
remove /components
to be consistent
@@ -0,0 +1,164 @@ | |||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 325 200"> |
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.
Has this been optimized with svgo(mg)? It's probably yes because these are complicated images so that may be why they are still big, so just checking...
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.
can speak to this one cause i did it. these were run through svgo but they are pretty serious svgs. quite a few elements with linear gradients in each.
<include name="IDR_BRAVE_WELCOME_SLIDE_4_IMAGE" file="../img/welcome/rewards.png" type="BINDATA" /> | ||
<include name="IDR_BRAVE_WELCOME_SLIDE_5_IMAGE" file="../img/welcome/shields.png" type="BINDATA" /> | ||
<include name="IDR_BRAVE_WELCOME_BACKGROUND_IMAGE" file="../img/welcome/welcomebg.svg" type="BINDATA" /> | ||
<include name="IDR_BRAVE_WELCOME_SLIDE_1_IMAGE" file="../img/welcome/lion_logo.svg" type="BINDATA" /> |
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.
These don't need to be specified if they are imported via webpack, and from what I can tell, they are.
<message name="IDS_BRAVE_WELCOME_PAGE_MAIN_BUTTON" desc="Button that moves to the next welcome screen">Let's go</message> | ||
<message name="IDS_BRAVE_WELCOME_PAGE_REWARDS_TITLE" desc="Welcome message title for Brave Rewards">Enable Brave Rewards</message> | ||
<message name="IDS_BRAVE_WELCOME_PAGE_REWARDS_DESC" desc="Explainer text about Brave Rewards">Brave Rewards is a new way of thinking about how the web works. Get rewarded for viewing privacy-respecting ads, and support your favorite content creators while you’re at it.</message> | ||
<message name="IDS_BRAVE_WELCOME_PAGE_REWARDS_DESC" desc="Explainer text about Brave Rewards">Your attention is valuable. Earn by viewing privacy-respecting ads while you browse, and pay it forward to support content creators you love.</message> |
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.
Thanks for putting in good desc
s 👍
@cezaraugusto Per animation notes: The initial hope was to give the user a few seconds to adjust (since technically this would be the first time opening Brave) and also the panels are pretty big but I think I'd prefer to be a little fast than a little slow and we can always fine tune after this. Could you adjust the transition timing for the panels and the initial reveal to 400ms? We can keep the ease designations the same. |
e8db428
to
136c226
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.
LGTM, thanks for making the changes 🎆
presenting the Oscar winning welcome page
0.60.x 4bf00c4 |
@petemill approved for 59 per https://bravesoftware.slack.com/archives/C7VLGSR55/p1544639764749500 |
@petemill uplift request to |
presenting the Oscar winning welcome page
0.59.x cb0fd9b |
closes brave/brave-browser#1847
npm run test-unit
should cover edge cases of welcome pagebrave://welcome
for manual testingall props to @rossmoody I just did the code