Page MenuHomePhabricator

[native] Introduce a restore screen
ClosedPublic

Authored by tomek on Tue, Nov 12, 6:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 10, 11:45 AM
F3442117: almost-white-icon.png
Tue, Dec 10, 6:28 AM
F3442113: white-icon.png
Tue, Dec 10, 6:28 AM
F3437264: light-restore.png
Mon, Dec 9, 8:38 AM
F3437261: dark-restore.png
Mon, Dec 9, 8:38 AM
Unknown Object (File)
Thu, Dec 5, 4:03 AM
Unknown Object (File)
Wed, Dec 4, 11:07 AM
Unknown Object (File)
Wed, Dec 4, 10:59 AM
Subscribers

Details

Summary

Add a new screen where a user can restore the account using a password or SIWE.

https://linear.app/comm/issue/ENG-9679/create-a-screen-where-user-can-choose-between-usernamepassword-and

The restore screen

restore-screen-4.12.png (2×1 px, 181 KB)

The prompt screen after this diff - no changes

prompt-after-restore.png (2×1 px, 1 MB)

Depends on D14066

Test Plan

Checked that this screen looks correctly and clicking the actions navigates to appropriate screens.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested review of this revision.Tue, Nov 12, 7:07 AM
  1. I'm not sure the "OR" thing is necessary anymore now that we only have two buttons instead of three
  2. Can we replace "Sign in" with "Sign in with password"?

Update copy and remove "or" section

This revision is now accepted and ready to land.Tue, Nov 19, 1:33 AM
tomek retitled this revision from [lib] Introduce a restore screen to [native] Introduce a restore screen.
native/account/restore-prompt-screen.react.js
35 ↗(On Diff #46130)

This is a kind of a hack. We're using PromptButton here and on the logged-out modal. In the modal, we're displaying the buttons inside an absolutely-positioned container that contains more containers with flex-direction row. In order for the buttons to share the space evenly, we specify flex: 1 for them. This doesn't play well with the buttons here, which are displayed in a container that shrinks - the result is that the buttons collapse and take as little space as possible. There are a couple of possible solutions:

  1. Specifying flex-shrink: 0 for buttons - this breaks the logged out modal (a row with two sign-in buttons)
  2. Avoid specifying flex: 1 for buttons - also breaks the modal
  3. Specifying flex: 1 conditional for the buttons - this works, but the fact that we would need to specify a flag which determines whether we should add flex: 1 doesn't sound great
  4. The solution from this diff, where we artificially introduce a row container for each button

I'm not sure whether the solution from this diff is the best. Maybe there are some better alternatives.

tomek requested review of this revision.Fri, Nov 29, 4:14 AM
native/account/restore-prompt-screen.react.js
55–58 ↗(On Diff #46130)

This isn't used

kamil added a reviewer: ashoat.

I think @ashoat should review this to see the user-facing copy

ashoat requested changes to this revision.Mon, Dec 2, 10:00 AM

Some quick UI requests:

  1. Would it be possible to have a graphic on this screen? I like this free SVG, but we could also pick something from @expo/vector-icons:
    Screenshot 2024-12-02 at 9.48.03 AM.png (264×594 px, 30 KB)
  2. As compared with similar registration screens, the screenshot here seems to have a lot more margin between the bottom button and the home pill. Can you try to make it look more like the screens in RegistrationNavigator?
  3. Regarding the copy, I'd like to make some updates. In the screenshot it feels like a lot of text bunched together, so I tried to split it up into multiple paragraphs. Would be curious to see if this looks good in an updated screenshot:

If you've lost access to your primary device, you can try recovering your Comm account.

To proceed, select the same login method that you used during registration.

Note that after completing the recovery flow, you will logged out of all of your other devices.

native/account/restore-prompt-screen.react.js
35 ↗(On Diff #46130)

I wonder if it would be better to implement a separate set of buttons based on PrimaryButton for this flow (that's what the RegistrationNavigator screens usually use)

Potentially we could have some shared inner component that is used by both the LoggedOutModal buttons and these buttons, but they would be wrapped in slightly different ways that work in each use case

This revision now requires changes to proceed.Mon, Dec 2, 10:00 AM
  1. Would it be possible to have a graphic on this screen? I like this free SVG, but we could also pick something from @expo/vector-icons:
    Screenshot 2024-12-02 at 9.48.03 AM.png (264×594 px, 30 KB)

I spoke to Rahul on our team, and he's interested in helping here a bit. He's going to see if he can find or design a better graphic than the ones that I found.

EDIT: tracked here

A new revision with a couple of changes:

  1. Added a placeholder icon. Will update the diff after https://linear.app/comm/issue/OPS-305/mockup-icon-for-restore-account-screen finalizes the design.
  2. Made sure the margin isn't that big. This issue was caused by the SafeAreaView being rendered twice.
  3. Updated the copy with the text proposed by @ashoat . The first two paragraphs are almost exactly the same - the only difference is the usage of sign. The third paragraph is a little different - I'm not sure but I think that Note that after completing the recovery flow, you will logged out of all of your other devices. was a bit incorrect.
  4. Used the updated PromptButton that follows a design from the registration screen, e.g. in terms of the font.
This revision is now accepted and ready to land.Thu, Dec 5, 10:07 PM

Added a placeholder icon. Will update the diff after https://linear.app/comm/issue/OPS-305/mockup-icon-for-restore-account-screen finalizes the design.

I think we have something finalized! But it's worth testing it on light / dark mode to make sure it looks good (assuming we need to support both light and dark mode here... not sure if that's true)

The dark mode

dark-restore.png (2×1 px, 192 KB)

I also tested it in the light mode

light-restore.png (2×1 px, 200 KB)

But I don't know how to display this flow in this mode. I modified the colorsSelector so that I can see how it looks like.

native/vectors/restore-icon.react.js
10 ↗(On Diff #46261)

Not sure if it makes sense to keep these lines 80 chars long. We don't do that for other SVGs.

But I don't know how to display this flow in this mode. I modified the colorsSelector so that I can see how it looks like.

Looks like we force dark mode for the registration screen, which means we don't have to worry about it here :)

The dark mode

dark-restore.png (2×1 px, 192 KB)

Can we make the graphic appear with a bit more contrast (more white)?

native/vectors/restore-icon.react.js
10 ↗(On Diff #46261)

Yeah, I think it's okay to have these long lines for SVGs

Updated the color to match the registration flow

white-icon.png (2×1 px, 203 KB)

We can also consider making it a little less white
almost-white-icon.png (2×1 px, 202 KB)

This revision was automatically updated to reflect the committed changes.