From 4b7771e703752fa785aedc8a0da0888614e91cad Mon Sep 17 00:00:00 2001 From: Guilhem Lemouel Date: Fri, 18 Sep 2026 18:08:08 +0200 Subject: [PATCH] fix: keep a chat pane mounted while its composer reads attachments Co-Authored-By: Claude Opus 5 (1M context) --- .../src/lib/components/copilot/chat/AIChatInput.svelte | 9 ++++++++- .../lib/components/copilot/chat/AIChatManager.svelte.ts | 6 +----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/frontend/src/lib/components/copilot/chat/AIChatInput.svelte b/frontend/src/lib/components/copilot/chat/AIChatInput.svelte index 32c0658d3f..9e1e54ee48 100644 --- a/frontend/src/lib/components/copilot/chat/AIChatInput.svelte +++ b/frontend/src/lib/components/copilot/chat/AIChatInput.svelte @@ -378,7 +378,14 @@ ) $effect(() => { chatHost.setComposerStaged(composerKey, editingMessageIndex, stagedBytes) - chatHost.setComposerHasDraft(composerKey, !draft.isEmpty || pendingFileBytes > 0) + chatHost.setComposerHasDraft( + composerKey, + !draft.isEmpty || + pendingFileBytes > 0 || + pendingImages > 0 || + pendingBlobs > 0 || + ingestionHolds > 0 + ) }) $effect(() => () => chatHost.clearComposerStaged(composerKey)) diff --git a/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts b/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts index 8ad45466b1..abed211c74 100644 --- a/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts +++ b/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts @@ -2838,11 +2838,7 @@ export class AIChatManager implements ChatViewHost { * queued message (whose text may be empty when it carries only attachments * or context). */ get hasUnsentInput(): boolean { - return ( - this.#composersWithDraft.size > 0 || - !this.#queuedDraft.isEmpty || - this.queuedContext !== undefined - ) + return this.#composersWithDraft.size > 0 || this.#hasQueuedMessage() } /** Release the outgoing-files reservation identified by `key` (a per-send token).