-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
"Verify this device" redesign #30596
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
65a2a47
to
758647f
Compare
color: $authpage-primary-color; | ||
background-color: $background; | ||
border-radius: 4px; | ||
padding: 20px; | ||
padding: 20px 20px 60px 20px; |
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.
For some reason that I haven't been able to figure out, it squishes the bottom of the dialog, so I had to add some extra padding here.
Related Documentation No published documentation to review for changes on this repository. |
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.
Looks sane otherwise
}); | ||
}; | ||
|
||
private onLogOutClick = (): void => { |
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.
for consistency, we seem to use logout
as per https://dictionary.cambridge.org/dictionary/english/logout rather than log out
so O should not be capitalised 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.
Not sure this is terribly important, but:
The handler should be named after the button that it handles. The button is labelled 'Sign out', so the handler should be onSignOutClick
.
("Log out" is a verb; "logout" is a noun (the act of logging out). They are not interchangeable.)
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 had considered calling it onSignOutClick
, but decided to use "log out" for consistency, since that term seemed to be used more in the code. But there are places in the code that use "sign out", so maybe I will change it. (Though I think that there is a case to be made about using the same terminology everywhere in the code for the same function, independent of what it says in the UI. For example, it makes it easier to find places that deal with logging out by grepping for a single string.)
If I do change the function to onSignOutClick
, should I also change the property name to allowSignOut
rather than allowLogout
?
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.
Looking at this again, I think all the onFooClick
methods (onUsePassphraseClick
, onVerifiyClick
, etc) should be renamed to match the name of the button that the user is actually clicking on, so yes it should be onSignOutClick
.
In an ideal world the properties would also reflect the actual behaviour of the component but in that case I don't think it's so important and I wouldn't bother. The prop does need documentation though.
(In the case of the prop, the lower-case o
in allowLogout
or allowSignout
rather than LogOut
is fine: it is about whether to allow a logout to happen.)
I started reviewing this but I'm finding it really hard to follow. It's definitely too big to review in one lump, but the commits don't seem to make much sense either. Could you try restructuring it, into smaller commits, with more explanation about what each commit is doing and why? |
@@ -124,5 +128,7 @@ function titleForVariant(variant: ResetIdentityBodyVariant): string { | |||
return _t("settings|encryption|advanced|breadcrumb_title_sync_failed"); | |||
case "forgot": | |||
return _t("settings|encryption|advanced|breadcrumb_title_forgot"); | |||
case "cant_confirm": | |||
return _t("settings|encryption|advanced|breadcrumb_tittle_cant_confirm"); |
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 appear to be referencing a string here that is not defined.
* "cant_confirm" is shown when the device is unverified and has no way of | ||
* obtaining the existing keys, and hence the identity needs to be reset to have | ||
* a cross-signed device. |
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 might be clearer if this was called "no_verification_method" or something, to distinguish from the case where the user clicks the "Can't confirm?" button in the "Confirm your identity" dialog.
}); | ||
}; | ||
|
||
private onLogOutClick = (): void => { |
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.
Looking at this again, I think all the onFooClick
methods (onUsePassphraseClick
, onVerifiyClick
, etc) should be renamed to match the name of the button that the user is actually clicking on, so yes it should be onSignOutClick
.
In an ideal world the properties would also reflect the actual behaviour of the component but in that case I don't think it's so important and I wouldn't bother. The prop does need documentation though.
(In the case of the prop, the lower-case o
in allowLogout
or allowSignout
rather than LogOut
is fine: it is about whether to allow a logout to happen.)
@@ -112,19 +116,23 @@ export default class SetupEncryptionBody extends React.Component<IProps, IState> | |||
store.returnAfterSkip(); | |||
}; | |||
|
|||
private onResetClick = (ev: ButtonEvent): void => { | |||
ev.preventDefault(); | |||
private onResetClick = (): void => { |
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.
definitely think this should be called "onCantConfirmClick"
.mx_EncryptionCard.mx_SetupEncryptionBody { | ||
width: 600px; | ||
} |
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.
why does this only apply when mx_SetupEncryptionBody
is inside an EncryptionCard
and not otherwise?
Also, can you help me understand why this is moving from mx_CompleteSecurityBody
to here? What is the relationship between mx_CompleteSecurityBody
and mx_EncryptionCard.mx_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.
Hmm. I'm not sure why I have the .mx_EncryptionCard
in there. It looks like it isn't needed -- mx_SetupEncryptionBody
isn't used anywhere else.
Also, can you help me understand why this is moving from
mx_CompleteSecurityBody
to here? What is the relationship betweenmx_CompleteSecurityBody
andmx_EncryptionCard.mx_SetupEncryptionBody
?
mx_CompleteSecurityBody
is only used when the user initially logs in. When SetupEncryptionBody
is used as a modal inside the app, it's just inside of an .mx_Dialog
(and associated things). So moving the style here means that it gets used both on initial login and within the app.
and update wording
4d6c595
to
c032ed2
Compare
I've reworked the commits, to break it up into smaller chunks, and addressed the comments. Some of the style changes are still grouped together, but hopefully it's more understandable now. |
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.
much easier to review now, thank you for rearranging it.
Generally lgtm, a few nits and questions
src/i18n/strings/en_EN.json
Outdated
@@ -1064,7 +1066,7 @@ | |||
"unverified_sessions_toast_description": "Review to ensure your account is safe", | |||
"unverified_sessions_toast_reject": "Later", | |||
"unverified_sessions_toast_title": "You have unverified sessions", | |||
"verification_description": "Verify your identity to access encrypted messages and prove your identity to others. If you also use a mobile device, please open the app there before you proceed.", | |||
"verification_description": "Verify this device to set up secure messaging", |
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.
Apparently we're not allowed to update existing strings outside of localazy (https://github.com/element-hq/element-web/blob/develop/docs/translating-dev.md#editing-existing-strings).
In order to keep the wording changes and the other design changes together, I suggest using a new translation key.
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 changed it to use new translation keys.
@@ -967,7 +967,6 @@ | |||
"title": "Recovery Method Removed", | |||
"warning": "If you didn't remove the recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings." | |||
}, | |||
"reset_all_button": "Forgotten or lost all recovery methods? <a>Reset all</a>", |
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.
Note to future archaeologists: the reference to this string was removed in an earlier commit 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.
Sorry, I tried to keep the string removals in the same commits as where the code stops using it, but I guess I missed this on.
src/i18n/strings/en_EN.json
Outdated
"verify_using_device": "Verify with another device", | ||
"verify_using_key": "Verify with Recovery Key", | ||
"verify_using_device": "Use another device", | ||
"verify_using_key": "Use recovery key", |
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.
these changes probably need to happen in localazy
|
||
export default class SetupEncryptionDialog extends React.Component<IProps> { |
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.
if you're basically rewriting a component, consider taking the opportunity to switch to the functional style. Not a blocker here though
@@ -29,4 +29,13 @@ Please see LICENSE files in the repository root for full details. | |||
@media only screen and (max-width: 480px) { | |||
margin-top: 0; | |||
} | |||
|
|||
/* Extra class to indicate that the component is providing its own blurring, | |||
* so we don't apply ours */ |
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.
... nor a box-shadow, apparently.
What exactly does "blurring" mean, in this context?
This whole mechanism of overriding some of the inline styles by addition of another class feels a bit opaque. (Blurry, if you will.) It feels like maybe we should instead have a class which enables the blurring, and which AuthPage
enables by default, but which you can disable via a boolean property on AuthPage
(instead of the modalClasses
prop). WDYT?
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 whole mechanism of overriding some of the inline styles by addition of another class feels a bit opaque. (Blurry, if you will.) It feels like maybe we should instead have a class which enables the blurring, and which
AuthPage
enables by default, but which you can disable via a boolean property onAuthPage
(instead of themodalClasses
prop). WDYT?
Done. I had originally used the class property to make it more flexible, but the boolean is clearer what the intent is.
await page.getByRole("button", { name: "Proceed with reset" }).click(); | ||
await page.getByRole("button", { name: "Can't confirm?" }).click(); |
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.
just for future reference: it's much nicer to review changes where the author has at least aimed for the tests to pass after each commit (so the tests and app are updated in sync)
Co-authored-by: Richard van der Hoff <[email protected]>
0f34b5b
to
8212149
Compare
Fixes #29258
Probably easiest to review commit-by-commit
Checklist
public
/exported
symbols have accurate TSDoc documentation.