Skip to content

Update identity reset UI (Make consistent with EX) #29701

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

Merged
merged 1 commit into from
Apr 30, 2025

Conversation

andybalaam
Copy link
Member

@andybalaam andybalaam commented Apr 9, 2025

Fixes #29227

This adds IdentityResetDialog, which wraps IdentityResetBody in a dialog, and launches it from SetupEncryptionBody, instead of doing the reset directly there. In the new flow, only the user's cryptographic identity is reset -- recovery is no longer set up at the same time.

image

This is mostly work by @uhoreg , rebased and refactored a bit here.

I recommend reviewing commit-by-commit.

@andybalaam andybalaam added T-Defect T-Feature Request to add a new feature which does not exist right now and removed T-Defect labels Apr 9, 2025
@andybalaam andybalaam added T-Enhancement and removed T-Feature Request to add a new feature which does not exist right now labels Apr 9, 2025
@andybalaam andybalaam force-pushed the andybalaam/reset-encryption-redesign2 branch from 5ca414f to fec5e88 Compare April 11, 2025 10:56
@andybalaam andybalaam force-pushed the andybalaam/reset-encryption-redesign2 branch 2 times, most recently from 0edccfe to dab78ad Compare April 11, 2025 15:02
@andybalaam andybalaam force-pushed the andybalaam/reset-encryption-redesign2 branch from dab78ad to 8f0073e Compare April 11, 2025 15:12
@andybalaam andybalaam force-pushed the andybalaam/reset-encryption-redesign2 branch from 8f0073e to f3035e1 Compare April 14, 2025 09:28
@andybalaam andybalaam force-pushed the andybalaam/reset-encryption-redesign2 branch from f3035e1 to 94c7056 Compare April 14, 2025 14:16
@andybalaam andybalaam force-pushed the andybalaam/reset-encryption-redesign2 branch from 94c7056 to 4fdc53e Compare April 14, 2025 14:21
@andybalaam andybalaam force-pushed the andybalaam/reset-encryption-redesign2 branch from 4fdc53e to fff5732 Compare April 14, 2025 16:02
@andybalaam andybalaam force-pushed the andybalaam/reset-encryption-redesign2 branch from fff5732 to eccb05c Compare April 15, 2025 07:31
Comment on lines 136 to 122
onBeforeClose: async (reason): Promise<boolean> => {
// This is the only time that we can detect that the dialog
// is being closed due to the user clicking on the
// background.
if (reason === "backgroundClick") {
// The user clicked away - go back a step
store.returnAfterReset();
}
return true;
},
},
Copy link
Member

Choose a reason for hiding this comment

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

notwithstanding my comments about getting rid of returnAfterReset, there is an easier way to do this.

  1. Have ResetIdentityDialog's onFinished prop take an optional boolean success argument. Where we run that callback from onResetWrapper, set the argument to true.
  2. Use the finished promise returned by createDialog to figure out if we successfully did the reset:
       const handle = Modal.createDialog(
           ResetIdentityDialog,
           /* props= */ {
               variant: "confirm",
           },
       );
       handle.finished.then(([success]) => {
           if (success) {
               // The user completed the reset process - close this dialog
               this.props.onFinished();
               store.done();
           } else {
               // The user clicked away - go back a step
               store.returnAfterReset();
           }
       }); 

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

This looks basically fine now but I think there's a bit of cruft left that we can clean up.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

A few more suggestions which might help make this clearer. The Modal API is unintuitive and very poorly documented 😢

@andybalaam andybalaam force-pushed the andybalaam/reset-encryption-redesign2 branch from 81b0ba4 to 0041bbf Compare April 30, 2025 09:57
@andybalaam andybalaam enabled auto-merge April 30, 2025 09:57
@andybalaam andybalaam added this pull request to the merge queue Apr 30, 2025
Merged via the queue into develop with commit 23597e9 Apr 30, 2025
33 checks passed
@andybalaam andybalaam deleted the andybalaam/reset-encryption-redesign2 branch April 30, 2025 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EW: Make identity reset consistent with EX
5 participants