Self-hosted AI workspace.
Python
feat(chat): confirm before deleting a message
hemant singh0a37e925e12e
diff --git a/static/js/chat.js b/static/js/chat.jsindex 4279df570..c510ebf92 100644--- a/static/js/chat.js+++ b/static/js/chat.js@@ -4481,6 +4481,15 @@ import { wireArrowUpRecall, getLastUserMessageFromChatHistory } from './composer* Delete an AI message and its preceding user message from the conversation.*/export async function deleteMessage(msgElement) {+ if (uiModule && uiModule.styledConfirm) {+ const ok = await uiModule.styledConfirm('Delete this message?', {+ confirmText: 'Delete',+ cancelText: 'Cancel',+ danger: true,+ });+ if (!ok) return;+ }+const box = document.getElementById('chat-history');const allMsgs = Array.from(box.querySelectorAll('.msg'));const clickedIndex = allMsgs.indexOf(msgElement);