From ce2c3bf87e17c8539fe029944fdb7452b8040ba3 Mon Sep 17 00:00:00 2001 From: Keerthana Panyam Date: Mon, 7 Jul 2025 13:45:06 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20prevent=20UI=20freeze=20when=20=E2=8C=98?= =?UTF-8?q?I=20pressed=20without=20active=20editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pressing ⌘I in chat mode to switch to edit mode when no editor is focused previously led to an unrecoverable error state in the secondary sidebar. this commit ensures that ⌘I action does nothing unless an editor is focused, preventing the ui from freezing and allowing normal interaction with the panel. --- .../components/mainInput/Lump/LumpToolbar/EditToolbar.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gui/src/components/mainInput/Lump/LumpToolbar/EditToolbar.tsx b/gui/src/components/mainInput/Lump/LumpToolbar/EditToolbar.tsx index b1424ffe4..a07c55c51 100644 --- a/gui/src/components/mainInput/Lump/LumpToolbar/EditToolbar.tsx +++ b/gui/src/components/mainInput/Lump/LumpToolbar/EditToolbar.tsx @@ -28,9 +28,11 @@ export function EditToolbar() { Back to {mode.charAt(0).toUpperCase() + mode.slice(1)} - Editing{" "} + Editing:{" "} - {getEditFilenameAndRangeText(codeToEdit)} + {codeToEdit + ? getEditFilenameAndRangeText(codeToEdit) + : "⚠️ No file selected"}