From 0e3ed7ea2a67b56629cbca12ab428da4b3b2ba6d Mon Sep 17 00:00:00 2001 From: Kris Date: Wed, 10 Jul 2024 13:14:36 -0400 Subject: [PATCH] A11Y: improve topic list table markup for screenreaders (#27808) Co-authored-by: Jarek Radosz --- .../discourse/app/components/topic-list.hbs | 2 ++ .../app/components/topic-list/list.gjs | 1 + .../components/topic-list/topic-entrance.gjs | 1 + .../topic-list/topic-list-header-column.gjs | 12 ++++++---- .../topic-list/topic-list-header.gjs | 7 ++---- .../raw-templates/list/posts-count-column.hbr | 4 ++-- .../topic-list-header-column.hbr | 4 ++-- .../app/raw-templates/topic-list-header.hbr | 12 +++++----- .../app/raw-views/list/posts-count-column.js | 5 +++- config/locales/client.en.yml | 23 ++++++++----------- spec/lib/js_locale_helper_spec.rb | 4 ++-- 11 files changed, 40 insertions(+), 35 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/topic-list.hbs b/app/assets/javascripts/discourse/app/components/topic-list.hbs index 26613c77bdc..9f5f54cdbc1 100644 --- a/app/assets/javascripts/discourse/app/components/topic-list.hbs +++ b/app/assets/javascripts/discourse/app/components/topic-list.hbs @@ -1,3 +1,5 @@ +{{i18n "sr_topic_list_caption"}} + {{raw "topic-list-header" diff --git a/app/assets/javascripts/discourse/app/components/topic-list/list.gjs b/app/assets/javascripts/discourse/app/components/topic-list/list.gjs index 0e038671966..fe71c3d97c6 100644 --- a/app/assets/javascripts/discourse/app/components/topic-list/list.gjs +++ b/app/assets/javascripts/discourse/app/components/topic-list/list.gjs @@ -101,6 +101,7 @@ export default class TopicList extends Component { (if this.bulkSelectEnabled "sticky-header") }} > + {{i18n "sr_topic_list_caption"}} {{else}} - {{this.localizedName}} + + {{this.localizedName}} + {{/if}} {{/unless}} diff --git a/app/assets/javascripts/discourse/app/components/topic-list/topic-list-header.gjs b/app/assets/javascripts/discourse/app/components/topic-list/topic-list-header.gjs index eaafa282e48..e33cce7ef2e 100644 --- a/app/assets/javascripts/discourse/app/components/topic-list/topic-list-header.gjs +++ b/app/assets/javascripts/discourse/app/components/topic-list/topic-list-header.gjs @@ -50,6 +50,8 @@ const TopicListHeader =