feat(v0.2): tab status dot, activity (unread) indicator, drag-reorder

- terminal-session.ts: track SessionStatus (connecting/connected/reconnecting/
  exited) + onStatus callback; FIX: wire onTitleChange (onTitle was in opts but
  never bound — auto-title was dead)
- tabs.ts: per-tab status dot (color = connection state), unread flag set on
  background output + cleared on activate, HTML5 drag-to-reorder (preserves
  active tab, persisted)
- style.css: .tab-dot colors, .unread ring, .dragging/.drag-over feedback
- Browser-verified: green dot connected, unread ring after bg output, reorder
  AAA|BBB→BBB|AAA persists across reload. 191 tests green, typechecks + build ok.
This commit is contained in:
Yaojia Wang
2026-06-17 14:55:19 +02:00
parent 064330f8d9
commit b5f21e5fdd
3 changed files with 126 additions and 3 deletions

View File

@@ -62,6 +62,43 @@ html, body {
box-shadow: inset 0 -2px 0 #4a9eff; /* active underline accent */
}
/* Status dot — color reflects connection state. */
.tab-dot {
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 8px;
flex: none;
background-color: #666;
}
.dot-connected {
background-color: #3fb950; /* green */
}
.dot-connecting,
.dot-reconnecting {
background-color: #d29922; /* amber */
}
.dot-exited {
background-color: #f85149; /* red */
}
/* Unread: an inactive tab got new output — blue ring + brighter label. */
.tab.unread .tab-dot {
box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.6);
}
.tab.unread .tab-label {
color: #fff;
font-weight: 600;
}
/* Drag-to-reorder feedback. */
.tab.dragging {
opacity: 0.4;
}
.tab.drag-over {
box-shadow: inset 3px 0 0 #4a9eff; /* drop-position indicator */
}
.tab-label {
padding-right: 8px;
overflow: hidden;