Skip to content

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

Merged
andybalaam merged 1 commit intodevelopfrom
andybalaam/reset-encryption-redesign2
Apr 30, 2025
Merged

Update identity reset UI (Make consistent with EX)#29701
andybalaam merged 1 commit intodevelopfrom
andybalaam/reset-encryption-redesign2

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
@uhoreg uhoreg requested a review from richvdh April 23, 2025 23:17
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.

Slightly struggling to understand the scope of the changes here.

Make identity reset consistent with EX

Before I try and page in the code changes again, could we rephrase this in a way that summarises what's actually changing in EW as part of this change? A few screenshots might not go amiss, either.

Fixes #29227

The linked issue isn't terribly helpful at getting an overview of what actually needs to change: it links to a load of designs but I'm unclear what is already done and what this PR is aiming to change. But in particular: #29227 talks about changing something in the OIDC flow, which doesn't seem to be done here? Is that because it's already done?

I recommend reviewing commit-by-commit.

I assume this is no longer the recommended approach?

@uhoreg uhoreg changed the title Make identity reset consistent with EX Update identity reset UI (Make consistent with EX) Apr 24, 2025
@uhoreg
Copy link
Member

uhoreg commented Apr 24, 2025

Slightly struggling to understand the scope of the changes here.

Make identity reset consistent with EX

Before I try and page in the code changes again, could we rephrase this in a way that summarises what's actually changing in EW as part of this change? A few screenshots might not go amiss, either.

Added a screenshot, and updated the title. It is "just" a UI update, with the annoying part being that in order to get the desired UI, I had to make it pop up a new modal, rather than to do it all in SetupEncryptionBody.

Fixes #29227

The linked issue isn't terribly helpful at getting an overview of what actually needs to change: it links to a load of designs but I'm unclear what is already done and what this PR is aiming to change. But in particular: #29227 talks about changing something in the OIDC flow, which doesn't seem to be done here? Is that because it's already done?

Looks like Andy and I both missed the OIDC part. But I've split it off into #29809 since it's a separate component and is non-trivial.

I recommend reviewing commit-by-commit.

I assume this is no longer the recommended approach?

Yes, by now it has accumulated enough commits that that approach may not be the best.

@uhoreg uhoreg requested a review from richvdh April 24, 2025 20:12
* Called when the identity is reset.
*/
onFinish: MouseEventHandler<HTMLButtonElement>;
onReset: MouseEventHandler<HTMLButtonElement>;
Copy link
Member

Choose a reason for hiding this comment

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

This could maybe do with being onResetCompleted or onIdentityReset or something, just to help highlight it's the completion of the identity reset process, rather than the component being reset or something.

Not a strong opinion though.

Copy link
Member

Choose a reason for hiding this comment

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

I know this has been discussed previously, but it does seem a bit weird for this to be a MouseEventHandler and at some point it would be nice to just make it a () => void like onCancelClick. But, it's not a new change in this PR and doesn't need to hold this PR up any more, so maybe another time.

Copy link
Member

Choose a reason for hiding this comment

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

I agree, but, Friday afternoon, before I'm off for two weeks, I'm making minimal changes. ;) (same goes for #29701 (comment))

@richvdh
Copy link
Member

richvdh commented Apr 25, 2025

In case it's not obvious, the main point in the above review is #29701 (comment) (basically: can we get rid of Phase.ConfirmReset altogether). The rest is mostly nit-picking.

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 😢

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

4 participants