Merge pull request #183038 from microsoft/merogge/notebook-verbosity

add notebook verbosity setting
This commit is contained in:
Megan Rogge 2023-05-26 17:15:37 -05:00 committed by GitHub
commit 9473a2928e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 5 deletions

View file

@ -12,7 +12,8 @@ export const enum AccessibilityVerbositySettingId {
DiffEditor = 'accessibility.verbosity.diff-editor',
Chat = 'accessibility.verbosity.chat',
InteractiveEditor = 'accessibility.verbosity.interactiveEditor',
KeybindingsEditor = 'accessibility.verbosity.keybindingsEditor'
KeybindingsEditor = 'accessibility.verbosity.keybindingsEditor',
Notebook = 'accessibility.verbosity.notebook'
}
const configuration: IConfigurationNode = {
@ -49,6 +50,12 @@ const configuration: IConfigurationNode = {
type: 'boolean',
default: true,
tags: ['accessibility']
},
[AccessibilityVerbositySettingId.Notebook]: {
description: localize('verbosity.notebook', 'Provide information about how to focus the cell container or inner editor when a notebook cell is focused.'),
type: 'boolean',
default: true,
tags: ['accessibility']
}
}
};

View file

@ -91,6 +91,7 @@ import { INotebookLoggingService } from 'vs/workbench/contrib/notebook/common/no
import { Schemas } from 'vs/base/common/network';
import { DropIntoEditorController } from 'vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController';
import { CopyPasteController } from 'vs/editor/contrib/dropOrPasteInto/browser/copyPasteController';
import { AccessibilityVerbositySettingId } from 'vs/workbench/contrib/accessibility/browser/accessibilityContribution';
const $ = DOM.$;
@ -2229,18 +2230,18 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
private _cellFocusAria(cell: ICellViewModel, focusItem: 'editor' | 'container' | 'output') {
const index = this._notebookViewModel?.getCellIndex(cell);
const verboseLabel = this.configurationService.getValue(AccessibilityVerbositySettingId.Notebook);
if (index !== undefined && index >= 0) {
let position = '';
switch (focusItem) {
case 'editor':
position = `the inner ${cell.cellKind === CellKind.Markup ? 'markdown' : 'code'} editor is focused, press escape to focus the cell container`;
position = `the inner ${cell.cellKind === CellKind.Markup ? 'markdown' : 'code'} editor is focused` + (verboseLabel ? `, press escape to focus the cell container` : '');
break;
case 'output':
position = `the cell output is focused, press escape to focus the cell container`;
position = `the cell output is focused` + (verboseLabel ? `, press escape to focus the cell container` : '');
break;
case 'container':
position = `the ${cell.cellKind === CellKind.Markup ? 'markdown preview' : 'cell container'} is focused, press enter to focus the inner ${cell.cellKind === CellKind.Markup ? 'markdown' : 'code'} editor`;
position = `the ${cell.cellKind === CellKind.Markup ? 'markdown preview' : 'cell container'} is focused` + (verboseLabel ? `, press enter to focus the inner ${cell.cellKind === CellKind.Markup ? 'markdown' : 'code'} editor` : '');
break;
default:
break;