You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
claudbg/.beans/claudbg-pta8--tui-session-l...

41 lines
1.9 KiB
Markdown

---
# claudbg-pta8
title: 'TUI: session list screen widget'
status: in-progress
type: feature
priority: normal
created_at: 2026-03-30T04:45:53Z
updated_at: 2026-03-30T16:47:21Z
parent: claudbg-i6l2
blocked_by:
- claudbg-nq36
---
Render the full-screen session list as the TUI's home screen.
## Layout
```
┌─ Sessions ──────────────────────────────────────────────────────┐
│ ID Date Project Model Msgs Agents │
│ ────────────────────────────────────────────────────────────────────── │
│ 21fae0a8 2026-03-29 14:32:01 …/pop/claudbg claude-3 42 3 │◄ selected (highlighted)
│ def4776b 2026-03-28 10:15:44 …/pop/claudbg claude-3 128 1 │
│ ... │
└─────────────────────────────────────────────────────────────────┘
```
## Implementation
- Use `ratatui::widgets::Table` with `TableState` for selection tracking.
- Highlight the selected row with a `Style` that inverts colors or uses a distinct background.
- Columns: ID (8), Date (20), Project (dynamic, truncated to tail), Model (20), Msgs (6), Agents (7).
- Project path: display only the last 30 or so characters (prefix with `…`).
- Populate from `AppState.sessions` (loaded on TUI start from `discover_sessions` + DB).
- Scroll with arrow keys / j/k; selected index tracked in `AppState.list_selected`.
## Blocked by
- app state model (claudbg-nq36)
- agent discovery fix (claudbg-33n0) — for accurate agent counts