Skip to content

Commit 41abe2f

Browse files
committed
Bump eca-webview: closing a chat tab no longer deletes the chat
Also make the sidebar action honest: it deletes the chat from the server history, so label it Delete chat and ask confirmation.
1 parent 4775bd6 commit 41abe2f

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

‎src/components/ChatSidebar.tsx‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,13 @@ export function ChatSidebar({ bridge, chats = [], selectedId, workspaceFolders =
7676
[bridge],
7777
);
7878

79-
const handleCloseChat = useCallback(
80-
(chatId: string) => {
81-
bridge?.closeChat(chatId);
79+
const handleDeleteChat = useCallback(
80+
(chatId: string, title: string) => {
81+
// The sidebar lists the server's chat history, so removing an entry
82+
// permanently deletes the chat. Confirm before doing so.
83+
if (window.confirm(`Permanently delete chat "${title}"?`)) {
84+
bridge?.closeChat(chatId);
85+
}
8286
},
8387
[bridge],
8488
);
@@ -153,9 +157,9 @@ export function ChatSidebar({ bridge, chats = [], selectedId, workspaceFolders =
153157
</button>
154158
<button
155159
className="chat-sidebar-action chat-sidebar-action-close"
156-
onClick={(e) => { e.stopPropagation(); handleCloseChat(chat.id); }}
157-
title="Close chat"
158-
aria-label="Close chat"
160+
onClick={(e) => { e.stopPropagation(); handleDeleteChat(chat.id, chat.title); }}
161+
title="Delete chat"
162+
aria-label="Delete chat"
159163
>
160164
<i className="codicon codicon-close" />
161165
</button>

0 commit comments

Comments
 (0)