Tweak cross-signing copy

This makes some Design-approved copy tweaks to the recent cross-signing flow
changes.
This commit is contained in:
J. Ryan Stinnett 2021-03-26 11:13:39 +00:00
parent 356e4bc6fc
commit fd59a66523
10 changed files with 44 additions and 36 deletions

View file

@ -1,5 +1,5 @@
/* /*
Copyright 2019 The Matrix.org Foundation C.I.C. Copyright 2019-2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -158,6 +158,10 @@ limitations under the License.
} }
} }
.mx_Toast_detail {
color: $secondary-fg-color;
}
.mx_Toast_deviceID { .mx_Toast_deviceID {
font-size: $font-10px; font-size: $font-10px;
} }

View file

@ -1554,7 +1554,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
} else if (request.pending) { } else if (request.pending) {
ToastStore.sharedInstance().addOrReplaceToast({ ToastStore.sharedInstance().addOrReplaceToast({
key: 'verifreq_' + request.channel.transactionId, key: 'verifreq_' + request.channel.transactionId,
title: request.isSelfVerification ? _t("Self-verification request") : _t("Verification Request"), title: _t("Verification requested"),
icon: "verification", icon: "verification",
props: {request}, props: {request},
component: sdk.getComponent("toasts.VerificationRequestToast"), component: sdk.getComponent("toasts.VerificationRequestToast"),

View file

@ -155,15 +155,14 @@ export default class SetupEncryptionBody extends React.Component {
let verifyButton; let verifyButton;
if (store.hasDevicesToVerifyAgainst) { if (store.hasDevicesToVerifyAgainst) {
verifyButton = <AccessibleButton kind="primary" onClick={this._onVerifyClick}> verifyButton = <AccessibleButton kind="primary" onClick={this._onVerifyClick}>
{ _t("Verify with another session") } { _t("Use another login") }
</AccessibleButton>; </AccessibleButton>;
} }
return ( return (
<div> <div>
<p>{_t( <p>{_t(
"Verify this login to access your encrypted messages and " + "Verify your identity to access encrypted messages and prove your identity to others.",
"prove to others that this login is really you.",
)}</p> )}</p>
<div className="mx_CompleteSecurity_actionRow"> <div className="mx_CompleteSecurity_actionRow">
@ -205,8 +204,8 @@ export default class SetupEncryptionBody extends React.Component {
return ( return (
<div> <div>
<p>{_t( <p>{_t(
"Without completing security on this session, it wont have " + "Without verifying, you wont have access to all your messages " +
"access to encrypted messages.", "and may appear as untrusted to others.",
)}</p> )}</p>
<div className="mx_CompleteSecurity_actionRow"> <div className="mx_CompleteSecurity_actionRow">
<AccessibleButton <AccessibleButton

View file

@ -50,7 +50,7 @@ export default class VerificationRequestDialog extends React.Component {
const member = this.props.member || const member = this.props.member ||
otherUserId && MatrixClientPeg.get().getUser(otherUserId); otherUserId && MatrixClientPeg.get().getUser(otherUserId);
const title = request && request.isSelfVerification ? const title = request && request.isSelfVerification ?
_t("Verify other session") : _t("Verification Request"); _t("Verify other login") : _t("Verification Request");
return <BaseDialog className="mx_InfoDialog" onFinished={this.props.onFinished} return <BaseDialog className="mx_InfoDialog" onFinished={this.props.onFinished}
contentId="mx_Dialog_content" contentId="mx_Dialog_content"

View file

@ -52,7 +52,7 @@ const EncryptionInfo: React.FC<IProps> = ({
let text: string; let text: string;
if (waitingForOtherParty) { if (waitingForOtherParty) {
if (isSelfVerification) { if (isSelfVerification) {
text = _t("Waiting for you to accept on your other session…"); text = _t("Accept on your other login…");
} else { } else {
text = _t("Waiting for %(displayName)s to accept…", { text = _t("Waiting for %(displayName)s to accept…", {
displayName: member.displayName || member.name || member.userId, displayName: member.displayName || member.name || member.userId,

View file

@ -1,5 +1,5 @@
/* /*
Copyright 2020 The Matrix.org Foundation C.I.C. Copyright 2020-2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -21,6 +21,7 @@ import {XOR} from "../../../@types/common";
export interface IProps { export interface IProps {
description: ReactNode; description: ReactNode;
detail?: ReactNode;
acceptLabel: string; acceptLabel: string;
onAccept(); onAccept();
@ -33,14 +34,19 @@ interface IPropsExtended extends IProps {
const GenericToast: React.FC<XOR<IPropsExtended, IProps>> = ({ const GenericToast: React.FC<XOR<IPropsExtended, IProps>> = ({
description, description,
detail,
acceptLabel, acceptLabel,
rejectLabel, rejectLabel,
onAccept, onAccept,
onReject, onReject,
}) => { }) => {
const detailContent = detail ? <span className="mx_Toast_detail">
{detail}
</span> : null;
return <div> return <div>
<div className="mx_Toast_description"> <div className="mx_Toast_description">
{ description } {description}&nbsp;{detailContent}
</div> </div>
<div className="mx_Toast_buttons" aria-live="off"> <div className="mx_Toast_buttons" aria-live="off">
{onReject && rejectLabel && <FormButton label={rejectLabel} kind="danger" onClick={onReject} /> } {onReject && rejectLabel && <FormButton label={rejectLabel} kind="danger" onClick={onReject} /> }

View file

@ -1,5 +1,5 @@
/* /*
Copyright 2019 The Matrix.org Foundation C.I.C. Copyright 2019-2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -140,11 +140,12 @@ export default class VerificationRequestToast extends React.PureComponent<IProps
render() { render() {
const {request} = this.props; const {request} = this.props;
let nameLabel; let description;
let detail;
if (request.isSelfVerification) { if (request.isSelfVerification) {
if (this.state.device) { if (this.state.device) {
nameLabel = _t("From %(deviceName)s (%(deviceId)s) at %(ip)s", { description = this.state.device.getDisplayName();
deviceName: this.state.device.getDisplayName(), detail = _t("%(deviceId)s from %(ip)s", {
deviceId: this.state.device.deviceId, deviceId: this.state.device.deviceId,
ip: this.state.ip, ip: this.state.ip,
}); });
@ -152,13 +153,13 @@ export default class VerificationRequestToast extends React.PureComponent<IProps
} else { } else {
const userId = request.otherUserId; const userId = request.otherUserId;
const roomId = request.channel.roomId; const roomId = request.channel.roomId;
nameLabel = roomId ? userLabelForEventRoom(userId, roomId) : userId; description = roomId ? userLabelForEventRoom(userId, roomId) : userId;
// for legacy to_device verification requests // for legacy to_device verification requests
if (nameLabel === userId) { if (description === userId) {
const client = MatrixClientPeg.get(); const client = MatrixClientPeg.get();
const user = client.getUser(userId); const user = client.getUser(userId);
if (user && user.displayName) { if (user && user.displayName) {
nameLabel = _t("%(name)s (%(userId)s)", {name: user.displayName, userId}); description = _t("%(name)s (%(userId)s)", {name: user.displayName, userId});
} }
} }
} }
@ -167,7 +168,8 @@ export default class VerificationRequestToast extends React.PureComponent<IProps
_t("Decline (%(counter)s)", {counter: this.state.counter}); _t("Decline (%(counter)s)", {counter: this.state.counter});
return <GenericToast return <GenericToast
description={nameLabel} description={description}
detail={detail}
acceptLabel={_t("Accept")} acceptLabel={_t("Accept")}
onAccept={this.accept} onAccept={this.accept}
rejectLabel={declineLabel} rejectLabel={declineLabel}

View file

@ -729,7 +729,7 @@
"Yes": "Yes", "Yes": "Yes",
"No": "No", "No": "No",
"You have unverified logins": "You have unverified logins", "You have unverified logins": "You have unverified logins",
"Verify all your sessions to ensure your account & messages are safe": "Verify all your sessions to ensure your account & messages are safe", "Review to ensure your account is safe": "Review to ensure your account is safe",
"Review": "Review", "Review": "Review",
"Later": "Later", "Later": "Later",
"Don't miss a reply": "Don't miss a reply", "Don't miss a reply": "Don't miss a reply",
@ -753,7 +753,7 @@
"Safeguard against losing access to encrypted messages & data": "Safeguard against losing access to encrypted messages & data", "Safeguard against losing access to encrypted messages & data": "Safeguard against losing access to encrypted messages & data",
"Other users may not trust it": "Other users may not trust it", "Other users may not trust it": "Other users may not trust it",
"New login. Was this you?": "New login. Was this you?", "New login. Was this you?": "New login. Was this you?",
"A new login is accessing your account: %(name)s (%(deviceID)s) at %(ip)s": "A new login is accessing your account: %(name)s (%(deviceID)s) at %(ip)s", "%(deviceId)s from %(ip)s": "%(deviceId)s from %(ip)s",
"Check your devices": "Check your devices", "Check your devices": "Check your devices",
"What's new?": "What's new?", "What's new?": "What's new?",
"What's New": "What's New", "What's New": "What's New",
@ -982,7 +982,6 @@
"Folder": "Folder", "Folder": "Folder",
"Pin": "Pin", "Pin": "Pin",
"Your server isn't responding to some <a>requests</a>.": "Your server isn't responding to some <a>requests</a>.", "Your server isn't responding to some <a>requests</a>.": "Your server isn't responding to some <a>requests</a>.",
"From %(deviceName)s (%(deviceId)s) at %(ip)s": "From %(deviceName)s (%(deviceId)s) at %(ip)s",
"Decline (%(counter)s)": "Decline (%(counter)s)", "Decline (%(counter)s)": "Decline (%(counter)s)",
"Accept <policyLink /> to continue:": "Accept <policyLink /> to continue:", "Accept <policyLink /> to continue:": "Accept <policyLink /> to continue:",
"Delete": "Delete", "Delete": "Delete",
@ -1678,7 +1677,7 @@
"In encrypted rooms, like this one, URL previews are disabled by default to ensure that your homeserver (where the previews are generated) cannot gather information about links you see in this room.": "In encrypted rooms, like this one, URL previews are disabled by default to ensure that your homeserver (where the previews are generated) cannot gather information about links you see in this room.", "In encrypted rooms, like this one, URL previews are disabled by default to ensure that your homeserver (where the previews are generated) cannot gather information about links you see in this room.": "In encrypted rooms, like this one, URL previews are disabled by default to ensure that your homeserver (where the previews are generated) cannot gather information about links you see in this room.",
"When someone puts a URL in their message, a URL preview can be shown to give more information about that link such as the title, description, and an image from the website.": "When someone puts a URL in their message, a URL preview can be shown to give more information about that link such as the title, description, and an image from the website.", "When someone puts a URL in their message, a URL preview can be shown to give more information about that link such as the title, description, and an image from the website.": "When someone puts a URL in their message, a URL preview can be shown to give more information about that link such as the title, description, and an image from the website.",
"Back": "Back", "Back": "Back",
"Waiting for you to accept on your other session…": "Waiting for you to accept on your other session…", "Accept on your other login…": "Accept on your other login…",
"Waiting for %(displayName)s to accept…": "Waiting for %(displayName)s to accept…", "Waiting for %(displayName)s to accept…": "Waiting for %(displayName)s to accept…",
"Accepting…": "Accepting…", "Accepting…": "Accepting…",
"Start Verification": "Start Verification", "Start Verification": "Start Verification",
@ -2350,7 +2349,7 @@
"Upload %(count)s other files|one": "Upload %(count)s other file", "Upload %(count)s other files|one": "Upload %(count)s other file",
"Cancel All": "Cancel All", "Cancel All": "Cancel All",
"Upload Error": "Upload Error", "Upload Error": "Upload Error",
"Verify other session": "Verify other session", "Verify other login": "Verify other login",
"Verification Request": "Verification Request", "Verification Request": "Verification Request",
"Approve widget permissions": "Approve widget permissions", "Approve widget permissions": "Approve widget permissions",
"This widget would like to:": "This widget would like to:", "This widget would like to:": "This widget would like to:",
@ -2551,7 +2550,7 @@
"Review terms and conditions": "Review terms and conditions", "Review terms and conditions": "Review terms and conditions",
"Old cryptography data detected": "Old cryptography data detected", "Old cryptography data detected": "Old cryptography data detected",
"Data from an older version of %(brand)s has been detected. This will have caused end-to-end cryptography to malfunction in the older version. End-to-end encrypted messages exchanged recently whilst using the older version may not be decryptable in this version. This may also cause messages exchanged with this version to fail. If you experience problems, log out and back in again. To retain message history, export and re-import your keys.": "Data from an older version of %(brand)s has been detected. This will have caused end-to-end cryptography to malfunction in the older version. End-to-end encrypted messages exchanged recently whilst using the older version may not be decryptable in this version. This may also cause messages exchanged with this version to fail. If you experience problems, log out and back in again. To retain message history, export and re-import your keys.", "Data from an older version of %(brand)s has been detected. This will have caused end-to-end cryptography to malfunction in the older version. End-to-end encrypted messages exchanged recently whilst using the older version may not be decryptable in this version. This may also cause messages exchanged with this version to fail. If you experience problems, log out and back in again. To retain message history, export and re-import your keys.": "Data from an older version of %(brand)s has been detected. This will have caused end-to-end cryptography to malfunction in the older version. End-to-end encrypted messages exchanged recently whilst using the older version may not be decryptable in this version. This may also cause messages exchanged with this version to fail. If you experience problems, log out and back in again. To retain message history, export and re-import your keys.",
"Self-verification request": "Self-verification request", "Verification requested": "Verification requested",
"Logout": "Logout", "Logout": "Logout",
"%(creator)s created this DM.": "%(creator)s created this DM.", "%(creator)s created this DM.": "%(creator)s created this DM.",
"%(creator)s created and configured the room.": "%(creator)s created and configured the room.", "%(creator)s created and configured the room.": "%(creator)s created and configured the room.",
@ -2741,11 +2740,11 @@
"Decide where your account is hosted": "Decide where your account is hosted", "Decide where your account is hosted": "Decide where your account is hosted",
"Use Security Key or Phrase": "Use Security Key or Phrase", "Use Security Key or Phrase": "Use Security Key or Phrase",
"Use Security Key": "Use Security Key", "Use Security Key": "Use Security Key",
"Verify with another session": "Verify with another session", "Use another login": "Use another login",
"Verify this login to access your encrypted messages and prove to others that this login is really you.": "Verify this login to access your encrypted messages and prove to others that this login is really you.", "Verify your identity to access encrypted messages and prove your identity to others.": "Verify your identity to access encrypted messages and prove your identity to others.",
"Your new session is now verified. It has access to your encrypted messages, and other users will see it as trusted.": "Your new session is now verified. It has access to your encrypted messages, and other users will see it as trusted.", "Your new session is now verified. It has access to your encrypted messages, and other users will see it as trusted.": "Your new session is now verified. It has access to your encrypted messages, and other users will see it as trusted.",
"Your new session is now verified. Other users will see it as trusted.": "Your new session is now verified. Other users will see it as trusted.", "Your new session is now verified. Other users will see it as trusted.": "Your new session is now verified. Other users will see it as trusted.",
"Without completing security on this session, it wont have access to encrypted messages.": "Without completing security on this session, it wont have access to encrypted messages.", "Without verifying, you wont have access to all your messages and may appear as untrusted to others.": "Without verifying, you wont have access to all your messages and may appear as untrusted to others.",
"Failed to re-authenticate due to a homeserver problem": "Failed to re-authenticate due to a homeserver problem", "Failed to re-authenticate due to a homeserver problem": "Failed to re-authenticate due to a homeserver problem",
"Incorrect password": "Incorrect password", "Incorrect password": "Incorrect password",
"Failed to re-authenticate": "Failed to re-authenticate", "Failed to re-authenticate": "Failed to re-authenticate",

View file

@ -42,7 +42,7 @@ export const showToast = (deviceIds: Set<string>) => {
title: _t("You have unverified logins"), title: _t("You have unverified logins"),
icon: "verification_warning", icon: "verification_warning",
props: { props: {
description: _t("Verify all your sessions to ensure your account & messages are safe"), description: _t("Review to ensure your account is safe"),
acceptLabel: _t("Review"), acceptLabel: _t("Review"),
onAccept, onAccept,
rejectLabel: _t("Later"), rejectLabel: _t("Later"),

View file

@ -49,13 +49,11 @@ export const showToast = async (deviceId: string) => {
title: _t("New login. Was this you?"), title: _t("New login. Was this you?"),
icon: "verification_warning", icon: "verification_warning",
props: { props: {
description: _t( description: device.display_name,
"A new login is accessing your account: %(name)s (%(deviceID)s) at %(ip)s", { detail: _t("%(deviceId)s from %(ip)s", {
name: device.display_name, deviceId,
deviceID: deviceId, ip: device.last_seen_ip,
ip: device.last_seen_ip, }),
},
),
acceptLabel: _t("Check your devices"), acceptLabel: _t("Check your devices"),
onAccept, onAccept,
rejectLabel: _t("Later"), rejectLabel: _t("Later"),