Skip to content

Commit ef8ea33

Browse files
ndarilektimabbott
authored andcommitted
accessibility: Make individual messages more accessible.
We do this by setting a region and exposing hidden icons.
1 parent 253c034 commit ef8ea33

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

static/templates/single_message.handlebars

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<div zid="{{msg/id}}" id="{{table_name}}{{msg/id}}"
2-
class="message_row{{^msg/is_stream}} private-message{{/msg/is_stream}}{{#include_sender}} include-sender{{/include_sender}}{{#contains_mention}} mention{{/contains_mention}}{{#include_footer}} last_message{{/include_footer}}{{#msg.unread}} unread{{/msg.unread}} {{#if msg.locally_echoed}}local{{/if}} selectable_row">
2+
class="message_row{{^msg/is_stream}} private-message{{/msg/is_stream}}{{#include_sender}} include-sender{{/include_sender}}{{#contains_mention}} mention{{/contains_mention}}{{#include_footer}} last_message{{/include_footer}}{{#msg.unread}} unread{{/msg.unread}} {{#if msg.locally_echoed}}local{{/if}} selectable_row"
3+
role="region" aria-label="{{t 'Message' }}">
34
<div class="unread_marker"><div class="unread-marker-fill"></div></div>
45
<div class="messagebox{{^include_sender}} prev_is_same_sender{{/include_sender}}{{^msg/is_stream}} private-message{{/msg/is_stream}} {{#if next_is_same_sender}}next_is_same_sender{{/if}}"
56
style="box-shadow: inset 2px 0px 0px 0px {{#if msg/is_stream}}{{background_color}}{{else}}#444444{{/if}}, -1px 0px 0px 0px {{#if msg/is_stream}}{{background_color}}{{else}}#444444{{/if}};">
@@ -16,7 +17,7 @@
1617
<span class="sender-status">
1718
<span class="sender_name-in-status auto-select sender_info_hover">{{msg/sender_full_name}}</span>
1819
{{#if sender_is_bot}}
19-
<i class="zulip-icon bot" aria-hidden="true"></i>
20+
<i class="zulip-icon bot" aria-label="{{t 'Bot' }}"></i>
2021
{{/if}}
2122
<span class="status-message">
2223
{{{ status_message }}}
@@ -28,7 +29,7 @@
2829
{{else}}
2930
<span class="sender_name auto-select">{{msg/sender_full_name}}</span>
3031
{{#if sender_is_bot}}
31-
<i class="zulip-icon bot" aria-hidden="true"></i>
32+
<i class="zulip-icon bot" aria-label="{{t 'Bot' }}"></i>
3233
{{/if}}
3334
{{/if}}
3435
{{/include_sender}}
@@ -45,18 +46,18 @@
4546
<div class="edit_content"></div>
4647
{{else}}
4748
<div class="reaction_button">
48-
<i class="fa fa-smile-o" aria-hidden="true" title="{{#tr this}}Add emoji reaction{{/tr}} (:)"></i>
49+
<i class="fa fa-smile-o" title="{{#tr this}}Add emoji reaction{{/tr}} (:)" aria-label="{{#tr this}}Add emoji reaction{{/tr}} (:)" role="button" aria-haspopup="true" tabindex="0"></i>
4950
</div>
5051
{{/if}}
5152

5253
{{#unless msg/locally_echoed}}
5354
<div class="info actions_hover">
54-
<i class="fa fa-chevron-down" aria-hidden="true" title="{{#tr this}}Message actions{{/tr}} (i)"></i>
55+
<i class="fa fa-chevron-down" title="{{#tr this}}Message actions{{/tr}} (i)" title="{{#tr this}}Message actions{{/tr}}" role="button" aria-haspopup="true" tabindex="0" aria-label="{{#tr this}}Message actions{{/tr}}"></i>
5556
</div>
5657
{{/unless}}
5758

5859
<div class="message_failed {{#unless msg.failed_request}}notvisible{{/unless}}">
59-
<i class="fa fa-refresh refresh-failed-message" aria-hidden="true" data-toggle="tooltip" title="{{t 'Retry' }}"></i>
60+
<i class="fa fa-refresh refresh-failed-message" data-toggle="tooltip" title="{{t 'Retry' }}" aria-label="{{t 'Retry' }}" role="button" tabindex="0"></i>
6061
<i class="fa fa-times-circle remove-failed-message" aria-hidden="true" data-toggle="tooltip" title="{{t 'Cancel' }}"></i>
6162
</div>
6263

0 commit comments

Comments
 (0)