fix(a11y) fix ambiguous label on toggle buttons

This commit is contained in:
Emmanuel Pelletier 2022-10-20 11:51:36 +02:00 committed by Calin-Teodor
parent d9692cc4fa
commit 75ba0d45f7
14 changed files with 63 additions and 146 deletions

View File

@ -1097,11 +1097,20 @@
"cc": "Toggle subtitles", "cc": "Toggle subtitles",
"chat": "Open / Close chat", "chat": "Open / Close chat",
"clap": "Clap", "clap": "Clap",
"closeChat": "Close chat",
"closeMoreActions": "Close more actions menu",
"closeParticipantsPane": "Close participants pane",
"collapse": "Collapse", "collapse": "Collapse",
"document": "Toggle shared document", "document": "Toggle shared document",
"documentClose": "Close shared document",
"documentOpen": "Open shared document",
"download": "Download our apps", "download": "Download our apps",
"embedMeeting": "Embed meeting", "embedMeeting": "Embed meeting",
"endConference": "End meeting for all", "endConference": "End meeting for all",
"enterFullScreen": "View full screen",
"enterTileView": "Enter tile view",
"exitFullScreen": "Exit full screen",
"exitTileView": "Exit tile view",
"expand": "Expand", "expand": "Expand",
"feedback": "Leave feedback", "feedback": "Leave feedback",
"fullScreen": "Toggle full screen", "fullScreen": "Toggle full screen",
@ -1110,6 +1119,7 @@
"hangup": "Leave the meeting", "hangup": "Leave the meeting",
"heading": "Toolbar", "heading": "Toolbar",
"help": "Help", "help": "Help",
"hideWhiteboard": "Hide whiteboard",
"invite": "Invite people", "invite": "Invite people",
"kick": "Kick participant", "kick": "Kick participant",
"laugh": "Laugh", "laugh": "Laugh",
@ -1119,21 +1129,23 @@
"lobbyButton": "Enable/disable lobby mode", "lobbyButton": "Enable/disable lobby mode",
"localRecording": "Toggle local recording controls", "localRecording": "Toggle local recording controls",
"lockRoom": "Toggle meeting password", "lockRoom": "Toggle meeting password",
"lowerHand": "Lower your hand",
"moreActions": "More actions", "moreActions": "More actions",
"moreActionsMenu": "More actions menu", "moreActionsMenu": "More actions menu",
"moreOptions": "Show more options", "moreOptions": "Show more options",
"mute": "Mute / Unmute", "mute": "Mute",
"muteEveryone": "Mute everyone", "muteEveryone": "Mute everyone",
"muteEveryoneElse": "Mute everyone else", "muteEveryoneElse": "Mute everyone else",
"muteEveryoneElsesVideoStream": "Stop everyone else's video", "muteEveryoneElsesVideoStream": "Stop everyone else's video",
"muteEveryonesVideoStream": "Stop everyone's video", "muteEveryonesVideoStream": "Stop everyone's video",
"noiseSuppression": "Noise suppression", "noiseSuppression": "Noise suppression",
"participants": "Participants", "openChat": "Open chat",
"participants": "Open participants pane",
"pip": "Toggle Picture-in-Picture mode", "pip": "Toggle Picture-in-Picture mode",
"privateMessage": "Send private message", "privateMessage": "Send private message",
"profile": "Edit your profile", "profile": "Edit your profile",
"raiseHand": "Raise / Lower your hand", "raiseHand": "Raise your hand",
"reactionsMenu": "Open / Close reactions menu", "reactionsMenu": "Reactions menu",
"recording": "Toggle recording", "recording": "Toggle recording",
"remoteMute": "Mute participant", "remoteMute": "Mute participant",
"remoteVideoMute": "Disable camera of participant", "remoteVideoMute": "Disable camera of participant",
@ -1141,20 +1153,24 @@
"selectBackground": "Select Background", "selectBackground": "Select Background",
"selfView": "Toggle self view", "selfView": "Toggle self view",
"shareRoom": "Invite someone", "shareRoom": "Invite someone",
"shareYourScreen": "Start / Stop sharing your screen", "shareYourScreen": "Start sharing your screen",
"shareaudio": "Share audio", "shareaudio": "Share audio",
"sharedvideo": "Toggle video sharing", "sharedvideo": "Share video",
"shortcuts": "Toggle shortcuts", "shortcuts": "Toggle shortcuts",
"show": "Show on stage", "show": "Show on stage",
"showWhiteboard": "Show whiteboard",
"silence": "Silence", "silence": "Silence",
"speakerStats": "Toggle participants statistics", "speakerStats": "Toggle participants statistics",
"stopScreenSharing": "Stop sharing your screen",
"stopSharedVideo": "Stop video",
"surprised": "Surprised", "surprised": "Surprised",
"tileView": "Toggle tile view", "tileView": "Toggle tile view",
"toggleCamera": "Toggle camera", "toggleCamera": "Toggle camera",
"toggleFilmstrip": "Toggle filmstrip", "toggleFilmstrip": "Toggle filmstrip",
"unmute": "Unmute",
"videoblur": "Toggle video blur", "videoblur": "Toggle video blur",
"videomute": "Start / Stop camera", "videomute": "Stop camera",
"whiteboard": "Show / Hide whiteboard" "videounmute": "Start camera"
}, },
"addPeople": "Add people to your call", "addPeople": "Add people to your call",
"audioOnlyOff": "Disable low bandwidth mode", "audioOnlyOff": "Disable low bandwidth mode",
@ -1167,6 +1183,7 @@
"chat": "Open / Close chat", "chat": "Open / Close chat",
"clap": "Clap", "clap": "Clap",
"closeChat": "Close chat", "closeChat": "Close chat",
"closeParticipantsPane": "Close participants pane",
"closeReactionsMenu": "Close reactions menu", "closeReactionsMenu": "Close reactions menu",
"disableNoiseSuppression": "Disable noise suppression", "disableNoiseSuppression": "Disable noise suppression",
"disableReactionSounds": "You can disable reaction sounds for this meeting", "disableReactionSounds": "You can disable reaction sounds for this meeting",
@ -1200,7 +1217,7 @@
"lowerYourHand": "Lower your hand", "lowerYourHand": "Lower your hand",
"moreActions": "More actions", "moreActions": "More actions",
"moreOptions": "More options", "moreOptions": "More options",
"mute": "Mute / Unmute", "mute": "Mute",
"muteEveryone": "Mute everyone", "muteEveryone": "Mute everyone",
"muteEveryonesVideo": "Disable everyone's camera", "muteEveryonesVideo": "Disable everyone's camera",
"noAudioSignalDesc": "If you did not purposely mute it from system settings or hardware, consider switching the device.", "noAudioSignalDesc": "If you did not purposely mute it from system settings or hardware, consider switching the device.",
@ -1217,7 +1234,7 @@
"pip": "Enter Picture-in-Picture mode", "pip": "Enter Picture-in-Picture mode",
"privateMessage": "Send private message", "privateMessage": "Send private message",
"profile": "Edit your profile", "profile": "Edit your profile",
"raiseHand": "Raise / Lower your hand", "raiseHand": "Raise your hand",
"raiseYourHand": "Raise your hand", "raiseYourHand": "Raise your hand",
"reactionBoo": "Send boo reaction", "reactionBoo": "Send boo reaction",
"reactionClap": "Send clap reaction", "reactionClap": "Send clap reaction",
@ -1244,8 +1261,10 @@
"talkWhileMutedPopup": "Trying to speak? You are muted.", "talkWhileMutedPopup": "Trying to speak? You are muted.",
"tileViewToggle": "Toggle tile view", "tileViewToggle": "Toggle tile view",
"toggleCamera": "Toggle camera", "toggleCamera": "Toggle camera",
"unmute": "Unmute",
"videoSettings": "Video settings", "videoSettings": "Video settings",
"videomute": "Start / Stop camera" "videomute": "Stop camera",
"videounmute": "Start camera"
}, },
"transcribing": { "transcribing": {
"ccButtonTooltip": "Start / Stop subtitles", "ccButtonTooltip": "Start / Stop subtitles",

View File

@ -24,30 +24,13 @@ type Props = AbstractButtonProps & {
* Implementation of a button for accessing chat pane. * Implementation of a button for accessing chat pane.
*/ */
class ChatButton extends AbstractButton<Props, *> { class ChatButton extends AbstractButton<Props, *> {
accessibilityLabel = 'toolbar.accessibilityLabel.chat'; accessibilityLabel = 'toolbar.accessibilityLabel.openChat';
toggledAccessibilityLabel = 'toolbar.accessibilityLabel.closeChat';
icon = IconMessage; icon = IconMessage;
label = 'toolbar.openChat'; label = 'toolbar.openChat';
toggledLabel = 'toolbar.closeChat'; toggledLabel = 'toolbar.closeChat';
tooltip = 'toolbar.openChat';
/** toggledTooltip = 'toolbar.closeChat';
* Retrieves tooltip dynamically.
*/
get tooltip() {
if (this._isToggled()) {
return 'toolbar.closeChat';
}
return 'toolbar.openChat';
}
/**
* Required by linter due to AbstractButton overwritten prop being writable.
*
* @param {string} _value - The value.
*/
set tooltip(_value) {
// Unused.
}
/** /**
* Indicates whether this button is in toggled state or not. * Indicates whether this button is in toggled state or not.

View File

@ -27,30 +27,13 @@ type Props = AbstractButtonProps & {
* Implements an {@link AbstractButton} to open the chat screen on mobile. * Implements an {@link AbstractButton} to open the chat screen on mobile.
*/ */
class SharedDocumentButton extends AbstractButton<Props, *> { class SharedDocumentButton extends AbstractButton<Props, *> {
accessibilityLabel = 'toolbar.accessibilityLabel.document'; accessibilityLabel = 'toolbar.accessibilityLabel.documentOpen';
toggledAccessibilityLabel = 'toolbar.accessibilityLabel.documentClose';
icon = IconShareDoc; icon = IconShareDoc;
label = 'toolbar.documentOpen'; label = 'toolbar.documentOpen';
toggledLabel = 'toolbar.documentClose'; toggledLabel = 'toolbar.documentClose';
tooltip = 'toolbar.documentOpen';
/** toggledTooltip = 'toolbar.documentClose';
* Dynamically retrieves tooltip based on sharing state.
*/
get tooltip() {
if (this._isToggled()) {
return 'toolbar.documentClose';
}
return 'toolbar.documentOpen';
}
/**
* Required by linter due to AbstractButton overwritten prop being writable.
*
* @param {string} _value - The value.
*/
set tooltip(_value) {
// Unused.
}
/** /**
* Handles clicking / pressing the button, and opens / closes the appropriate dialog. * Handles clicking / pressing the button, and opens / closes the appropriate dialog.

View File

@ -24,9 +24,11 @@ type Props = AbstractButtonProps & {
*/ */
class ParticipantsPaneButton extends AbstractButton<Props, *> { class ParticipantsPaneButton extends AbstractButton<Props, *> {
accessibilityLabel = 'toolbar.accessibilityLabel.participants'; accessibilityLabel = 'toolbar.accessibilityLabel.participants';
toggledAccessibilityLabel = 'toolbar.accessibilityLabel.closeParticipantsPane';
icon = IconUsers; icon = IconUsers;
label = 'toolbar.participants'; label = 'toolbar.participants';
tooltip = 'toolbar.participants'; tooltip = 'toolbar.participants';
toggledTooltip = 'toolbar.closeParticipantsPane';
/** /**
* Indicates whether this button is in toggled state or not. * Indicates whether this button is in toggled state or not.

View File

@ -21,25 +21,12 @@ type Props = AbstractButtonProps & {
*/ */
class RaiseHandButton extends AbstractButton<Props, *> { class RaiseHandButton extends AbstractButton<Props, *> {
accessibilityLabel = 'toolbar.accessibilityLabel.raiseHand'; accessibilityLabel = 'toolbar.accessibilityLabel.raiseHand';
toggledAccessibilityLabel = 'toolbar.accessibilityLabel.lowerHand';
icon = IconRaiseHand; icon = IconRaiseHand;
label = 'toolbar.raiseHand'; label = 'toolbar.raiseHand';
toggledLabel = 'toolbar.raiseHand'; toggledLabel = 'toolbar.lowerYourHand';
tooltip = 'toolbar.raiseHand';
/** toggledTooltip = 'toolbar.lowerYourHand';
* Retrieves tooltip dynamically.
*/
get tooltip() {
return 'toolbar.raiseHand';
}
/**
* Required by linter due to AbstractButton overwritten prop being writable.
*
* @param {string} _value - The value.
*/
set tooltip(_value) {
// Unused.
}
/** /**
* Indicates whether this button is in toggled state or not. * Indicates whether this button is in toggled state or not.

View File

@ -35,29 +35,12 @@ type Props = AbstractButtonProps & {
*/ */
class SharedVideoButton extends AbstractButton<Props, *> { class SharedVideoButton extends AbstractButton<Props, *> {
accessibilityLabel = 'toolbar.accessibilityLabel.sharedvideo'; accessibilityLabel = 'toolbar.accessibilityLabel.sharedvideo';
toggledAccessibilityLabel = 'toolbar.accessibilityLabel.stopSharedVideo';
icon = IconPlay; icon = IconPlay;
label = 'toolbar.sharedvideo'; label = 'toolbar.sharedvideo';
toggledLabel = 'toolbar.stopSharedVideo'; toggledLabel = 'toolbar.stopSharedVideo';
tooltip = 'toolbar.sharedvideo';
/** toggledTooltip = 'toolbar.stopSharedVideo';
* Dynamically retrieves tooltip based on sharing state.
*/
get tooltip() {
if (this._isToggled()) {
return 'toolbar.stopSharedVideo';
}
return 'toolbar.sharedvideo';
}
/**
* Required by linter due to AbstractButton overwritten prop being writable.
*
* @param {string} _value - The icon value.
*/
set tooltip(_value) {
// Unused.
}
/** /**
* Handles clicking / pressing the button, and opens a new dialog. * Handles clicking / pressing the button, and opens a new dialog.

View File

@ -46,8 +46,10 @@ type Props = AbstractButtonProps & {
*/ */
class AudioMuteButton extends AbstractAudioMuteButton<Props, *> { class AudioMuteButton extends AbstractAudioMuteButton<Props, *> {
accessibilityLabel = 'toolbar.accessibilityLabel.mute'; accessibilityLabel = 'toolbar.accessibilityLabel.mute';
toggledAccessibilityLabel = 'toolbar.accessibilityLabel.unmute';
label = 'toolbar.mute'; label = 'toolbar.mute';
tooltip = 'toolbar.mute'; tooltip = 'toolbar.mute';
toggledTooltip = 'toolbar.unmute';
/** /**
* Initializes a new {@code AudioMuteButton} instance. * Initializes a new {@code AudioMuteButton} instance.

View File

@ -47,8 +47,10 @@ type Props = AbstractButtonProps & {
*/ */
class VideoMuteButton extends AbstractVideoMuteButton<Props, *> { class VideoMuteButton extends AbstractVideoMuteButton<Props, *> {
accessibilityLabel = 'toolbar.accessibilityLabel.videomute'; accessibilityLabel = 'toolbar.accessibilityLabel.videomute';
toggledAccessibilityLabel = 'toolbar.accessibilityLabel.videounmute';
label = 'toolbar.videomute'; label = 'toolbar.videomute';
tooltip = 'toolbar.videomute'; tooltip = 'toolbar.videomute';
toggledTooltip = 'toolbar.videounmute';
/** /**
* Initializes a new {@code VideoMuteButton} instance. * Initializes a new {@code VideoMuteButton} instance.

View File

@ -17,9 +17,12 @@ type Props = AbstractButtonProps & {
* Implementation of a button for toggling fullscreen state. * Implementation of a button for toggling fullscreen state.
*/ */
class FullscreenButton extends AbstractButton<Props, *> { class FullscreenButton extends AbstractButton<Props, *> {
accessibilityLabel = 'toolbar.accessibilityLabel.fullScreen'; accessibilityLabel = 'toolbar.accessibilityLabel.enterFullScreen';
toggledAccessibilityLabel = 'toolbar.accessibilityLabel.exitFullScreen';
label = 'toolbar.enterFullScreen'; label = 'toolbar.enterFullScreen';
toggledLabel = 'toolbar.exitFullScreen'; toggledLabel = 'toolbar.exitFullScreen';
tooltip = 'toolbar.enterFullScreen';
toggledTooltip = 'toolbar.exitFullScreen';
/** /**
* Retrieves icon dynamically. * Retrieves icon dynamically.
@ -41,26 +44,6 @@ class FullscreenButton extends AbstractButton<Props, *> {
// Unused. // Unused.
} }
/**
* Retrieves icon dynamically.
*/
get tooltip() {
if (this._isToggled()) {
return 'toolbar.exitFullScreen';
}
return 'toolbar.enterFullScreen';
}
/**
* Required by linter due to AbstractButton overwritten prop being writable.
*
* @param {string} _value - The value.
*/
set tooltip(_value) {
// Unused.
}
/** /**
* Indicates whether this button is in toggled state or not. * Indicates whether this button is in toggled state or not.
* *

View File

@ -30,24 +30,9 @@ class HangupToggleButton extends AbstractButton<Props, any, any> {
label = 'toolbar.hangup'; label = 'toolbar.hangup';
toggledIcon = IconCloseLarge; toggledIcon = IconCloseLarge;
toggledLabel = 'toolbar.hangup'; toggledLabel = 'toolbar.hangup';
tooltip = 'toolbar.hangup';
props: Props; props: Props;
/**
* Retrieves tooltip dynamically.
*/
get tooltip() {
return 'toolbar.hangup';
}
/**
* Required by linter due to AbstractButton overwritten prop being writable.
*
* @param {string} _value - The value.
*/
set tooltip(_value) {
// Unused.
}
/** /**
* Indicates whether this button is in toggled state or not. * Indicates whether this button is in toggled state or not.
* *

View File

@ -26,25 +26,11 @@ type Props = AbstractButtonProps & {
*/ */
class OverflowToggleButton extends AbstractButton<Props, *> { class OverflowToggleButton extends AbstractButton<Props, *> {
accessibilityLabel = 'toolbar.accessibilityLabel.moreActions'; accessibilityLabel = 'toolbar.accessibilityLabel.moreActions';
toggledAccessibilityLabel = 'toolbar.accessibilityLabel.closeMoreActions';
icon = IconDotsHorizontal; icon = IconDotsHorizontal;
label = 'toolbar.moreActions'; label = 'toolbar.moreActions';
toggledLabel = 'toolbar.moreActions'; toggledLabel = 'toolbar.moreActions';
tooltip = 'toolbar.moreActions';
/**
* Retrieves tooltip dynamically.
*/
get tooltip() {
return 'toolbar.moreActions';
}
/**
* Required by linter due to AbstractButton overwritten prop being writable.
*
* @param {string} _value - The value.
*/
set tooltip(_value) {
// Unused.
}
/** /**
* Indicates whether this button is in toggled state or not. * Indicates whether this button is in toggled state or not.

View File

@ -31,11 +31,11 @@ type Props = AbstractButtonProps & {
*/ */
class ShareDesktopButton extends AbstractButton<Props, *> { class ShareDesktopButton extends AbstractButton<Props, *> {
accessibilityLabel = 'toolbar.accessibilityLabel.shareYourScreen'; accessibilityLabel = 'toolbar.accessibilityLabel.shareYourScreen';
toggledAccessibilityLabel = 'toolbar.accessibilityLabel.stopScreenSharing';
label = 'toolbar.startScreenSharing'; label = 'toolbar.startScreenSharing';
icon = IconScreenshare; icon = IconScreenshare;
toggledIcon = IconStopScreenshare; toggledIcon = IconStopScreenshare;
toggledLabel = 'toolbar.stopScreenSharing'; toggledLabel = 'toolbar.stopScreenSharing';
tooltip = 'toolbar.accessibilityLabel.shareYourScreen';
/** /**
* Retrieves tooltip dynamically. * Retrieves tooltip dynamically.

View File

@ -38,7 +38,8 @@ type Props = AbstractButtonProps & {
* @augments AbstractButton * @augments AbstractButton
*/ */
class TileViewButton<P: Props> extends AbstractButton<P, *> { class TileViewButton<P: Props> extends AbstractButton<P, *> {
accessibilityLabel = 'toolbar.accessibilityLabel.tileView'; accessibilityLabel = 'toolbar.accessibilityLabel.enterTileView';
toggledAccessibilityLabel = 'toolbar.accessibilityLabel.exitTileView';
icon = IconTileView; icon = IconTileView;
label = 'toolbar.enterTileView'; label = 'toolbar.enterTileView';
toggledLabel = 'toolbar.exitTileView'; toggledLabel = 'toolbar.exitTileView';

View File

@ -27,7 +27,8 @@ type Props = AbstractButtonProps & {
* Component that renders a toolbar button for the whiteboard. * Component that renders a toolbar button for the whiteboard.
*/ */
class WhiteboardButton extends AbstractButton<Props, any, any> { class WhiteboardButton extends AbstractButton<Props, any, any> {
accessibilityLabel = 'toolbar.accessibilityLabel.whiteboard'; accessibilityLabel = 'toolbar.accessibilityLabel.showWhiteboard';
toggledAccessibilityLabel = 'toolbar.accessibilityLabel.hideWhiteboard';
icon = IconWhiteboard; icon = IconWhiteboard;
label = 'toolbar.showWhiteboard'; label = 'toolbar.showWhiteboard';
toggledIcon = IconWhiteboardHide; toggledIcon = IconWhiteboardHide;