Skip to content

Commit 34845d4

Browse files
committed
fix: a11y: unmark "Chats" section header as <nav>
The "Chats" and the "Messages" sections headers used to be one single element, then it has been split into two in 66c96d7 (#4672). But then it started to make even less sense for it to be a <nav>. It basically consists of only two elements, so it's probably not worth having a separate landmark for it. Let's turn it into a generic <section> with no label.
1 parent 0a1172a commit 34845d4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/frontend/src/components/screens/MainScreen/MainScreen.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ export default function MainScreen({ accountId }: Props) {
230230
!messageSectionShouldBeHidden ? 'chat-view-open' : ''
231231
}`}
232232
>
233-
<section className={styles.chatListAndNavbar}>
234-
<nav className={styles.chatListNavbar} data-tauri-drag-region>
233+
<section className={styles.chatListAndHeader}>
234+
<section className={styles.chatListHeader} data-tauri-drag-region>
235235
{showArchivedChats && (
236236
<>
237237
<span data-no-drag-region>
@@ -258,7 +258,7 @@ export default function MainScreen({ accountId }: Props) {
258258
value={queryStr}
259259
/>
260260
)}
261-
</nav>
261+
</section>
262262
<ChatList
263263
queryStr={queryStr}
264264
showArchivedChats={showArchivedChats}

packages/frontend/src/components/screens/MainScreen/styles.module.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FYI there is also `_main_screen.scss`.
44

55
:global(.main-screen.small-screen.chat-view-open) {
6-
.chatListAndNavbar {
6+
.chatListAndHeader {
77
display: none;
88
}
99
}
@@ -23,7 +23,7 @@
2323
flex-shrink: 0;
2424
}
2525

26-
.chatListAndNavbar {
26+
.chatListAndHeader {
2727
display: flex;
2828
flex-direction: column;
2929

@@ -33,7 +33,7 @@
3333

3434
min-width: 295px;
3535

36-
.chatListNavbar {
36+
.chatListHeader {
3737
@include navbar;
3838
display: flex;
3939
align-items: center;
@@ -53,7 +53,7 @@
5353
// Otherwise e.g. the contents of the gallery view
5454
// (tabs, sepcifically) will refuse to shrink,
5555
// and this element (`.chatAndNavbar`) will overflow the parent.
56-
// Also this ensures that `.chatListAndNavbar` and `.chatAndNavbar`
56+
// Also this ensures that `.chatListAndHeader` and `.chatAndNavbar`
5757
// take respectively 3 and 8 parts of the width of the parent
5858
// on wide screens.
5959
width: 0;

0 commit comments

Comments
 (0)