Skip to content

Commit 9473a29

Browse files
authored
Merge pull request microsoft#183038 from microsoft/merogge/notebook-verbosity
add notebook verbosity setting
2 parents 7fcfb2f + 39f618b commit 9473a29

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/vs/workbench/contrib/accessibility/browser/accessibilityContribution.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export const enum AccessibilityVerbositySettingId {
1212
DiffEditor = 'accessibility.verbosity.diff-editor',
1313
Chat = 'accessibility.verbosity.chat',
1414
InteractiveEditor = 'accessibility.verbosity.interactiveEditor',
15-
KeybindingsEditor = 'accessibility.verbosity.keybindingsEditor'
15+
KeybindingsEditor = 'accessibility.verbosity.keybindingsEditor',
16+
Notebook = 'accessibility.verbosity.notebook'
1617
}
1718

1819
const configuration: IConfigurationNode = {
@@ -49,6 +50,12 @@ const configuration: IConfigurationNode = {
4950
type: 'boolean',
5051
default: true,
5152
tags: ['accessibility']
53+
},
54+
[AccessibilityVerbositySettingId.Notebook]: {
55+
description: localize('verbosity.notebook', 'Provide information about how to focus the cell container or inner editor when a notebook cell is focused.'),
56+
type: 'boolean',
57+
default: true,
58+
tags: ['accessibility']
5259
}
5360
}
5461
};

src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ import { INotebookLoggingService } from 'vs/workbench/contrib/notebook/common/no
9191
import { Schemas } from 'vs/base/common/network';
9292
import { DropIntoEditorController } from 'vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController';
9393
import { CopyPasteController } from 'vs/editor/contrib/dropOrPasteInto/browser/copyPasteController';
94+
import { AccessibilityVerbositySettingId } from 'vs/workbench/contrib/accessibility/browser/accessibilityContribution';
9495

9596
const $ = DOM.$;
9697

@@ -2229,18 +2230,18 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
22292230

22302231
private _cellFocusAria(cell: ICellViewModel, focusItem: 'editor' | 'container' | 'output') {
22312232
const index = this._notebookViewModel?.getCellIndex(cell);
2232-
2233+
const verboseLabel = this.configurationService.getValue(AccessibilityVerbositySettingId.Notebook);
22332234
if (index !== undefined && index >= 0) {
22342235
let position = '';
22352236
switch (focusItem) {
22362237
case 'editor':
2237-
position = `the inner ${cell.cellKind === CellKind.Markup ? 'markdown' : 'code'} editor is focused, press escape to focus the cell container`;
2238+
position = `the inner ${cell.cellKind === CellKind.Markup ? 'markdown' : 'code'} editor is focused` + (verboseLabel ? `, press escape to focus the cell container` : '');
22382239
break;
22392240
case 'output':
2240-
position = `the cell output is focused, press escape to focus the cell container`;
2241+
position = `the cell output is focused` + (verboseLabel ? `, press escape to focus the cell container` : '');
22412242
break;
22422243
case 'container':
2243-
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`;
2244+
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` : '');
22442245
break;
22452246
default:
22462247
break;

0 commit comments

Comments
 (0)