📋 Feature Request
Add ability to delete conversations/threads
🎯 Problem Description
Currently, there is no way to delete conversations/threads in the IronClaw web interface. Users can create new conversations (via the "+" button) and switch between them, but cannot delete old ones.
Current UI behavior:
- Clicking a thread item only switches to that conversation
- No delete button, menu, or icon on thread items
- No right-click context menu
- No delete option in settings
🔍 Technical Analysis
Frontend (src/channels/web/static/app.js)
Thread list rendering (line ~2008-2044):
for (const thread of threads) {
const item = document.createElement('div');
item.className = 'thread-item' + (isActive ? ' active' : '');
// Only renders: label + timestamp + unread indicator
// Click only triggers switchThread()
item.addEventListener('click', () => switchThread(thread.id));
list.appendChild(item);
}
Missing:
- No delete button/icon in thread item
- No delete confirmation dialog
- No API call to delete endpoint
Backend (src/channels/web/handlers/chat.rs)
Existing handlers:
pub async fn chat_threads_handler(...) // GET /api/chat/threads
pub async fn chat_new_thread_handler(...) // POST /api/chat/thread/new
// ❌ No chat_delete_thread_handler
Missing:
- No
DELETE /api/chat/thread/{id} endpoint
- No delete handler implementation
Server Routes (src/channels/web/handlers/server.rs)
Existing routes:
.route("/api/chat/threads", get(chat_threads_handler))
.route("/api/chat/thread/new", post(chat_new_thread_handler))
// ❌ No delete route
For comparison, other features have delete:
.route("/api/admin/routines/{id}", delete(routines_delete_handler))
.route("/api/admin/skills/{name}", delete(skills_remove_handler))
.route("/api/admin/secrets/{name}", delete(secrets_delete_handler))
💡 Expected Implementation
Frontend Changes
-
Add delete button/icon on thread items
- Show on hover or always visible
- Use trash icon (🗑️) or delete icon
- Position: right side of thread item
-
Add confirmation dialog
function confirmDeleteThread(threadId, threadName) {
if (confirm(`Delete conversation "${threadName}"? This cannot be undone.`)) {
apiFetch(`/api/chat/thread/${threadId}`, { method: 'DELETE' })
.then(() => { loadThreads(); if (activeThreadId === threadId) switchToFirstThread(); });
}
}
-
Update thread list rendering
- Add delete button to each thread item
- Add event listener for delete action
Backend Changes
-
Add delete handler (chat.rs):
pub async fn chat_delete_thread_handler(
Path(thread_id): Path<Uuid>,
user: User,
db: Data<Database>,
) -> Result<Json<()>> {
// Verify thread belongs to user
let thread = db.get_thread(thread_id, user.id).await?;
// Delete thread and associated messages
db.delete_thread(thread_id, user.id).await?;
Ok(Json(()))
}
-
Add route (server.rs):
.route("/api/chat/thread/{id}", delete(chat_delete_thread_handler))
-
Add database method (database.rs):
pub async fn delete_thread(&self, thread_id: Uuid, user_id: Uuid) -> Result<()> {
// Delete thread and cascade delete messages
sqlx::query("DELETE FROM threads WHERE id = ? AND user_id = ?")
.bind(thread_id)
.bind(user_id)
.execute(&self.pool)
.await?;
Ok(())
}
🎨 UI Design Suggestions
Option 1: Delete button on hover
┌─────────────────────────────────────┐
│ 📋 Project Discussion 2026-04-02 │ [🗑️]
├─────────────────────────────────────┤
│ 💬 Daily Chat 2026-04-01 │ [🗑️]
└─────────────────────────────────────┘
Option 2: Three-dot menu
┌─────────────────────────────────────┐
│ 📋 Project Discussion 2026-04-02 │ [⋮]
├─────────────────────────────────────┤
│ 💬 Daily Chat 2026-04-01 │ [⋮]
└─────────────────────────────────────┘
Option 3: Delete icon always visible
┌─────────────────────────────────────┐
│ 📋 Project Discussion 2026-04-02 │ 🗑️
├─────────────────────────────────────┤
│ 💬 Daily Chat 2026-04-01 │ 🗑️
└─────────────────────────────────────┘
Recommendation: Option 1 (show on hover) for cleaner UI
🔒 Security Considerations
- Verify thread ownership before delete
- Only authenticated users can delete their own threads
- Admin can delete any thread (optional)
- Add rate limiting to prevent abuse
📝 Use Cases
- Clean up old conversations - Remove completed projects or outdated discussions
- Privacy - Delete conversations containing sensitive information
- Token management - Delete long conversations to free up context space
- Organization - Keep conversation list manageable and relevant
🏷️ Labels
enhancement
good first issue (for frontend changes)
backend (for API implementation)
📎 Related
- N/A (no existing issues found for this feature)
✅ Acceptance Criteria
Thank you for considering this feature request!
📋 Feature Request
Add ability to delete conversations/threads
🎯 Problem Description
Currently, there is no way to delete conversations/threads in the IronClaw web interface. Users can create new conversations (via the "+" button) and switch between them, but cannot delete old ones.
Current UI behavior:
🔍 Technical Analysis
Frontend (
src/channels/web/static/app.js)Thread list rendering (line ~2008-2044):
Missing:
Backend (
src/channels/web/handlers/chat.rs)Existing handlers:
Missing:
DELETE /api/chat/thread/{id}endpointServer Routes (
src/channels/web/handlers/server.rs)Existing routes:
For comparison, other features have delete:
💡 Expected Implementation
Frontend Changes
Add delete button/icon on thread items
Add confirmation dialog
Update thread list rendering
Backend Changes
Add delete handler (
chat.rs):Add route (
server.rs):Add database method (
database.rs):🎨 UI Design Suggestions
Option 1: Delete button on hover
Option 2: Three-dot menu
Option 3: Delete icon always visible
Recommendation: Option 1 (show on hover) for cleaner UI
🔒 Security Considerations
📝 Use Cases
🏷️ Labels
enhancementgood first issue(for frontend changes)backend(for API implementation)📎 Related
✅ Acceptance Criteria
Thank you for considering this feature request!