implement-tui-tab

Implement: TUI tab list persistence across sessions

Metadata

Statusdone
Assignedagent-740
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Modelclaude:sonnet
Created2026-04-27T16:01:01.365124596+00:00
Started2026-04-27T16:15:29.446163079+00:00
Completed2026-04-27T16:39:22.518968722+00:00
Tagstui,chat-redesign, eval-scheduled

Description

Description

Persist the TUI's active-tabs list so reopening the TUI restores the previous session's tabs.

Storage:

  • Path: '.workgraph/service/tui_state.json' (research-tui-chat will confirm or suggest alternative)
  • Format: '{ "open_tabs": [".chat-1", ".chat-3"], "active": ".chat-3" }'
  • Update on: tab open, tab close, active-tab switch, TUI clean shutdown
  • Best-effort write; failure to persist should log a warning but not block TUI operation

Restore on TUI start:

  • Read tui_state.json; for each task id, verify it still exists in the graph.
  • Skip missing tasks; show a single toast/log line: 'Skipped N missing tabs from previous session'.
  • If file doesn't exist or is empty, start with empty tab list.
  • Multi-TUI concurrency: last-write-wins is fine. Don't add locking.

Validation

  • Failing test first: open 2 tabs, kill TUI, restart TUI — both tabs reappear with same active selection
  • If a saved tab refers to a missing task, TUI starts cleanly and logs the skip
  • tui_state.json written on tab open/close/switch (verify file mtime updates)
  • Empty/missing state file → empty tab list, no error
  • cargo build + cargo test pass
  • Live-smoke: open chats, kill TUI process, relaunch — tabs restored

Depends on

Required by

Log