Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 4592f9f

Browse files
Normalized shortcut formatting for quote expansion control (#7995)
1 parent 9301208 commit 4592f9f

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/components/views/messages/MessageActionBar.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ import ReactionPicker from "../emojipicker/ReactionPicker";
4343
import { CardContext } from '../right_panel/BaseCard';
4444
import { showThread } from "../../../dispatcher/dispatch-actions/threads";
4545
import { shouldDisplayReply } from '../../../utils/Reply';
46+
import { Key } from "../../../Keyboard";
47+
import { ALTERNATE_KEY_NAME } from "../../../accessibility/KeyboardShortcuts";
4648

4749
interface IOptionsButtonProps {
4850
mxEvent: MatrixEvent;
@@ -382,9 +384,18 @@ export default class MessageActionBar extends React.PureComponent<IMessageAction
382384
'mx_MessageActionBar_expandMessageButton': !this.props.isQuoteExpanded,
383385
'mx_MessageActionBar_collapseMessageButton': this.props.isQuoteExpanded,
384386
});
387+
const tooltip = <div>
388+
<div className="mx_Tooltip_title">
389+
{ this.props.isQuoteExpanded ? _t("Collapse quotes") : _t("Expand quotes") }
390+
</div>
391+
<div className="mx_Tooltip_sub">
392+
{ _t(ALTERNATE_KEY_NAME[Key.SHIFT]) + " + " + _t("Click") }
393+
</div>
394+
</div>;
385395
toolbarOpts.push(<RovingAccessibleTooltipButton
386396
className={expandClassName}
387-
title={this.props.isQuoteExpanded ? _t("Collapse quotes │ ⇧+click") : _t("Expand quotes │ ⇧+click")}
397+
title={this.props.isQuoteExpanded ? _t("Collapse quotes") : _t("Expand quotes")}
398+
tooltip={tooltip}
388399
onClick={this.props.toggleThreadExpanded}
389400
key="expand"
390401
/>);

src/i18n/strings/en_EN.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,8 +2104,9 @@
21042104
"Edit": "Edit",
21052105
"Reply in thread": "Reply in thread",
21062106
"Reply": "Reply",
2107-
"Collapse quotes │ ⇧+click": "Collapse quotes │ ⇧+click",
2108-
"Expand quotes │ ⇧+click": "Expand quotes │ ⇧+click",
2107+
"Collapse quotes": "Collapse quotes",
2108+
"Expand quotes": "Expand quotes",
2109+
"Click": "Click",
21092110
"Download %(text)s": "Download %(text)s",
21102111
"Error decrypting attachment": "Error decrypting attachment",
21112112
"Decrypt %(text)s": "Decrypt %(text)s",

0 commit comments

Comments
 (0)