From 27cbdc6f227a78b684b9e2bc443705654381d076 Mon Sep 17 00:00:00 2001 From: Jasmin Johal <35678644+jasminjohal@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:46:08 -0800 Subject: [PATCH] Change alt text to empty string for avatars (#21875) Co-authored-by: Renaud Chaput --- app/helpers/admin/account_moderation_notes_helper.rb | 2 +- app/helpers/settings_helper.rb | 2 +- .../components/__tests__/__snapshots__/avatar-test.jsx.snap | 4 ++-- app/javascript/mastodon/components/avatar.tsx | 2 +- .../features/account_timeline/containers/header_container.jsx | 2 +- app/views/filters/statuses/_status_filter.html.haml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/helpers/admin/account_moderation_notes_helper.rb b/app/helpers/admin/account_moderation_notes_helper.rb index 2f08538ca6..3b9d580499 100644 --- a/app/helpers/admin/account_moderation_notes_helper.rb +++ b/app/helpers/admin/account_moderation_notes_helper.rb @@ -6,7 +6,7 @@ module Admin::AccountModerationNotesHelper link_to path || admin_account_path(account.id), class: name_tag_classes(account), title: account.acct do safe_join([ - image_tag(account.avatar.url, width: 15, height: 15, alt: display_name(account), class: 'avatar'), + image_tag(account.avatar.url, width: 15, height: 15, alt: '', class: 'avatar'), content_tag(:span, account.acct, class: 'username'), ], ' ') end diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb index fce36bf43e..3c72b22c66 100644 --- a/app/helpers/settings_helper.rb +++ b/app/helpers/settings_helper.rb @@ -25,7 +25,7 @@ module SettingsHelper return if account.nil? link_to ActivityPub::TagManager.instance.url_for(account), class: 'name-tag', title: account.acct do - safe_join([image_tag(account.avatar.url, width: 15, height: 15, alt: display_name(account), class: 'avatar'), content_tag(:span, account.acct, class: 'username')], ' ') + safe_join([image_tag(account.avatar.url, width: 15, height: 15, alt: '', class: 'avatar'), content_tag(:span, account.acct, class: 'username')], ' ') end end end diff --git a/app/javascript/mastodon/components/__tests__/__snapshots__/avatar-test.jsx.snap b/app/javascript/mastodon/components/__tests__/__snapshots__/avatar-test.jsx.snap index 7fbdedeb23..2f0a2de324 100644 --- a/app/javascript/mastodon/components/__tests__/__snapshots__/avatar-test.jsx.snap +++ b/app/javascript/mastodon/components/__tests__/__snapshots__/avatar-test.jsx.snap @@ -13,7 +13,7 @@ exports[` Autoplay renders a animated avatar 1`] = ` } > alice @@ -32,7 +32,7 @@ exports[` Still renders a still avatar 1`] = ` } > alice diff --git a/app/javascript/mastodon/components/avatar.tsx b/app/javascript/mastodon/components/avatar.tsx index 77bd423409..8f866a3c65 100644 --- a/app/javascript/mastodon/components/avatar.tsx +++ b/app/javascript/mastodon/components/avatar.tsx @@ -42,7 +42,7 @@ export const Avatar: React.FC = ({ onMouseLeave={handleMouseLeave} style={style} > - {src && {account?.get('acct')}} + {src && } ); }; diff --git a/app/javascript/mastodon/features/account_timeline/containers/header_container.jsx b/app/javascript/mastodon/features/account_timeline/containers/header_container.jsx index df5427c307..84a303c37a 100644 --- a/app/javascript/mastodon/features/account_timeline/containers/header_container.jsx +++ b/app/javascript/mastodon/features/account_timeline/containers/header_container.jsx @@ -178,7 +178,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ modalType: 'IMAGE', modalProps: { src: account.get('avatar'), - alt: account.get('acct'), + alt: '', }, })); }, diff --git a/app/views/filters/statuses/_status_filter.html.haml b/app/views/filters/statuses/_status_filter.html.haml index ba1170cf92..9999dcda81 100644 --- a/app/views/filters/statuses/_status_filter.html.haml +++ b/app/views/filters/statuses/_status_filter.html.haml @@ -20,7 +20,7 @@ .detailed-status__meta = link_to ActivityPub::TagManager.instance.url_for(status.account), class: 'name-tag', target: '_blank', rel: 'noopener noreferrer' do - = image_tag(status.account.avatar.url, width: 15, height: 15, alt: display_name(status.account), class: 'avatar') + = image_tag(status.account.avatar.url, width: 15, height: 15, alt: '', class: 'avatar') .username= status.account.acct ยท = link_to ActivityPub::TagManager.instance.url_for(status), class: 'detailed-status__datetime', target: stream_link_target, rel: 'noopener noreferrer' do