From 467c3706ae2784c3132a9d205a971ca5f9ea20ea Mon Sep 17 00:00:00 2001 From: marinatrajk Date: Wed, 18 Feb 2026 20:27:19 -0500 Subject: [PATCH] fix: use direct panel selection for document editor to prevent toggle-close Address review feedback on PR #4512 (#4639 follow-up): - Replace windowState.togglePanel(.documentEditor) with windowState.selection = .panel(.documentEditor) in handleDocumentEditorShow and handleDocumentLoadResponse to avoid accidentally closing the editor panel when a second document_editor_show or document_load_response message arrives while the panel is already open (e.g. when multiple document preview widgets are present in chat and the user clicks one whose document is already loaded) Co-Authored-By: Claude --- .../vellum-assistant/Features/MainWindow/MainWindow.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/macos/vellum-assistant/Features/MainWindow/MainWindow.swift b/clients/macos/vellum-assistant/Features/MainWindow/MainWindow.swift index 38e1c188296..906f9972ce2 100644 --- a/clients/macos/vellum-assistant/Features/MainWindow/MainWindow.swift +++ b/clients/macos/vellum-assistant/Features/MainWindow/MainWindow.swift @@ -168,7 +168,7 @@ final class MainWindow { initialContent: msg.initialContent ) show() - windowState.togglePanel(.documentEditor) + windowState.selection = .panel(.documentEditor) } func handleDocumentEditorUpdate(_ msg: DocumentEditorUpdateMessage) { @@ -189,7 +189,7 @@ final class MainWindow { initialContent: content ) show() - windowState.togglePanel(.documentEditor) + windowState.selection = .panel(.documentEditor) } func show() {