--- # claudbg-pta8 title: 'TUI: session list screen widget' status: completed type: feature priority: normal created_at: 2026-03-30T04:45:53Z updated_at: 2026-03-30T16:50:08Z 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 ## Summary of Changes\n\nCreated src/tui/screens/session_list.rs with render_session_list() (ratatui Table with REVERSED highlight, truncated project paths) and handle_session_list_event() (Up/k/Down/j navigation, Enter→transcript, q/Esc→quit, ?→help). 18 unit tests. Wired into run.rs render dispatch and event delegation. 134 total tests pass.