mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
Merge pull request #183038 from microsoft/merogge/notebook-verbosity
add notebook verbosity setting
This commit is contained in:
commit
9473a2928e
|
@ -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']
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue