From b88306f414a3f7c9ad7f159993a4cf8317890c48 Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Fri, 27 Mar 2026 17:46:20 +0100 Subject: [PATCH] feat: open new thread when activating note-as-context command Co-Authored-By: Claude Sonnet 4.6 --- main.js | 1 + src/ChatView.ts | 2 +- src/main.ts | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index cb6872d..1262274 100644 --- a/main.js +++ b/main.js @@ -33305,6 +33305,7 @@ var MemexChatPlugin = class extends import_obsidian5.Plugin { const leaf = this.app.workspace.getLeavesOfType(VIEW_TYPE_MEMEX_CHAT)[0]; if (leaf) { const view = leaf.view; + view.newThread(); view.setInputValue(`Erkl\xE4re und verkn\xFCpfe [[${file.basename}]] mit anderen Konzepten im Vault.`); view.setExplicitContext([file]); } diff --git a/src/ChatView.ts b/src/ChatView.ts index f90cb2e..0a2b57e 100644 --- a/src/ChatView.ts +++ b/src/ChatView.ts @@ -215,7 +215,7 @@ export class ChatView extends ItemView { // ─── Thread Management ──────────────────────────────────────────────────── - private newThread(): void { + newThread(): void { const thread: Thread = { id: Date.now().toString(), title: "Neuer Chat", diff --git a/src/main.ts b/src/main.ts index ad2c189..adcfea5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -85,6 +85,7 @@ export default class MemexChatPlugin extends Plugin { const leaf = this.app.workspace.getLeavesOfType(VIEW_TYPE_MEMEX_CHAT)[0]; if (leaf) { const view = leaf.view as ChatView; + view.newThread(); view.setInputValue(`Erkläre und verknüpfe [[${file.basename}]] mit anderen Konzepten im Vault.`); view.setExplicitContext([file]); }