-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
base: develop
Are you sure you want to change the base?
Conversation
5ca414f
to
fec5e88
Compare
0edccfe
to
dab78ad
Compare
dab78ad
to
8f0073e
Compare
8f0073e
to
f3035e1
Compare
f3035e1
to
94c7056
Compare
94c7056
to
4fdc53e
Compare
4fdc53e
to
fff5732
Compare
fff5732
to
eccb05c
Compare
/** | ||
* Called when the identity is reset (before onFinished is called). | ||
*/ | ||
onReset: MouseEventHandler<HTMLButtonElement>; |
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.
It seems a bit weird for 'onReset' to take a mouse event: it's hard to see how the original click would be relevant.
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.
It's just copied from the original settings panel (where I don't think the mouse event is used either). We can get rid of it here.
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've changed this to be a function with no arguments. Should I also change ResetIdentityBody
and ResetIdentityPanel
(since we already touch those lines in this PR)?
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.
Oh I see - thanks. Up to you whether you fancy changing it elsewhere.
}, | ||
onFinished: () => { | ||
// The user cancelled the reset dialog or click away - go back a step | ||
this.onResetBackClick(); |
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.
onFinished is called in either case isn't it? Is there a risk this will confuse things by clicking back after the dialog is done (also I don't love that we are calling click handlers for reasons other than when a click happened).
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've added an onCancelled
callback, and used that. I'm not sure if it's necessary, but it's clearer
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.
Also changed the code so that it doesn't call the click handlers.
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.
Thanks!
onReset: () => { | ||
// The user completed the reset process - close this dialog | ||
this.props.onFinished(); | ||
this.onDoneClick(); |
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.
As per below on calling click handlers rather than them just handling clicks.
// Wrappers for ResetIdentityBody's callbacks so that onFinish gets called | ||
// whenever the reset is done, whether by completing successfully, or by | ||
// being cancelled | ||
const onResetWrapper: MouseEventHandler<HTMLButtonElement> = (...args) => { | ||
onFinished(); | ||
onResetFinished(...args); | ||
}; | ||
const onCancelWrapper: () => void = () => { | ||
onFinished(); | ||
onCancelClick(); | ||
}; |
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.
General feedback: this seems to immediately change in the next commit, so reviewing it is trickier than it needs to be
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.
Struggling to follow this :/
* "forgot" is shown when the user has just forgotten their passphrase. | ||
* "forgot" is shown when the user chose 'Forgot recovery key?' during `SetupEncryptionToast`. | ||
* | ||
* "confirm" is shown when the user chose 'Reset all' during `SetupEncryptionBody`. |
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.
it would be good to detail how the behaviour is different, rather than when it is called.
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.
No behaviour change. It just changes the messages displayed. I've added a comment about that.
} else if (phase === Phase.ConfirmReset) { | ||
return ( | ||
<div> | ||
<p>{_t("encryption|verification|verify_reset_warning_1")}</p> | ||
<p>{_t("encryption|verification|verify_reset_warning_2")}</p> | ||
|
||
<div className="mx_CompleteSecurity_actionRow"> | ||
<AccessibleButton kind="danger_outline" onClick={this.onResetConfirmClick}> | ||
{_t("encryption|verification|reset_proceed_prompt")} | ||
</AccessibleButton> | ||
<AccessibleButton kind="primary" onClick={this.onResetBackClick}> | ||
{_t("action|go_back")} | ||
</AccessibleButton> | ||
</div> | ||
</div> | ||
); | ||
} else if (phase === Phase.Busy || phase === Phase.Loading) { | ||
} else if (phase === Phase.Busy || phase === Phase.Loading || phase == Phase.ConfirmReset) { |
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.
again, bit confused about why it is safe to get rid of the confirm step, and why we now show a spinner for "ConfirmReset".
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 dialog used to do confirm resetting the identity, but now it uses ResetIdentityDialog
to do so. So during the "ConfirmReset" stage, this dialog just shows a spinner, while ResetIdentityDialog
does the actual confirmation.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
c7b15fb
to
0935979
Compare
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.
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?
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
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.
Yes, by now it has accumulated enough commits that that approach may not be the best. |
Fixes #29227
This adds
IdentityResetDialog
, which wrapsIdentityResetBody
in a dialog, and launches it fromSetupEncryptionBody
, instead of doing the reset directly there.This is mostly work by @uhoreg , rebased and refactored a bit here.
I recommend reviewing commit-by-commit.