diff --git a/src/sql/workbench/contrib/notebook/browser/cellViews/code.component.html b/src/sql/workbench/contrib/notebook/browser/cellViews/code.component.html index 4014dc4f20..f0dc24c339 100644 --- a/src/sql/workbench/contrib/notebook/browser/cellViews/code.component.html +++ b/src/sql/workbench/contrib/notebook/browser/cellViews/code.component.html @@ -5,12 +5,14 @@ *--------------------------------------------------------------------------------------------*/ -->
-
-
-
+
+
+
+
+
+
+
-
-
diff --git a/src/sql/workbench/contrib/notebook/browser/notebook.component.html b/src/sql/workbench/contrib/notebook/browser/notebook.component.html index 2af92efc31..bd3626aa07 100644 --- a/src/sql/workbench/contrib/notebook/browser/notebook.component.html +++ b/src/sql/workbench/contrib/notebook/browser/notebook.component.html @@ -21,12 +21,7 @@
-
+
diff --git a/src/sql/workbench/contrib/notebook/browser/notebook.contribution.ts b/src/sql/workbench/contrib/notebook/browser/notebook.contribution.ts index 35bcda5580..27f536b00a 100644 --- a/src/sql/workbench/contrib/notebook/browser/notebook.contribution.ts +++ b/src/sql/workbench/contrib/notebook/browser/notebook.contribution.ts @@ -7,7 +7,7 @@ import { EditorDescriptor, IEditorRegistry, Extensions as EditorExtensions } fro import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { localize } from 'vs/nls'; -import { IEditorInputFactoryRegistry, Extensions as EditorInputFactoryExtensions } from 'vs/workbench/common/editor'; +import { IEditorInputFactoryRegistry, Extensions as EditorInputFactoryExtensions, ActiveEditorContext } from 'vs/workbench/common/editor'; import { ILanguageAssociationRegistry, Extensions as LanguageAssociationExtensions } from 'sql/workbench/services/languageAssociation/common/languageAssociation'; import { UntitledNotebookInput } from 'sql/workbench/contrib/notebook/browser/models/untitledNotebookInput'; @@ -45,6 +45,7 @@ import { TextCellComponent } from 'sql/workbench/contrib/notebook/browser/cellVi import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { NotebookThemingContribution } from 'sql/workbench/contrib/notebook/browser/notebookThemingContribution'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; +import { ToggleTabFocusModeAction } from 'vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode'; Registry.as(EditorInputFactoryExtensions.EditorInputFactories) .registerEditorInputFactory(FileNotebookInput.ID, FileNoteBookEditorInputFactory); @@ -135,6 +136,25 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerWidgetContext, { order: 1 }); +const TOGGLE_TAB_FOCUS_COMMAND_ID = 'notebook.action.toggleTabFocusMode'; +const toggleTabFocusAction = new ToggleTabFocusModeAction(); + +CommandsRegistry.registerCommand({ + id: TOGGLE_TAB_FOCUS_COMMAND_ID, + handler: (accessor) => { + toggleTabFocusAction.run(accessor, undefined); + } +}); + + +MenuRegistry.appendMenuItem(MenuId.CommandPalette, { + command: { + id: TOGGLE_TAB_FOCUS_COMMAND_ID, + title: toggleTabFocusAction.label, + }, + when: ContextKeyExpr.and(ActiveEditorContext.isEqualTo(NotebookEditor.ID)) +}); + registerAction2(class extends Action2 { constructor() { super({ diff --git a/src/sql/workbench/services/notebook/browser/models/cell.ts b/src/sql/workbench/services/notebook/browser/models/cell.ts index e3cd0e7122..44fc2e4ffa 100644 --- a/src/sql/workbench/services/notebook/browser/models/cell.ts +++ b/src/sql/workbench/services/notebook/browser/models/cell.ts @@ -56,10 +56,6 @@ export class CellModel implements ICellModel { private _isCollapsed: boolean; private _onCollapseStateChanged = new Emitter(); private _modelContentChangedEvent: IModelContentChangedEvent; - private readonly _ariaLabel: string; - - private readonly codeCellLabel = localize('codeCellLabel', "Code Cell"); - private readonly textCellLabel = localize('textCellLabel', "Text Cell"); constructor(cellData: nb.ICellContents, private _options: ICellModelOptions, @@ -74,12 +70,6 @@ export class CellModel implements ICellModel { this._source = ''; } - if (this._cellType === CellTypes.Code) { - this._ariaLabel = this.codeCellLabel; - } else { - this._ariaLabel = this.textCellLabel; - } - this._isEditMode = this._cellType !== CellTypes.Markdown; this._stdInVisible = false; if (_options && _options.isTrusted) { @@ -96,10 +86,6 @@ export class CellModel implements ICellModel { return other !== undefined && other.id === this.id; } - public get ariaLabel(): string { - return this._ariaLabel; - } - public get onCollapseStateChanged(): Event { return this._onCollapseStateChanged.event; } diff --git a/src/sql/workbench/services/notebook/browser/models/modelInterfaces.ts b/src/sql/workbench/services/notebook/browser/models/modelInterfaces.ts index a778f9bd82..f9b7ce76dd 100644 --- a/src/sql/workbench/services/notebook/browser/models/modelInterfaces.ts +++ b/src/sql/workbench/services/notebook/browser/models/modelInterfaces.ts @@ -487,7 +487,6 @@ export interface ICellModel { readonly onCellModeChanged: Event; modelContentChangedEvent: IModelContentChangedEvent; isEditMode: boolean; - readonly ariaLabel: string; } export interface IModelFactory { diff --git a/src/vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode.ts b/src/vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode.ts index 3498ee790e..3674d1bc39 100644 --- a/src/vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode.ts +++ b/src/vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode.ts @@ -23,7 +23,7 @@ export class ToggleTabFocusModeAction extends EditorAction { precondition: undefined, kbOpts: { kbExpr: null, - primary: KeyMod.CtrlCmd | KeyCode.KEY_M, + primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_M, // {{SQL CARBON EDIT}} We use Ctrl+M already so move this to an unused binding mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KEY_M }, weight: KeybindingWeight.EditorContrib }