From a05013c8f43f91cda80e2b6d764878c39127fe90 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Fri, 28 Mar 2025 20:06:11 +0000 Subject: [PATCH] fix AiChatButton --- src/public/app/components/root_command_executor.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/public/app/components/root_command_executor.ts b/src/public/app/components/root_command_executor.ts index b4e6ed3c0..1e16fae81 100644 --- a/src/public/app/components/root_command_executor.ts +++ b/src/public/app/components/root_command_executor.ts @@ -232,15 +232,10 @@ export default class RootCommandExecutor extends Component { async createAiChatCommand() { try { - // Create a new AI Chat note - const parentNoteId = appContext.tabManager.getActiveContextNotePath(); + // Create a new AI Chat note at the root level + const rootNoteId = "root"; - if (!parentNoteId) { - toastService.showError("No active note to create AI Chat under"); - return; - } - - const result = await noteCreateService.createNote(parentNoteId, { + const result = await noteCreateService.createNote(rootNoteId, { title: "New AI Chat", type: "aiChat", content: JSON.stringify({