From 5701f9fc8c85f6bc95d88e0aa260c4e3c2d568cb Mon Sep 17 00:00:00 2001 From: Jeewon Koo Date: Tue, 3 May 2022 02:46:23 -0500 Subject: [PATCH] add the show header command to the command palette --- packages/application-extension/src/index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/application-extension/src/index.ts b/packages/application-extension/src/index.ts index fcdb11ad0e..244faf44fe 100644 --- a/packages/application-extension/src/index.ts +++ b/packages/application-extension/src/index.ts @@ -481,12 +481,13 @@ const title: JupyterFrontEndPlugin = { const topVisibility: JupyterFrontEndPlugin = { id: '@jupyter-notebook/application-extension:top', requires: [INotebookShell, ITranslator], - optional: [ISettingRegistry], + optional: [ISettingRegistry, ICommandPalette], activate: ( app: JupyterFrontEnd, notebookShell: INotebookShell, translator: ITranslator, - settingRegistry: ISettingRegistry | null + settingRegistry: ISettingRegistry | null, + palette: ICommandPalette | null ) => { const trans = translator.load('notebook'); const top = notebookShell.top; @@ -527,6 +528,10 @@ const topVisibility: JupyterFrontEndPlugin = { }); } + if (palette) { + palette.addItem({ command: CommandIDs.toggleTop, category: 'View' }); + } + const onChanged = (): void => { if (settingsOverride) { return;