Skip to content

Commit 6c2b1d9

Browse files
committed
Slack: Report incoming messages in an open thread automatically. Reorder an indicator in the threads view to match visual order.
1 parent 6681986 commit 6c2b1d9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

SlackA11yFixes.user.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function initial() {
1818
elem.setAttribute("aria-owns", "messages_container footer");
1919
// Same for the unread messages status, which appears below in DOM order but earlier visually.
2020
if (elem = document.querySelector("#messages_container"))
21-
elem.setAttribute("aria-owns", "messages_unread_status monkey_scroll_wrapper_for_msgs_scroller_div");
21+
elem.setAttribute("aria-owns", "messages_unread_status threads_view_banner monkey_scroll_wrapper_for_msgs_scroller_div monkey_scroll_wrapper_for_threads_msgs_scroller_div");
2222
// Make close link for about channel pane accessible.
2323
for (elem of document.querySelectorAll(".close_flexpane")) {
2424
elem.setAttribute("role", "button");
@@ -51,7 +51,7 @@ function onNodeAdded(target) {
5151
return;
5252
}
5353
// Report incoming messages and make them list items.
54-
if (target.matches("#msgs_div .message") && !target.classList.contains("unprocessed")) {
54+
if (target.matches("#msgs_div .message:last-child, #threads_msgs .message:last-child, #convo_container .message:last-child") && !target.classList.contains("unprocessed")) {
5555
// Just shove text into a live region that's already used for stuff like this.
5656
// It'd better/less hacky if the messages area itself were a live region,
5757
// but doing this results in double/triple speaking for some reason.
@@ -62,8 +62,8 @@ function onNodeAdded(target) {
6262
target.setAttribute("role", "listitem");
6363
}
6464
var elem;
65-
// Make existing messages lit items.
66-
for (elem of target.querySelectorAll("#msgs_div .message"))
65+
// Make existing messages list items.
66+
for (elem of target.querySelectorAll("#msgs_div .message, #threads_msgs .message, #convo_container .message"))
6767
elem.setAttribute("role", "listitem");
6868
for (elem of target.querySelectorAll(".copy_only")) {
6969
// This includes text such as the brackets around message times.

0 commit comments

Comments
 (0)