From 6edf7609437eace7b134fe88a91623842e178ea1 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 21 May 2019 18:54:40 -0600 Subject: [PATCH] Mute avatars and read receipts on event tiles This reduces overall noise from the screen reader. It was reading the alt attribute from the sender avatar, which was just a mxid. The read receipts were just nonsensical noise. Fixes https://github.com/vector-im/riot-web/issues/2716 Fixes https://github.com/vector-im/riot-web/issues/5697 See https://github.com/vector-im/riot-web/issues/9747 --- src/components/views/elements/AccessibleButton.js | 4 ++-- src/components/views/rooms/EventTile.js | 12 +++++++++--- src/components/views/rooms/ReadReceiptMarker.js | 4 +++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/components/views/elements/AccessibleButton.js b/src/components/views/elements/AccessibleButton.js index 06c440c54e..19150682f0 100644 --- a/src/components/views/elements/AccessibleButton.js +++ b/src/components/views/elements/AccessibleButton.js @@ -67,8 +67,8 @@ export default function AccessibleButton(props) { restProps.ref = restProps.inputRef; delete restProps.inputRef; - restProps.tabIndex = restProps.tabIndex || "0"; - restProps.role = "button"; + restProps.tabIndex = restProps.tabIndex === undefined ? "0" : restProps.tabIndex; + restProps.role = restProps.role === undefined ? "button" : restProps.role; restProps.className = (restProps.className ? restProps.className + " " : "") + "mx_AccessibleButton"; diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 6f0d555d4f..8d01042ed1 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -545,6 +545,8 @@ module.exports = withMatrixClient(React.createClass({ const isRedacted = isMessageEvent(this.props.mxEvent) && this.props.isRedacted; const isEncryptionFailure = this.props.mxEvent.isDecryptionFailure(); + const muteScreenReader = isSending || !this.props.eventSendStatus; + const classes = classNames({ mx_EventTile: true, mx_EventTile_isEditing: this.props.isEditing, @@ -601,9 +603,13 @@ module.exports = withMatrixClient(React.createClass({ if (this.props.mxEvent.sender && avatarSize) { avatar = (
-
); @@ -773,7 +779,7 @@ module.exports = withMatrixClient(React.createClass({ 'replyThread', ); return ( -
+
{ readAvatars }
@@ -797,7 +803,7 @@ module.exports = withMatrixClient(React.createClass({ { actionBar }
{ - // The avatar goes after the event tile as it's absolutly positioned to be over the + // The avatar goes after the event tile as it's absolutely positioned to be over the // event tile line, so needs to be later in the DOM so it appears on top (this avoids // the need for further z-indexing chaos) } diff --git a/src/components/views/rooms/ReadReceiptMarker.js b/src/components/views/rooms/ReadReceiptMarker.js index 2f7a599d95..4025a36831 100644 --- a/src/components/views/rooms/ReadReceiptMarker.js +++ b/src/components/views/rooms/ReadReceiptMarker.js @@ -211,11 +211,13 @@ module.exports = React.createClass({