tui-chat-tab

TUI chat tab states: blue=idle/resumable, yellow=actively-responding; multi-tab navigation between chats

Metadata

Statusdone
Assignedagent-227
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Created2026-04-27T02:07:17.891563730+00:00
Started2026-04-27T02:08:40.596144178+00:00
Completed2026-04-27T02:32:38.048694319+00:00
Tagseval-scheduled
Eval score0.82
└ blocking impact0.90
└ completeness0.75
└ coordination overhead0.85
└ correctness0.82
└ downstream usability0.82
└ efficiency0.85
└ intent fidelity0.86
└ style adherence0.88

Description

Description

Two related TUI chat-tab UX issues per user (verbatim):

'shows as active (yellow) and not blue (perpetual). and... the task for it is always yellow? which is right but a bit weird given we can resume the chats. before it was a nice blue color. we lost that tho. but active when responding is cool too. but maybe it should become blue when its not actively working?' 'we have no way to select them now.'

Issue A — color/state semantics

Chat tabs are perpetually rendered in 'active/yellow' state. Should distinguish:

  • Blue (or whatever the prior 'persistent' color was): chat is idle / resumable — supervisor alive, no in-flight LLM call, waiting for user input
  • Yellow (active): LLM is actively generating a response right now
  • Gray / dim: supervisor not running (chat exists in graph but service is stopped or supervisor died)
  • Red: chat in error state (handler crashed, hit retry cap)

Transitions:

  • User sends message → yellow until response complete → back to blue
  • Service stops → all tabs go gray
  • Service starts + supervisor spawns → tabs go back to blue (or yellow if mid-turn on resume)
  • 4xx/5xx loop or unrecoverable error → red

Restore the prior blue color for the idle case (per user 'we lost that tho').

Issue B — multi-tab navigation

Once multiple chats exist (.chat-1, .chat-2, etc), there's no visible way to switch between them in the TUI. Need:

  • Number keys (1-9) jump to chat tab N
  • Click on a tab in the tab bar switches to it
  • Ctrl-Tab / Ctrl-Shift-Tab cycle through tabs
  • Indicator on the active tab (underline, brighter color, etc)

This becomes urgent the moment the new-chat dialog (separate task) starts producing multiple chats.

Files likely to touch

  • src/tui/viz_viewer/state.rs — tab state, active-tab tracking, key handlers for tab switching
  • src/tui/viz_viewer/render.rs — color rendering for tab state, multi-tab tab-bar widget
  • src/tui/mod.rs — top-level layout
  • Probably a small helper module for chat-state inference (idle vs responding vs gray vs error)

Validation

  • Failing tests first:
    • test_chat_tab_color_idle_is_blue — chat with supervisor alive, no in-flight call → tab color is blue
    • test_chat_tab_color_active_is_yellow — chat mid-LLM-call → yellow
    • test_chat_tab_color_supervisor_down_is_gray
    • test_chat_tab_color_error_is_red
    • test_number_key_switches_to_chat_n
    • test_click_tab_switches_focus
  • Implementation makes tests pass
  • cargo build + cargo test pass with no regressions
  • Manual smoke (HARD GATE):
    1. Create 3 chats
    2. Tab bar shows 3 tabs, each with a name + color reflecting state
    3. Press '1', '2', '3' — focus jumps between them
    4. Click tab 2 — focus jumps to it
    5. Send a message in chat 2; observe its tab go yellow during response, back to blue when complete; chats 1 and 3 stay blue throughout
    6. wg service stop; all 3 tabs go gray; wg service start; all 3 go back to blue

Depends on

Required by

Log