feat: add confirm step to message-level delete
Clicking del now shows 'confirm delete / cancel' inline in the action bar. Cancel rebuilds the original buttons; confirm proceeds as before. Matches the session delete pattern added in the prior commit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -935,7 +935,20 @@
|
||||
delBtn.className = 'msg-act-btn del';
|
||||
delBtn.innerHTML = icon_html('trash-2', 12) + ' del';
|
||||
delBtn.addEventListener('click', () => {
|
||||
deleteMsg(wrapper);
|
||||
actionsDiv.innerHTML = '';
|
||||
|
||||
const yesBtn = document.createElement('button');
|
||||
yesBtn.className = 'msg-act-btn del';
|
||||
yesBtn.textContent = 'confirm delete';
|
||||
yesBtn.addEventListener('click', () => deleteMsg(wrapper));
|
||||
|
||||
const noBtn = document.createElement('button');
|
||||
noBtn.className = 'msg-act-btn';
|
||||
noBtn.textContent = 'cancel';
|
||||
noBtn.addEventListener('click', () =>
|
||||
attachHistoryControls(msgDiv, parseInt(wrapper.dataset.histIdx)));
|
||||
|
||||
actionsDiv.append(yesBtn, noBtn);
|
||||
});
|
||||
|
||||
actionsDiv.appendChild(editBtn);
|
||||
|
||||
Reference in New Issue
Block a user