Skip to content

Commit 959ef54

Browse files
jasonczcclaude
andcommitted
fix(web): sidebar kebab shows Archive xor Delete based on active
Active sessions can't be safely Deleted (the container teardown path requires the session be inactive first), so showing both was a trap. Match SessionHeader's behaviour: active → Archive only, inactive → Delete only. Also tighten the Delete confirm copy now that the split is explicit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f67c273 commit 959ef54

1 file changed

Lines changed: 27 additions & 24 deletions

File tree

web/src/router.tsx

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -746,30 +746,33 @@ function SessionsPage() {
746746
Share
747747
</button>
748748
<div className="menu-divider" />
749-
<button
750-
className="menu-action"
751-
onClick={(e) => {
752-
e.stopPropagation()
753-
setOpenMenuSessionId(null)
754-
setSessionMenuAnchor(null)
755-
void archiveSessionFromSidebar(session.id)
756-
}}
757-
>
758-
Archive
759-
</button>
760-
<button
761-
className="menu-action danger"
762-
onClick={(e) => {
763-
e.stopPropagation()
764-
setOpenMenuSessionId(null)
765-
setSessionMenuAnchor(null)
766-
if (window.confirm(`Delete session "${title}"? This stops the agent and removes its container.`)) {
767-
void deleteSessionFromSidebar(session.id)
768-
}
769-
}}
770-
>
771-
Delete
772-
</button>
749+
{session.active ? (
750+
<button
751+
className="menu-action danger"
752+
onClick={(e) => {
753+
e.stopPropagation()
754+
setOpenMenuSessionId(null)
755+
setSessionMenuAnchor(null)
756+
void archiveSessionFromSidebar(session.id)
757+
}}
758+
>
759+
Archive
760+
</button>
761+
) : (
762+
<button
763+
className="menu-action danger"
764+
onClick={(e) => {
765+
e.stopPropagation()
766+
setOpenMenuSessionId(null)
767+
setSessionMenuAnchor(null)
768+
if (window.confirm(`Delete session "${title}"? This removes its container and history.`)) {
769+
void deleteSessionFromSidebar(session.id)
770+
}
771+
}}
772+
>
773+
Delete
774+
</button>
775+
)}
773776
</div>
774777
) : null}
775778
{childTitle ? (

0 commit comments

Comments
 (0)