Skip to content

Commit 274908a

Browse files
committed
Enchance a11y on dashboard activity feed
Fixes CNVS-14501 Makes the show/hide more and remove options in the dashboard activity feed show all the time, not just on mouseover, in order to improve keyboard a11y. Adds aria-label to the context link informing a screenreader user where that link is going to go. Test Plan: 1) Give yourself at least one announcement, conversation message, assignment notification, and discussion. Easiest way is to create a a course and add an announcement, send a message to yourself from another user, add an assignment, and add a discussion. 2) Visit the dashboard (localhost:3000/) 3) Verify that the list of notifications is navigable with the keyboard only, because you can see from the get go that the 'show more' option and remove/ignore option. 4) Using a screenreader, navigate to the notification heading, then onto the course name link. Verify that you hear label text like "Visit Course Discussions" or similar. This should help SR users only click that option if that's what they want, so they keep looking for the "Show More" option (it's one link further through the tab flow) if that's what they want instead. Change-Id: I0726510a351f16768d98657e9891cb7a1c162be3 Reviewed-on: https://gerrit.instructure.com/41417 Reviewed-by: Joel Hough <joel@instructure.com> Product-Review: Aaron Cannon <acannon@instructure.com> Tested-by: Jenkins <jenkins@instructure.com> QA-Review: Steven Shepherd <sshepherd@instructure.com>
1 parent fabc01a commit 274908a

2 files changed

Lines changed: 22 additions & 14 deletions

File tree

app/helpers/dashboard_helper.rb

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,27 @@ def activity_category_links(category, items)
7373

7474
contexts.map do |name, url|
7575
url = nil if category == 'Conversation'
76-
url.present? ? "<a href=\"#{url}\">#{h(name)}</a>" : h(name)
76+
url.present? ? "<a href=\"#{url}\" aria-label=\"#{accessibility_category_label(category)}\">#{h(name)}</a>" : h(name)
7777
end.to_sentence.html_safe
7878
end
7979

80+
def accessibility_category_label(category)
81+
case category
82+
when "Announcement"
83+
return I18n.t('helpers.dashboard_helper.announcement_label', "Visit Course Announcements")
84+
when "Conversation"
85+
return I18n.t('helpers.dashboard_helper.conversation_label', "Visit Conversations")
86+
when "Assignment"
87+
return I18n.t('helpers.dashboard_helper.assignment_label', "Visit Course Assignments")
88+
when "DiscussionTopic"
89+
return I18n.t('helpers.dashboard_helper.discussion_label', "Visit Course Discussions")
90+
when "AssessmentRequest"
91+
return I18n.t('helpers.dashboard_helper.peer_review_label', "Visit Course Peer Reviews")
92+
else
93+
raise "Unknown activity category"
94+
end
95+
end
96+
8097
def category_details_label(category)
8198
case category
8299
when "Announcement"

app/stylesheets/pages/dashboard/_dashboard_activity.sass

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,10 @@ $ignore-col-width: 50px
6262

6363
.toggle-details
6464
display: block
65-
text-align: left
66-
text-indent: -9999px
65+
text-align: right
66+
text-indent: 0
6767
&:hover
6868
text-decoration: none
69-
&:focus
70-
text-indent: 0
71-
text-align: right
7269

7370
.details_container
7471
display: none
@@ -82,9 +79,6 @@ $ignore-col-width: 50px
8279
line-height: 250%
8380
&:hover
8481
background: $hover-color
85-
.ignore-item
86-
text-align: center
87-
text-indent: 0
8882

8983
.date
9084
font-size: 11px
@@ -98,11 +92,8 @@ $ignore-col-width: 50px
9892
.ignore-item
9993
float: none
10094
display: block
101-
text-align: left
102-
text-indent: -9999px
103-
&:focus
104-
text-indent: 0
105-
text-align: center
95+
text-align: center
96+
text-indent: 0
10697

10798
.content_summary
10899
display: block

0 commit comments

Comments
 (0)