File tree Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ test.beforeAll(async ({ browser }) => {
50
50
page = await browser . newPage ( )
51
51
await reloadPage ( page )
52
52
53
- chatList = page . getByRole ( 'tablist' , { name : 'Chats' } )
53
+ chatList = page . getByLabel ( 'Chats' ) . getByRole ( 'tablist' )
54
54
selectedChats = chatList . getByRole ( 'tab' , { selected : true } )
55
55
// Let's stop at 9, so that we don't accidentally select "Chat 10"
56
56
// by providing the selector "Chat 1".
Original file line number Diff line number Diff line change @@ -495,16 +495,11 @@ export default function ChatList(props: {
495
495
'aria-orientation' : 'vertical' ,
496
496
'aria-multiselectable' : multiselect != undefined ,
497
497
498
- // TODO perhaps `pref_` is not nice,
499
- // we might need a separate string.
500
- // The same goes for other occurrences
501
- // of `tx('pref_chats')`.
502
498
'aria-labelledby' : isSearchActive
503
499
? 'search-result-divider-chats'
504
500
: undefined ,
505
- 'aria-label' : ! isSearchActive
506
- ? tx ( 'pref_chats' )
507
- : undefined ,
501
+ // When `!isSearchActive`, the wrapper `<section>` label
502
+ // is enough.
508
503
} }
509
504
isRowLoaded = { isChatLoaded }
510
505
loadMoreRows = { loadChats }
Original file line number Diff line number Diff line change @@ -230,7 +230,22 @@ export default function MainScreen({ accountId }: Props) {
230
230
! messageSectionShouldBeHidden ? 'chat-view-open' : ''
231
231
} `}
232
232
>
233
- < section className = { styles . chatListAndHeader } >
233
+ < section
234
+ className = { styles . chatListAndHeader }
235
+ role = 'region'
236
+ // TODO a11y: reconsider whether it's OK to use the "Chats" label
237
+ // even when we're searching for messages in one particular chat
238
+ // (`queryChatId`), and even despite the fact
239
+ // that search results, besides chats,
240
+ // also include messages and contacts.
241
+ // For the former, perhaps one could argue that `queryChatId`
242
+ // is just a part of the search query.
243
+ //
244
+ // TODO a11y: perhaps `pref_` is not nice, we might need
245
+ // a separate string.
246
+ // The same goes for other occurrences of `tx('pref_chats')`.
247
+ aria-label = { tx ( 'pref_chats' ) }
248
+ >
234
249
< section className = { styles . chatListHeader } data-tauri-drag-region >
235
250
{ showArchivedChats && (
236
251
< >
You can’t perform that action at this time.
0 commit comments