Have screen reader announce when cell execution is complete (#19249)

* add tab index to cell output

* add sr-only element to announce cell exe complete

* use onExecutionComplete event

* remove extra change

* simplify alert message

* add alert for cell execution start
This commit is contained in:
Lucy Zhang
2022-05-04 10:44:24 -07:00
committed by GitHub
parent 2547754d0f
commit 4d8fdf5833

View File

@@ -35,6 +35,7 @@ import { CellOutputEdit, CellOutputDataEdit } from 'sql/workbench/services/noteb
import { ILogService } from 'vs/platform/log/common/log';
import { IModeService } from 'vs/editor/common/services/modeService';
import { ICellMetadata } from 'sql/workbench/api/common/sqlExtHostTypes';
import { alert } from 'vs/base/browser/ui/aria/aria';
import { CELL_URI_PATH_PREFIX } from 'sql/workbench/common/constants';
let modelId = 0;
@@ -606,6 +607,8 @@ export class CellModel extends Disposable implements ICellModel {
public async runCell(notificationService?: INotificationService, connectionManagementService?: IConnectionManagementService): Promise<boolean> {
try {
// Allow screen reader to announce when cell execution is started
alert(localize('cellExecutionStarted', "Cell execution started"));
if (!this.active && this !== this.notebookModel.activeCell) {
this.notebookModel.updateActiveCell(this);
this.active = true;
@@ -714,6 +717,8 @@ export class CellModel extends Disposable implements ICellModel {
// Serialize cell output once the cell is done executing
this.sendChangeToNotebook(NotebookChangeType.CellOutputUpdated);
this.notifyExecutionComplete();
// Allow screen reader to announce when a cell is done running
alert(localize('cellExecutionComplete', "Cell execution is complete"));
}
return true;