Skip to content

bug(tui): key routing defects — Enter swallowed by overlays (sessions/plugins/dashboard), bare slash dispatch, ctrl+c draft loss #1302

Description

@dennisonbertram

Found by a live tmux-driven TUI test sweep (fake provider rigs). Evidence: .tmp/tui-test/results/ (history.md, runs.md, workspace.md, pickers.md, inputux.md).

Root cause for the headline bugs: the global Submit key case (cmd/harnesscli/tui/model.go:2884) precedes overlay routing (model.go:3301/3243) and lacks branches for several overlays, so Enter falls through to the input area.

Bugs (acceptance criteria — each fixed with a regression test)

  • /sessions Enter never selects a session — session switching impossible in the real TUI (model.go:2884 vs :3301).
  • /plugins Enter enable/disable toggle unreachable (model.go:3243/3256).
  • /dashboard n/s (new-run / steer) inputs can never be submitted; spaces are also dropped in those inputs (tea.KeySpace unhandled) — "go faster" becomes "gofaster".
  • /model Enter on an empty filter result hijacks into the /keys overlay (model.go:3006 ignores Accept()'s ok=false).
  • Bare / + Enter executes /add-dir — dropdown auto-accepts the first suggestion and the immediate-execute path runs it.
  • Bare /continue + Enter is swallowed — aliases not in the suggestion list; the no-suggestion arm (~model.go:3067) only handles unregistered names.
  • ctrl+o "expand" is inverted on completed cards (full output unreachable despite the hint); plan-mode arm of ctrl+o dead after the first tool call (activeToolCallID never cleared).
  • Ctrl+C with a non-empty draft quits the TUI, losing the draft — Quit case (model.go:2610) intercepts before inputarea's clear-buffer handler (inputarea/model.go:170).
  • /config search advertised (/ search... header) but dead — keys never routed to the config panel; values hard-truncate at 20 chars with no ellipsis.
  • /model search drops batched/pasted multi-rune input — HandleSearchKey only accepts single-rune keys.

Test plan

Failing Go regression tests first per bug (pattern-match slashcomplete_dropdown_test.go, overlay_wire_test.go, dashboard_test.go), then minimal fixes; scripts/test-regression.sh green.

Rollout/rollback

TUI-only changes in cmd/harnesscli/tui/; rollback by reverting the branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions