feat: session delete + touch-friendly message controls
Session delete:
- DELETE /sessions/{session_id} endpoint (chat.py + session_store.py)
- × button on each session item in the panel (hover-reveal on desktop)
- Clears UI if the active session is deleted
Touch accessibility:
- @media (hover: none) rule makes msg-actions always visible on touch devices
- msg-act-btn tap targets enlarged to 36px min-height, readable font size
- session-delete-btn also always visible and finger-sized on touch
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,7 @@ from pydantic import BaseModel
|
||||
from context_loader import load_context
|
||||
from llm_client import complete
|
||||
from session_logger import log_turn
|
||||
from session_store import load as load_session, save as save_session, list_all, generate_session_id
|
||||
from session_store import load as load_session, save as save_session, list_all, generate_session_id, delete as delete_session
|
||||
from config import settings
|
||||
import event_bus
|
||||
|
||||
@@ -143,6 +143,14 @@ async def list_sessions() -> dict:
|
||||
return {"sessions": list_all()}
|
||||
|
||||
|
||||
@router.delete("/sessions/{session_id}")
|
||||
async def delete_session_endpoint(session_id: str) -> dict:
|
||||
found = delete_session(session_id)
|
||||
if not found:
|
||||
raise HTTPException(status_code=404, detail=f"Session {session_id} not found")
|
||||
return {"ok": True, "session_id": session_id}
|
||||
|
||||
|
||||
@router.put("/history/{session_id}")
|
||||
async def replace_history(session_id: str, req: HistoryUpdate) -> dict:
|
||||
"""Replace the full message list for a session (used by edit/delete UI)."""
|
||||
|
||||
Reference in New Issue
Block a user