-
Notifications
You must be signed in to change notification settings - Fork 16
Implements new onboarding UI/UX #1464
Implements new onboarding UI/UX #1464
Conversation
…/netp-new-onboarding
| <menuItem title="Print onboarding status to console" id="abt-dL-pSE"> | ||
| <modifierMask key="keyEquivalentModifierMask"/> | ||
| <connections> | ||
| <action selector="printOnboardingStatusToConsoleWithSender:" target="L82-We-Wwv" id="k2z-AC-UBV"/> | ||
| </connections> | ||
| </menuItem> |
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 was added in the previous PR in the stack for testing purposes.
| @IBAction | ||
| func printOnboardingStatusToConsole(sender: NSMenuItem) { | ||
| print("Onboarding status is: \(String(describing: OnboardingStatus(rawValue: onboardingStatus)))") | ||
| } |
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 matches the removal of the debug menu item I added in my last PR. It's no longer needed.
| if let healthWarning = model.issueDescription { | ||
| connectionHealthWarningView(message: healthWarning) | ||
| } |
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.
We now only show these warnings if the onboarding is completed.
| if !viewDisabled { | ||
| toggleTransition = .switchingOn(locallyInitiated: 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.
The toggle won't move when onboarding is shown, as the tunnel controller view will be disabled.
We'll still start NetP though.
|
|
||
| /// Model for AllowSystemExtensionView | ||
| /// | ||
| final class Model: ObservableObject { |
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.
Model for the onboarding step view.
|
I'm going to be merging the parent PR in the stack soon, so there'll be some merging back and forth. That said there will be no changes to the code in this PR, just activity noise. :) |
Task/Issue URL: https://app.asana.com/0/0/1205257341292466/f Tech Design URL: CC: ## Stack: - Feature branch: `diego/feature-network-protection-onboarding` - #1474 (this PR) - #1464 ## Description: Implements the shared `UserDefaults` that will store the onboarding status, and the debug menu options to test it.
graeme
left a comment
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.
Only blocker is the enum as we discussed.
| case alertBubbleBackground = "AlertBubbleBackground" | ||
| case defaultText = "TextColor" | ||
| case linkColor = "LinkBlueColor" | ||
| case onboardingButtonBackgroundColor = "OnboardingButtonBackgroundColor" |
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 wonder if any of these colours could be found in DesignResourcesKit. If we decide to change the app styling globally this could trip us up later. Not a blocker, just potentially a thought for later.
| /// Disables a view giving it opacity and making it impossible to interact with. Most useful on composite views. | ||
| /// | ||
| @ViewBuilder | ||
| func disabled(on condition: Bool) -> some View { |
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.
Doesn’t this clash with the default disabled view modifier? I wonder if this should be named differently. Not a blocker though if you’ve already considered this and it’s okay.
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.
Well I've pondered on this thought but honestly I couldn't find anything better, and unless there's an option to make this better I'd just keep this to be honest.
This does in fact disable the view, and the on: parameter ensures it's clear which one is picked against the regular disabled.
| @objc | ||
| dynamic var networkProtectionOnboardingStatusRawValue: Int { | ||
| get { | ||
| value(forKey: networkProtectionOnboardingStatusRawValueKey) as? Int ?? OnboardingStatus.default.rawValue |
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.
Persisting enums as Ints is a bit risky in case someone inadvertently adds a case. Particularly given this one is performing a calculation for the parameter which simply adds 1 to change values. If someone added a case before or after, it will change the meaning of this. I’d recommend using strings for this case.
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 changed as per our private chat.
|
|
||
| onboardingStatusPublisher | ||
| .receive(on: DispatchQueue.main) | ||
| .sink { [weak self] status 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.
You can simplify this by using the .assign(to:onWeaklyHeld:) instead of .sink (not a blocker, just a tip)
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.
Nice call, makes it tidier. Changed.
…ak if there are changes
|
Feedback addressed. It seems there's a flaky test which I'll address before merging, but I'd suggest we separate the review approval from CI since I won't merge until the CI is green anyways. |
graeme
left a comment
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.
Tested and works nicely. Thanks for addressing my comments too. Approved! 👍
…/netp-new-onboarding
Task/Issue URL: https://app.asana.com/0/0/1205257644127197/f
Stack
diego/feature-network-protection-onboardingDescription
Implements the new onboarding UI/UX.
Scope
The UI is designed here: https://www.figma.com/file/nscneJs8hvI6j2m24AFTsD/Setup-steps-macOS-Network-Protection?type=design&node-id=132%3A9918&mode=design&t=qrWZTHgdsccYM1IZ-1
My suggestion though would be not to focus on the UI too strongly unless you see a big issue, as this will be run through a design review anyway.
In Scope:
Out of Scope:
Steps to test this PR:
Internal references:
Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation