File tree Expand file tree Collapse file tree 4 files changed +49
-8
lines changed Expand file tree Collapse file tree 4 files changed +49
-8
lines changed Original file line number Diff line number Diff line change @@ -284,3 +284,22 @@ audio {
284
284
p .whitespace {
285
285
white-space : break- spaces;
286
286
}
287
+
288
+ // Only for screen-readers.
289
+ // Taken from
290
+ // https://github.com/twbs/bootstrap/blob/4c98145482719f5113ca31e389a7be07c5404e13/scss/mixins/_visually-hidden.scss#L3-L22
291
+ .visually-hidden {
292
+ width : 1px !important ;
293
+ height : 1px !important ;
294
+ padding : 0 !important ;
295
+ margin : -1px !important ; // Fix for https://github.com/twbs/bootstrap/issues/25686
296
+ overflow : hidden !important ;
297
+ clip : rect (0 , 0 , 0 , 0 ) !important ;
298
+ white-space : nowrap !important ;
299
+ border : 0 !important ;
300
+
301
+ // Fix for positioned table caption that could become anonymous cells
302
+ & :not (caption ) {
303
+ position : absolute !important ;
304
+ }
305
+ }
Original file line number Diff line number Diff line change @@ -503,13 +503,13 @@ const Composer = forwardRef<
503
503
// TODO a11y: when `isEditingModeActive`, we have an "Edit message"
504
504
// text, which we can use as the label / header.
505
505
aria-label = {
506
- ( messageEditing . isEditingModeActive
506
+ messageEditing . isEditingModeActive
507
507
? window . static_translate ( 'edit_message' )
508
- : window . static_translate ( 'write_message_desktop' ) ) +
509
- // Make it clear which chat we're in.
510
- // TODO probably need a proper string, with interpolation.
511
- ': ' +
512
- selectedChat . name
508
+ : window . static_translate ( 'write_message_desktop' )
509
+ // We could also add chat name here to make it extra clear
510
+ // which chat we're in,
511
+ // but the "Chat" region label
512
+ // (`id='chat-section-heading'`) is probably enough.
513
513
}
514
514
>
515
515
< div className = 'upper-bar' >
Original file line number Diff line number Diff line change @@ -286,7 +286,11 @@ export default function MainScreen({ accountId }: Props) {
286
286
} }
287
287
/>
288
288
</ section >
289
- < section className = { styles . chatAndNavbar } >
289
+ < section
290
+ role = 'region'
291
+ aria-labelledby = 'chat-section-heading'
292
+ className = { styles . chatAndNavbar }
293
+ >
290
294
< nav className = { styles . chatNavbar } data-tauri-drag-region >
291
295
{ smallScreenMode && (
292
296
< span data-no-drag-region >
@@ -468,7 +472,13 @@ function ChatHeading({ chat }: { chat: T.FullChat }) {
468
472
/>
469
473
< div style = { { marginInlineStart : '7px' , overflow : 'hidden' } } >
470
474
< div className = 'navbar-chat-name' >
471
- < div className = 'truncated' > { chat . name } </ div >
475
+ < h2 id = 'chat-section-heading' className = 'truncated' >
476
+ { chat . name }
477
+ < span className = 'visually-hidden' >
478
+ < br />
479
+ { tx ( 'chat' ) }
480
+ </ span >
481
+ </ h2 >
472
482
< div className = 'chat_property_icons' >
473
483
{ chat . ephemeralTimer !== 0 && (
474
484
< div
Original file line number Diff line number Diff line change 91
91
font-size : 18px ;
92
92
font-weight : bold ;
93
93
overflow : hidden ;
94
+
95
+ h1 ,
96
+ h2 ,
97
+ h3 ,
98
+ h4 ,
99
+ h5 ,
100
+ h6 {
101
+ font-size : inherit ;
102
+ font-weight : inherit ;
103
+ display : block ;
104
+ margin : 0 ;
105
+ }
94
106
}
95
107
:global (.navbar-heading-chat-info-button ) {
96
108
// Fill the parent, overlay the siblings.
You can’t perform that action at this time.
0 commit comments