Skip to content
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

Normalized shortcut formatting for quote expansion control #7995

Merged
merged 8 commits into from
Mar 9, 2022
11 changes: 10 additions & 1 deletion src/components/views/messages/MessageActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,18 @@ export default class MessageActionBar extends React.PureComponent<IMessageAction
'mx_MessageActionBar_expandMessageButton': !this.props.isQuoteExpanded,
'mx_MessageActionBar_collapseMessageButton': this.props.isQuoteExpanded,
});
const tooltip = <div>
<div className="mx_Tooltip_title">
{ this.props.isQuoteExpanded ? _t("Collapse quotes") : _t("Expand quotes") }
</div>
<div className="mx_Tooltip_sub">
{ `${_t("Click")} + ⇧` }
Copy link
Member

Choose a reason for hiding this comment

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

This reverses the string, normally we have the modifier before the primary action, I'd suggest copying the behaviour from SpacePanel.tsx

{ _t(ALTERNATE_KEY_NAME[Key.SHIFT]) + " + " + _t("Click") }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

</div>
</div>;
toolbarOpts.push(<RovingAccessibleTooltipButton
className={expandClassName}
title={this.props.isQuoteExpanded ? _t("Collapse quotes │ ⇧+click") : _t("Expand quotes │ ⇧+click")}
title={this.props.isQuoteExpanded ? _t("Collapse quotes") : _t("Expand quotes")}
tooltip={tooltip}
onClick={this.props.toggleThreadExpanded}
key="expand"
/>);
Expand Down
5 changes: 3 additions & 2 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -2103,8 +2103,9 @@
"Edit": "Edit",
"Reply in thread": "Reply in thread",
"Reply": "Reply",
"Collapse quotes │ ⇧+click": "Collapse quotes │ ⇧+click",
"Expand quotes │ ⇧+click": "Expand quotes │ ⇧+click",
"Collapse quotes": "Collapse quotes",
"Expand quotes": "Expand quotes",
"Click": "Click",
"Download %(text)s": "Download %(text)s",
"Error decrypting attachment": "Error decrypting attachment",
"Decrypt %(text)s": "Decrypt %(text)s",
Expand Down