feat: task_list priority filter, session delete confirm, spawn_agent tool restrictions
- task_list: add priority param ('low'/'normal'/'high') alongside existing status filter
- Session delete: inline confirm row (Delete / Cancel) instead of immediate delete
- spawn_agent: allow_tools and deny_tools per-call params; role config remains ceiling;
deny_tools falls back to confirm_deny gate when no explicit tool_list is set
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -693,19 +693,53 @@
|
||||
editBtn.onclick = enterEditMode;
|
||||
|
||||
// ── Delete ───────────────────────────────────────────────
|
||||
delBtn.addEventListener('click', async (e) => {
|
||||
delBtn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
await fetch(`/sessions/${s.session_id}?${_fileParams}`, { method: 'DELETE' });
|
||||
if (sessionId === s.session_id) {
|
||||
sessionId = null;
|
||||
clear_stored_session();
|
||||
currentHistory = [];
|
||||
messagesEl.innerHTML = '';
|
||||
sessionEl.textContent = '';
|
||||
showToast('Session deleted');
|
||||
|
||||
// Swap row content for inline confirm
|
||||
editBtn.hidden = true;
|
||||
bodyEl.hidden = true;
|
||||
delBtn.hidden = true;
|
||||
|
||||
const confirmRow = document.createElement('div');
|
||||
confirmRow.className = 'session-confirm-row';
|
||||
confirmRow.innerHTML =
|
||||
'<span class="session-confirm-label">Delete this session?</span>';
|
||||
|
||||
const yesBtn = document.createElement('button');
|
||||
yesBtn.className = 'session-confirm-yes';
|
||||
yesBtn.textContent = 'Delete';
|
||||
|
||||
const noBtn = document.createElement('button');
|
||||
noBtn.className = 'session-confirm-no';
|
||||
noBtn.textContent = 'Cancel';
|
||||
|
||||
confirmRow.append(yesBtn, noBtn);
|
||||
item.appendChild(confirmRow);
|
||||
|
||||
function cancelConfirm() {
|
||||
confirmRow.remove();
|
||||
editBtn.hidden = false;
|
||||
bodyEl.hidden = false;
|
||||
delBtn.hidden = false;
|
||||
}
|
||||
const res = await fetch(`/sessions?${_fileParams}`);
|
||||
renderPanel((await res.json()).sessions);
|
||||
|
||||
noBtn.addEventListener('click', (e) => { e.stopPropagation(); cancelConfirm(); });
|
||||
|
||||
yesBtn.addEventListener('click', async (e) => {
|
||||
e.stopPropagation();
|
||||
await fetch(`/sessions/${s.session_id}?${_fileParams}`, { method: 'DELETE' });
|
||||
if (sessionId === s.session_id) {
|
||||
sessionId = null;
|
||||
clear_stored_session();
|
||||
currentHistory = [];
|
||||
messagesEl.innerHTML = '';
|
||||
sessionEl.textContent = '';
|
||||
showToast('Session deleted');
|
||||
}
|
||||
const res = await fetch(`/sessions?${_fileParams}`);
|
||||
renderPanel((await res.json()).sessions);
|
||||
});
|
||||
});
|
||||
|
||||
sessionsPanel.appendChild(item);
|
||||
|
||||
@@ -372,6 +372,35 @@
|
||||
}
|
||||
.session-save-btn:hover { opacity: 0.75; }
|
||||
|
||||
.session-confirm-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.session-confirm-label {
|
||||
flex: 1;
|
||||
font-size: 0.78rem;
|
||||
color: #e06c75;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.session-confirm-yes, .session-confirm-no {
|
||||
background: none;
|
||||
border: 1px solid;
|
||||
border-radius: 4px;
|
||||
font-size: 0.72rem;
|
||||
padding: 2px 8px;
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
transition: opacity 0.15s;
|
||||
}
|
||||
.session-confirm-yes { border-color: #e06c75; color: #e06c75; }
|
||||
.session-confirm-no { border-color: var(--muted); color: var(--muted); }
|
||||
.session-confirm-yes:hover, .session-confirm-no:hover { opacity: 0.75; }
|
||||
|
||||
.session-rename-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
Reference in New Issue
Block a user