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

FXVPN-10: onboarding flow #142

Merged
merged 10 commits into from
Dec 16, 2024
Merged

Conversation

mcleinman
Copy link
Collaborator

@mcleinman mcleinman commented Dec 10, 2024

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.

* @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) => {
Copy link
Collaborator

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 :)

Copy link
Collaborator Author

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.

Copy link
Collaborator

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 :)

Copy link
Collaborator Author

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,
Copy link
Collaborator

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"

Copy link
Collaborator

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)

Copy link
Collaborator Author

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.

@@ -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
Copy link
Collaborator

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>

Copy link
Collaborator

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 )

Copy link
Member

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.

Copy link
Collaborator Author

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.

@mcleinman
Copy link
Collaborator Author

We got a new screen added into the mocs yesterday, so putting this on draft until I can update the PR.

@lesleyjanenorton
Copy link
Member

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];
Copy link
Member

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?

Copy link
Collaborator Author

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!

@mcleinman mcleinman marked this pull request as draft December 12, 2024 23:35
@mcleinman
Copy link
Collaborator Author

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!

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

@mcleinman
Copy link
Collaborator Author

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.

const FIRST_UNUSED_PAGE = NUMBER_OF_ONBOARDING_PAGES + 1;

// const log = Logger.logger("RequestHandler");
let self;
Copy link
Member

Choose a reason for hiding this comment

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

unused I think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed, whoops. Thanks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed, whoops. Thanks.

export const NUMBER_OF_ONBOARDING_PAGES = 3;
const FIRST_UNUSED_PAGE = NUMBER_OF_ONBOARDING_PAGES + 1;

// const log = Logger.logger("RequestHandler");
Copy link
Member

@lesleyjanenorton lesleyjanenorton Dec 13, 2024

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed, whoops. Thanks.

Copy link
Collaborator

@strseb strseb left a 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 !!

this.secondaryAction = secondarAction;
this.onSecondaryAction = onSecondaryAction;
this.secondaryAction = secondaryAction;
if (closeOnClick) {
Copy link
Collaborator

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 ... ) 


Copy link
Collaborator Author

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.

strseb added a commit that referenced this pull request Dec 16, 2024
- `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 :)
@mcleinman mcleinman merged commit 1ffa427 into main Dec 16, 2024
4 of 5 checks passed
@mcleinman mcleinman deleted the fxvpn-10-implement-onboarding-flow branch December 16, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants