From 11d086ef12a4cdbfbd058affca0bf150e0ef2aa3 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 30 Jul 2025 22:39:37 +0300 Subject: [PATCH] fix(command_palette): text editor-based issues not working --- apps/client/src/services/command_registry.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/client/src/services/command_registry.ts b/apps/client/src/services/command_registry.ts index a8721e43f..e3ffb36a4 100644 --- a/apps/client/src/services/command_registry.ts +++ b/apps/client/src/services/command_registry.ts @@ -244,6 +244,8 @@ class CommandRegistry { if (command.keyboardAction && command.commandName) { if (command.keyboardAction.scope === "note-tree") { this.executeWithNoteTreeFocus(command.commandName); + } else if (command.keyboardAction.scope === "text-detail") { + this.executeWithTextDetail(command.commandName); } else { appContext.triggerCommand(command.commandName); } @@ -272,6 +274,17 @@ class CommandRegistry { node: activeNode }); } + + private async executeWithTextDetail(actionName: CommandNames) { + const typeWidget = await appContext.tabManager.getActiveContext()?.getTypeWidget(); + if (!typeWidget) { + return; + } + + typeWidget.triggerCommand(actionName, { + ntxId: appContext.tabManager.activeNtxId + }); + } } const commandRegistry = new CommandRegistry();