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:
Scott Idem
2026-05-12 21:20:13 -04:00
parent 20f3fe4f71
commit 85e13314a2
2 changed files with 15 additions and 2 deletions

View File

@@ -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);

View File

@@ -139,7 +139,7 @@ ability to act on HA via the REST API.
### [UX] Session delete confirmation
- [x] Inline "Delete this session? [Delete] [Cancel]" reveal on `×` click in `app.js` — 2026-05-12
- [ ] Consider: also confirm for message-level delete (Edit/Delete hover controls)
- [x] Message-level delete: "confirm delete / cancel" inline in the actions bar — 2026-05-12
### [UI] File attachments in chat
Upload an image or document inline and have it flow into context. Natural workflow