Sessions: confirm chat delete actions

- confirm sidebar/session-list chat deletes
- confirm library chat menu deletes
- confirm archived chat permanent deletes
This commit is contained in:
ooovenenoso
2026-06-02 07:43:34 -04:00
committed by GitHub
parent 51cf63009e
commit fb0f8484d7
2 changed files with 13 additions and 7 deletions

View File

@@ -2059,6 +2059,7 @@ let _libraryArchivedView = false; // Documents tab showing archived docs?
{ label: 'Copy', action: () => _copyChatById(s.id) },
{ label: 'Archive', action: async () => { await fetch(API_BASE + '/api/session/' + s.id + '/archive', { method: 'POST', headers: {'Content-Type':'application/json'} }); _renderLibChats(); } },
{ label: 'Delete', action: async () => {
if (!await window.styledConfirm('Delete this chat?', { confirmText: 'Delete', danger: true })) return;
await fetch(API_BASE + '/api/session/' + s.id, { method: 'DELETE' });
card.style.maxHeight = `${Math.max(card.getBoundingClientRect().height, card.scrollHeight)}px`;
card.classList.add('memory-tidy-removing');
@@ -2412,7 +2413,11 @@ let _libraryArchivedView = false; // Documents tab showing archived docs?
{ label: 'Open', action: () => { if (window.sessionModule) window.sessionModule.selectSession(s.id); } },
{ label: 'Copy', action: () => _copyChatById(s.id) },
{ label: 'Restore', action: async () => { await fetch(API_BASE + '/api/session/' + s.id + '/unarchive', { method: 'POST' }); _renderLibArchive(); } },
{ label: 'Delete', action: async () => { await fetch(API_BASE + '/api/session/' + s.id, { method: 'DELETE' }); _renderLibArchive(); }, danger: true },
{ label: 'Delete', action: async () => {
if (!await window.styledConfirm('Delete this chat permanently?', { confirmText: 'Delete', danger: true })) return;
await fetch(API_BASE + '/api/session/' + s.id, { method: 'DELETE' });
_renderLibArchive();
}, danger: true },
], { onSelect: () => {
_arcSelectMode = true;
_arcSelected.add('chats:' + s.id);