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

Commit

Permalink
Accessibility improvements around aria-labels and tooltips (#12062)
Browse files Browse the repository at this point in the history
* Prevent Cypress typechecking react-sdk components without strict mode

This prevented us from switching to `forwardRef` in a bunch of places
due to it behaving different with & without strict mode.

Signed-off-by: Michael Telatynski <[email protected]>

* Update global.d.ts

* Switch AccessibleButton and derivatives to using `forwardRef`

Signed-off-by: Michael Telatynski <[email protected]>

* Add missing ref={ref}

Signed-off-by: Michael Telatynski <[email protected]>

* Iterate

Signed-off-by: Michael Telatynski <[email protected]>

* Ensure RefObjects are used consistently

Signed-off-by: Michael Telatynski <[email protected]>

* Re-add WysiwygAutocomplete displayname

Signed-off-by: Michael Telatynski <[email protected]>

* Fix forwardRef types

Signed-off-by: Michael Telatynski <[email protected]>

* Add comments

Signed-off-by: Michael Telatynski <[email protected]>

* Remove unused export

Signed-off-by: Michael Telatynski <[email protected]>

* Readd comment

Signed-off-by: Michael Telatynski <[email protected]>

* Accessibility improvements around aria-labels and tooltips

Signed-off-by: Michael Telatynski <[email protected]>

* Tweak copy

Signed-off-by: Michael Telatynski <[email protected]>

* Iterate types & comments

Signed-off-by: Michael Telatynski <[email protected]>

* i18n

Signed-off-by: Michael Telatynski <[email protected]>

* Update snapshots

Signed-off-by: Michael Telatynski <[email protected]>

* Apply suggestions from code review

Co-authored-by: Richard van der Hoff <[email protected]>

* Add comment

Signed-off-by: Michael Telatynski <[email protected]>

* Iterate

Signed-off-by: Michael Telatynski <[email protected]>

* Improve comment

Signed-off-by: Michael Telatynski <[email protected]>

* Prettier & i18n

Signed-off-by: Michael Telatynski <[email protected]>

---------

Signed-off-by: Michael Telatynski <[email protected]>
Co-authored-by: Richard van der Hoff <[email protected]>
  • Loading branch information
t3chguy and richvdh authored Jan 5, 2024
1 parent a8949ea commit 8601763
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/views/audio_messages/SeekBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import React, { ChangeEvent, CSSProperties, ReactNode } from "react";
import { PlaybackInterface } from "../../../audio/Playback";
import { MarkedExecution } from "../../../utils/MarkedExecution";
import { percentageOf } from "../../../utils/numbers";
import { _t } from "../../../languageHandler";

interface IProps {
// Playback instance to render. Cannot change during component lifecycle: create
Expand Down Expand Up @@ -112,6 +113,7 @@ export default class SeekBar extends React.PureComponent<IProps, IState> {
step={0.001}
style={{ "--fillTo": this.state.percentage } as ISeekCSS}
disabled={this.props.disabled}
aria-label={_t("a11y|seek_bar_label")}
/>
);
}
Expand Down
1 change: 1 addition & 0 deletions src/components/views/rooms/RoomHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ export default function RoomHeader({
size="20px"
overflow={false}
viewUserOnClick={false}
tooltipLabel={_t("room|header_face_pile_tooltip")}
>
{formatCount(memberCount)}
</FacePile>
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"recent_rooms": "Recent rooms",
"room_name": "Room %(name)s",
"room_status_bar": "Room status bar",
"seek_bar_label": "Audio seek bar",
"unread_messages": "Unread messages.",
"user_menu": "User menu"
},
Expand Down Expand Up @@ -1946,6 +1947,7 @@
"video_call_ec_layout_spotlight": "Spotlight",
"video_room_view_chat_button": "View chat timeline"
},
"header_face_pile_tooltip": "Toggle member list",
"header_untrusted_label": "Untrusted",
"inaccessible": "This room or space is not accessible at this time.",
"inaccessible_name": "%(roomName)s is not accessible at this time.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
exports[`SeekBar when rendering a SeekBar and the playback proceeds should render as expected 1`] = `
<div>
<input
aria-label="Audio seek bar"
class="mx_SeekBar"
max="1"
min="0"
Expand All @@ -18,6 +19,7 @@ exports[`SeekBar when rendering a SeekBar and the playback proceeds should rende
exports[`SeekBar when rendering a SeekBar for an empty playback should render correctly 1`] = `
<div>
<input
aria-label="Audio seek bar"
class="mx_SeekBar"
max="1"
min="0"
Expand All @@ -33,6 +35,7 @@ exports[`SeekBar when rendering a SeekBar for an empty playback should render co
exports[`SeekBar when rendering a SeekBar should render the initial position 1`] = `
<div>
<input
aria-label="Audio seek bar"
class="mx_SeekBar"
max="1"
min="0"
Expand All @@ -48,6 +51,7 @@ exports[`SeekBar when rendering a SeekBar should render the initial position 1`]
exports[`SeekBar when rendering a disabled SeekBar should render as expected 1`] = `
<div>
<input
aria-label="Audio seek bar"
class="mx_SeekBar"
disabled=""
max="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ exports[`VoiceBroadcastPlaybackBody when rendering a buffering voice broadcast s
</div>
</div>
<input
aria-label="Audio seek bar"
class="mx_SeekBar"
max="1"
min="0"
Expand Down Expand Up @@ -213,6 +214,7 @@ exports[`VoiceBroadcastPlaybackBody when rendering a pause/not-live broadcast sh
</div>
</div>
<input
aria-label="Audio seek bar"
class="mx_SeekBar"
max="1"
min="0"
Expand Down Expand Up @@ -338,6 +340,7 @@ exports[`VoiceBroadcastPlaybackBody when rendering a playing broadcast in pip mo
</div>
</div>
<input
aria-label="Audio seek bar"
class="mx_SeekBar"
max="1"
min="0"
Expand Down Expand Up @@ -451,6 +454,7 @@ exports[`VoiceBroadcastPlaybackBody when rendering a playing broadcast should re
</div>
</div>
<input
aria-label="Audio seek bar"
class="mx_SeekBar"
max="1"
min="0"
Expand Down Expand Up @@ -572,6 +576,7 @@ exports[`VoiceBroadcastPlaybackBody when rendering a playing/live broadcast shou
</div>
</div>
<input
aria-label="Audio seek bar"
class="mx_SeekBar"
max="1"
min="0"
Expand Down Expand Up @@ -665,6 +670,7 @@ exports[`VoiceBroadcastPlaybackBody when rendering a stopped broadcast should re
</div>
</div>
<input
aria-label="Audio seek bar"
class="mx_SeekBar"
max="1"
min="0"
Expand Down

0 comments on commit 8601763

Please sign in to comment.