# Session Closure from History Page — Design > **Date:** 2026-03-11 ## Problem Active sessions on the Session History page only have "View Details" and "Resume" buttons. Engineers have no way to close out sessions that were abandoned, resolved externally, or otherwise no longer needed — without resuming the entire flow. ## Design Decisions - **Outcome model:** Hybrid — reuse existing 4 outcomes (resolved, escalated, workaround, unresolved) + add 2 early-closure outcomes (cancelled, resolved_externally) - **UX:** Inline popover anchored to a "Close" button on the session card — no modal, no slide panel - **Scope:** Active sessions only (started but not completed). No bulk close. No AI summary generation. - **Backend:** No new endpoints or migrations. Expand `SessionOutcome` literal type; existing `POST /sessions/{id}/complete` handles everything. ## Data Model No new columns. Expand `SessionOutcome` in `backend/app/schemas/session.py`: ```python SessionOutcome = Literal["resolved", "escalated", "workaround", "unresolved", "cancelled", "resolved_externally"] ``` `VARCHAR(20)` on `session.outcome` fits both new values (max 19 chars for `resolved_externally`). ## UI ### Close Button Appears on active session cards (`started_at` is set, `completed_at` is null), between "View Details" and "Resume": ``` [View Details] [Close] [Resume] ``` Secondary button styling (border, muted text). Not shown on prepared or completed sessions. ### Close Popover Anchored below the "Close" button: - **Outcome selector:** `