feat(v0.6): kill a session directly from the Projects grid cards

The detail view could kill sessions, but the grid card's session rows were
enter-only. Add a ✕ kill button to each card session row (stopPropagation so it
doesn't also enter the session); makeSessionRow gains an optional onKill,
makeProjectCard an optional onKillSession, and mountProjects wires it to
DELETE /live-sessions/:id followed by a refresh.

Frontend-only. projects-panel tests +1 (51): ✕ present only with the callback,
click kills the right id without entering. Verified in-browser: a card with 2
sessions dropped to 1 after clicking ✕.
This commit is contained in:
Yaojia Wang
2026-06-30 13:35:53 +02:00
parent 99bc6fd9f6
commit 46698b8b5e
4 changed files with 69 additions and 1 deletions

View File

@@ -1066,6 +1066,26 @@ body {
white-space: nowrap;
}
/* Kill (✕) on a session row — close the session straight from the card. */
.proj-session-kill {
flex: none;
width: 20px;
height: 20px;
line-height: 1;
padding: 0;
border: none;
border-radius: 5px;
background: none;
color: var(--text-faint);
cursor: pointer;
font-size: 11px;
transition: background 0.1s ease, color 0.1s ease;
}
.proj-session-kill:hover {
background: var(--red, #e5484d);
color: #fff;
}
/* Client-count badge (👁 N) */
.proj-session-badge {
font-size: 11px;