tui-new-chat

TUI new-chat dialog: Enter to submit, scroll, layout (launch up top), and submit creates NEW chat (doesn't overwrite existing)

Metadata

Statusdone
Assignedagent-518
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Created2026-04-27T02:07:17.857065553+00:00
Started2026-04-27T03:31:58.656955920+00:00
Completed2026-04-27T03:53:12.330446938+00:00
Tagseval-scheduled
Tokens558607 in / 10798 out
Eval score0.58
└ blocking impact0.30
└ completeness0.20
└ coordination overhead0.65
└ correctness0.75
└ downstream usability0.50
└ efficiency0.82
└ intent fidelity0.51
└ style adherence1.00

Description

Description

User reports the new-chat dialog is still fundamentally broken even after multiple iterations on tui-new-coordinator. Specific symptoms (verbatim):

'enter doesnt actually send the new chat config. then it doesnt convert into chat-2 or whatever it takes over the last coordinator chat... we still cant scroll the coordinator config..... nor press enter. or shift enter. only clicking lol! maybe launch should at least be at top of view so its clear why we are doing the list below of models is all we need to have and that should be scrollable? then this should flip into a new chat window and there can be multiple tabs for the coordinators.'

So six concrete asks:

  1. Enter submits — pressing Enter on a selected model row launches the chat. Currently does nothing.
  2. Shift+Enter also submits (mirror of common chat-input convention).
  3. Mouse click submits (already works per user).
  4. Submit creates a NEW chat — currently the launch overwrites/takes-over the last coordinator chat instead of creating chat-N+1. Each launch must allocate a fresh .chat-N task and spawn its supervisor.
  5. Scrollable model list — keyboard (↑↓ pgup/pgdn) AND mouse wheel scroll the list when it overflows.
  6. Layout — launch action at top — User suggestion: put 'Launch' button (and any name input) at the TOP of the dialog so it's clear that the model list below is the ONE remaining choice. Right now layout buries the action under the list.

After successful launch:

  • Dialog closes
  • New tab appears in the tab bar for the new chat
  • Focus moves to the new chat tab automatically
  • User can immediately start typing

Layout sketch

┌─ New chat ────────────────────────────────────────────┐
│ Name: [erik-2_____]                       [Launch]    │  ← name + action at top
│                                                       │
│ Pick a model:                                         │
│ ▸ claude / opus               ★ recent (2h ago)       │  ← scrollable list
│   claude / sonnet                                     │
│   claude / haiku                                      │
│   ──────────                                          │
│   native / qwen3-coder @ lambda01    ★ recent         │
│   ...                                                 │
│ ↑↓: select  Enter/click: launch  Esc: cancel          │
└───────────────────────────────────────────────────────┘

Hard gate (per smoke-gate-is principle)

Before claiming done:

  1. wg service start && wg tui
  2. Open new-chat dialog (note current open hotkey for posterity)
  3. Press ↓ a few times — selection must visibly move
  4. Press Enter — chat MUST be created with a NEW .chat-N id (not overwrite); dialog closes; new tab appears in tab bar
  5. Type 'hi' in the new chat — response comes back
  6. Re-open new-chat dialog; pick a different model; press Enter — ANOTHER new .chat-N appears as a separate tab (not replace the first)
  7. Capture the resulting tab bar / task list as evidence (screen grab, or grep wg list | grep .chat- showing N >= 2 chats)

NO claim of done without 1-7 demonstrated literally.

Files likely to touch

  • src/tui/viz_viewer/state.rs — dialog state machine (key handlers, scroll state, selection state)
  • src/tui/viz_viewer/event.rs — Enter / Shift+Enter routing into dialog
  • src/tui/mod.rs — dialog rendering layout
  • src/commands/service/ipc.rs — verify CreateChat allocates fresh .chat-N (does NOT reuse last id)

Validation

  • Failing tests first:
    • test_dialog_enter_creates_new_chat_with_fresh_id — synthetic Enter on dialog → IPC CreateChat called → response has new chat id, distinct from any prior
    • test_dialog_shift_enter_also_submits
    • test_dialog_scroll_with_keyboard
    • test_dialog_scroll_with_mouse_wheel
    • test_dialog_launch_at_top_of_layout
  • Implementation makes tests pass
  • cargo build + cargo test pass with no regressions
  • HARD GATE manual smoke as above

Depends on

Required by

Log