-
Notifications
You must be signed in to change notification settings - Fork 3
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
FXVPN-10: onboarding flow #142
Conversation
src/shared/property.js
Outdated
* @param {(arg0: L, arg1: M, arg2: R)=>T} transform - Called with the Property Value, must return the transformed value | ||
* @returns {ReadOnlyProperty<T>} - | ||
*/ | ||
export const propertySumTrio = (left, middle, right, transform) => { |
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.
A: First of really appreciate that you looked into that system :D
However i dont think that scales.
Consider cherry picking #144 - i think we can just rewrite property sum to take N amount of properties :)
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! I knew it was only a quick band aid fix... Will cherry pick that improved one after it is merged in.
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.
Nitpick:
* ExtensionController manages extension state and
* provides a method to the popup for disabling and enabling
* the "Firefox VPN".
I don't think we should therfore have onboarding here.
All of the code here looks great, but i'd prefer it moved into onboarding.js
and we expose that in main.js
similar to the others :)
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.
Good call, done
finishOnboarding() { | ||
this.#mCurrentOnboardingPage.set(4); | ||
putIntoStorage( | ||
4, |
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.
Consider using constants to denote magic numbers Unless you have seen the figma it's not clear the max onboarding page is "4"
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.
Also what happens if we add a new onboarding page? Users would then be seeing that one no?
(Not sure if this is wanted or not)
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.
Will update away from magic numbers, thanks.
We do want users to have the possibility of later seeing new onboarding pages - Lesley mentioned this was desired (and sometimes difficult) w/ MAC.
src/ui/browserAction/popup.html
Outdated
@@ -34,7 +34,16 @@ | |||
<open-mozilla-vpn-message-screen | |||
slot="MessageOpenMozillaVPN" | |||
></open-mozilla-vpn-message-screen> | |||
<!-- TODO: Split Tunnel Message, Onboarding, Update Message --> | |||
<onboarding-screen-1 |
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.
With this approach i can see why the pagination would be hard to add (agreed)
WDYT:
one new Screen
Element -> "Onboarding" that is shown here if onboarding is not complete.
The Onboarding screen then would be something like
<main>
<conditional-view slotName=${this.onboardingCount} >
<slot=1 onboarding-screen-1>
<slot=2 onboarding-screen-2>
<slot=3 onboarding-screen-3>
<slot=4 onboarding-screen-4>
</conditional-view>
<pagination>
<button-next>
</main>
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 also a nonblocking suggestion, if we REALLY dont want the indicators let's not add this )
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.
I'm not fixated on the pagination either (MAC doesn't have them) but I do think they're a very nice touch, if not too painful.
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.
Pagination is now in here - will update the video once I add in the new fourth screen.
We got a new screen added into the mocs yesterday, so putting this on draft until I can update the PR. |
@mcleinman do you mean the update the settings panel? if not, mind shooting me a link to the new screen? thanks! |
const { mozillaVpnServers } = await storage.get(key); | ||
if (typeof mozillaVpnServers === "undefined") { | ||
const storageRetrieval = await storage.get(key); | ||
const returnValue = storageRetrieval[key]; |
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.
Will this throw an oogly error if storageRetrieval == undefined
?
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.
I added some more defensive code around here. Good call, thanks!
The settings panel also came with a new onboarding panel: https://www.figma.com/design/s13B7zs27cadZXUyvxobgW/Mozilla-VPN-Extension?node-id=1822-31036&node-type=section&t=zKYBItOJwJmrfOoF-0 |
I believe this is ready for review. The mocks got updated in the middle of this week with a new fourth onboarding screen. I'm inclined to add that after this is merged - I've started working on it, but there are open questions around copy and images, and I'm not sure this needs to be held up on it. Also open to putting this one back on draft if we think it's better to do it all together. |
src/background/onboarding.js
Outdated
const FIRST_UNUSED_PAGE = NUMBER_OF_ONBOARDING_PAGES + 1; | ||
|
||
// const log = Logger.logger("RequestHandler"); | ||
let self; |
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.
unused I think?
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.
Removed, whoops. Thanks.
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.
Removed, whoops. Thanks.
src/background/onboarding.js
Outdated
export const NUMBER_OF_ONBOARDING_PAGES = 3; | ||
const FIRST_UNUSED_PAGE = NUMBER_OF_ONBOARDING_PAGES + 1; | ||
|
||
// const log = Logger.logger("RequestHandler"); |
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.
Let's remove this or comment it in and use
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.
Removed, whoops. Thanks.
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.
r+wc, thank you !!
src/components/prefab-screens.js
Outdated
this.secondaryAction = secondarAction; | ||
this.onSecondaryAction = onSecondaryAction; | ||
this.secondaryAction = secondaryAction; | ||
if (closeOnClick) { |
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.
I would like to make this as stupid as it needs to be - WDYT:
Remove the logic for closeOnClick as it only applys for the actions - and use a decorator for the ones where we need that functionality.
const closeAfter (f) => {
if(f){
f();
}
window.close();
}
const defineMessageScreen = (
...
onSecondaryAction = () => closeAfter (()=>open(sumoLink)),
)
Imho that is nicer to read then, as we dont need to recall what that one bool is flagging
defineMessageScreen( ... false|true ... )
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.
I've updated this. Not my personal style, but feels more appropriate given this project's overall codebase.
- `computed` can be created without a type, so let's remove the class backing it. In #142 Matt hit a thing where a sum of more then 2 elements is required, let's refactor propertySum to work with N elements, and add tests for it :)
These should match onboarding mocks from figma.
Associated PR is up for the string: mozilla-l10n/mozilla-vpn-extension-l10n#3
Updated video: https://github.com/user-attachments/assets/317e48e7-9982-4489-ad19-8651dd5f21a6
The scroll bars in the video on page 2 are due to my browser settings, and won't be seen by most people.