@@ -77,6 +77,7 @@ export default class StatusView implements vscode.Disposable {
77
77
bar . statusLanguageFlavor = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Right , 90 ) ;
78
78
bar . statusConnection = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Right ) ;
79
79
bar . statusQuery = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Right ) ;
80
+ bar . statusQuery . accessibilityInformation = { role : 'alert' , label : '' } ;
80
81
bar . statusLanguageService = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Right ) ;
81
82
bar . sqlCmdMode = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Right , 90 ) ;
82
83
bar . rowCount = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Right , 80 ) ;
@@ -182,22 +183,26 @@ export default class StatusView implements vscode.Disposable {
182
183
public executingQuery ( fileUri : string ) : void {
183
184
let bar = this . getStatusBar ( fileUri ) ;
184
185
bar . statusQuery . command = undefined ;
185
- bar . statusQuery . tooltip = LocalizedConstants . executeQueryLabel ;
186
+ bar . statusQuery . text = LocalizedConstants . executeQueryLabel ;
186
187
this . showStatusBarItem ( fileUri , bar . statusQuery ) ;
187
188
this . showProgress ( fileUri , LocalizedConstants . executeQueryLabel , bar . statusQuery ) ;
188
189
}
189
190
190
191
public executedQuery ( fileUri : string ) : void {
191
192
let bar = this . getStatusBar ( fileUri ) ;
192
- bar . statusQuery . hide ( ) ;
193
+ bar . statusQuery . text = LocalizedConstants . QueryExecutedLabel ;
194
+ // hide the status bar item with a delay so that the change can be announced by screen reader.
195
+ setTimeout ( ( ) => {
196
+ bar . statusQuery . hide ( ) ;
197
+ } , 200 ) ;
193
198
}
194
199
195
200
public cancelingQuery ( fileUri : string ) : void {
196
201
let bar = this . getStatusBar ( fileUri ) ;
197
202
bar . statusQuery . hide ( ) ;
198
203
199
204
bar . statusQuery . command = undefined ;
200
- bar . statusQuery . tooltip = LocalizedConstants . cancelingQueryLabel ;
205
+ bar . statusQuery . text = LocalizedConstants . cancelingQueryLabel ;
201
206
this . showStatusBarItem ( fileUri , bar . statusQuery ) ;
202
207
this . showProgress ( fileUri , LocalizedConstants . cancelingQueryLabel , bar . statusQuery ) ;
203
208
}
@@ -337,6 +342,11 @@ export default class StatusView implements vscode.Disposable {
337
342
}
338
343
339
344
private showProgress ( fileUri : string , statusText : string , statusBarItem : vscode . StatusBarItem ) : void {
345
+ // Do not use the text based in progress indicator when screen reader is on, it is not user friendly to announce the changes every 200 ms.
346
+ const screenReaderOptimized = vscode . workspace . getConfiguration ( 'editor' ) . get ( 'accessibilitySupport' ) ;
347
+ if ( screenReaderOptimized === 'on' ) {
348
+ return ;
349
+ }
340
350
const self = this ;
341
351
let index = 0 ;
342
352
let progressTicks = [ '|' , '/' , '-' , '\\' ] ;
0 commit comments