From f61f138b753be87fa10776492a6dad2979dcc2dc Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 25 Jul 2024 07:54:12 -0700 Subject: [PATCH] tooltips: Clean up aria-label for visiblity tooltips. Using different punctuation for the aria-label from the tooltip is silly. Additionally, we don't need to repeat the channel name in aria-label; it essentially will never be seen and the message list copy of getting the channel name was buggy. --- web/src/inbox_ui.ts | 1 - web/src/message_list_view.js | 2 -- web/templates/inbox_view/inbox_row.hbs | 8 ++++---- web/templates/recent_view_row.hbs | 8 ++++---- web/templates/recipient_row.hbs | 8 ++++---- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/web/src/inbox_ui.ts b/web/src/inbox_ui.ts index ed1e82ae28..f66141a5bc 100644 --- a/web/src/inbox_ui.ts +++ b/web/src/inbox_ui.ts @@ -436,7 +436,6 @@ function format_topic( is_topic: true, stream_id, topic_name: topic, - stream_name: stream_data.get_stream_name_from_id(stream_id), unread_count: topic_unread_count, conversation_key: get_topic_key(stream_id, topic), topic_url: hash_util.by_stream_topic_url(stream_id, topic), diff --git a/web/src/message_list_view.js b/web/src/message_list_view.js index fcc5038144..b0b569177e 100644 --- a/web/src/message_list_view.js +++ b/web/src/message_list_view.js @@ -289,10 +289,8 @@ function populate_group_from_message_container(group, message_container) { // module. Ideally, we'd clean this up by making the // tutorial populate stream_settings_ui.js "properly". group.stream_id = -1; - group.stream_name = $t({defaultMessage: "Unknown channel"}); } else { group.stream_id = sub.stream_id; - group.stream_name = stream_data.get_stream_name_from_id(sub.stream_id); } group.is_subscribed = stream_data.is_subscribed(group.stream_id); group.topic_is_resolved = resolved_topic.is_resolved(group.topic); diff --git a/web/templates/inbox_view/inbox_row.hbs b/web/templates/inbox_view/inbox_row.hbs index 6632530df9..88d9afb474 100644 --- a/web/templates/inbox_view/inbox_row.hbs +++ b/web/templates/inbox_view/inbox_row.hbs @@ -51,16 +51,16 @@ data-stream-id="{{stream_id}}" data-topic-name="{{topic_name}}" tabindex="0" data-col-index="{{ column_indexes.TOPIC_VISIBILITY }}"> {{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}} + role="button" aria-haspopup="true" aria-label="{{t 'You follow this topic.' }}"> {{else if (eq visibility_policy all_visibility_policies.UNMUTED)}} + role="button" aria-haspopup="true" aria-label="{{t 'You have unmuted this topic.' }}"> {{else if (eq visibility_policy all_visibility_policies.MUTED)}} + role="button" aria-haspopup="true" aria-label="{{t 'You have muted this topic.' }}"> {{else if (eq visibility_policy all_visibility_policies.INHERIT)}} + role="button" aria-haspopup="true" aria-label="{{t 'Notifications are based on your configuration for this channel.' }}"> {{/if}} {{/if}} diff --git a/web/templates/recent_view_row.hbs b/web/templates/recent_view_row.hbs index 41478b8860..2b2a2efce9 100644 --- a/web/templates/recent_view_row.hbs +++ b/web/templates/recent_view_row.hbs @@ -63,16 +63,16 @@ {{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}} + role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You follow this topic.' }}"> {{else if (eq visibility_policy all_visibility_policies.UNMUTED)}} + role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You have unmuted this topic.' }}"> {{else if (eq visibility_policy all_visibility_policies.MUTED)}} + role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You have muted this topic.' }}"> {{else}} + role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'Notifications are based on your configuration for this channel.' }}"> {{/if}} diff --git a/web/templates/recipient_row.hbs b/web/templates/recipient_row.hbs index 4f6e0e9b6d..a17b7c9cce 100644 --- a/web/templates/recipient_row.hbs +++ b/web/templates/recipient_row.hbs @@ -62,16 +62,16 @@ {{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}} + role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You follow this topic.' }}"> {{else if (eq visibility_policy all_visibility_policies.UNMUTED)}} + role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You have unmuted this topic.' }}"> {{else if (eq visibility_policy all_visibility_policies.MUTED)}} + role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You have muted this topic.' }}"> {{else}} + role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'Notifications are based on your configuration for this channel.' }}"> {{/if}} {{/if}}