Skip to content

fix(tui): plan mode reachable (/plan, PLAN badge, --plan-mode), @bare-name completion, matching question-box borders, bubble width/tabs (#1407) - #1408

Merged
dennisonbertram merged 10 commits into
mainfrom
issue-tui-scenarios
Sep 6, 2026
Merged

fix(tui): plan mode reachable (/plan, PLAN badge, --plan-mode), @bare-name completion, matching question-box borders, bubble width/tabs (#1407)#1408
dennisonbertram merged 10 commits into
mainfrom
issue-tui-scenarios

Conversation

@dennisonbertram

Copy link
Copy Markdown
Owner

Closes #1407

Summary

A twelve-scenario live walk of the TUI (fake provider with scripted streaming and tool turns, plus OpenRouter DeepSeek) surfaced several first-time-user problems. This PR fixes four with red-first tests and live tmux proof: plan mode is now reachable and visible, @name Tab completion works for bare file names, the question and plan-approval boxes have matching borders, and assistant markdown bubbles never exceed the terminal width or contain tabs. Two guards are added for behaviours that were already correct (streamed-transcript integrity; no duplicate tool card on ctrl+o after an interrupt).

The streamed-markdown truncation under a real color profile turned out to be a separate, deeper streaming re-render accounting defect (not the bubble width, which is fixed and unit-tested); it is filed as its own issue and not claimed fixed here — see the scope note on #1407.

Scope and issue reconciliation

Fixed: (1) /plan command toggles enforced plan mode, a PLAN badge shows in the status bar, and harnesscli --tui --plan-mode is honored (previously runTUI dropped the flag and ctrl+o only reached plan mode before any tool call ran); (2) @cal+Tab completes bare relative names; (3) AskUserQuestion / Plan-Approval box borders sized to content; (4) assistant bubbles render markdown at the indented width, expand tabs, trim padding. Out of scope and filed separately: streaming glamour reflow truncation, ctrl+o precedence redesign.

Impact analysis reconciliation

  • cmd/harnesscli/tui/model.go: executePlanCommand, PLAN badge in statusBarModelLabel, cfg.PlanMode applied in New.
  • cmd/harnesscli/tui/cmd_parser.go: /plan registered (registry-completeness test updated).
  • cmd/harnesscli/main.go: runTUI gains a planMode arg (test updated).
  • cmd/harnesscli/tui/config.go: TUIConfig.PlanMode.
  • cmd/harnesscli/tui/filecomplete.go: bare relative names complete.
  • cmd/harnesscli/tui/askuser.go: box borders sized to content.
  • cmd/harnesscli/tui/components/messagebubble/assistant.go: fitLine, render at contentWidth.
  • Server/API untouched.

Test-first evidence

Red commands (per slice, on the branch): TestPlanCommand_TogglesAndShowsInStatusBar / TestTUIConfig_PlanModeFlag; TestFilePathCompleter_BareRelativeName (want the two calc files, got []); TestAssistantBubble_FitsWidthAndHasNoTabs (line contains a tab / is N columns wide); TestAskUser_Overlay_BordersMatch (border widths differ: top 12 vs bottom 50).
Green: go test ./cmd/harnesscli/... -race → 30 packages ok.

Verification evidence

Live tmux 120x40, built binary:
Plan approval reached via /plan (PLAN badge in the status bar):

    • Created  calc.go  w
    • Created  calc_test.go
    •  go test -v ./...  — all four subt
      === RUN   TestAdd
      --- PASS: TestAdd (0.00s)
      PASS

@bare-name Tab completion:

Question box borders match:

❯ make calc
⏺
    Done. Summary:
    • Created  calc.go  w
    • Created  calc_test.go
    •  go test -v ./...  — all four subt
      === RUN   TestAdd
      --- PASS: TestAdd (0.00s)
      PASS

Rollout and rollback

TUI-only; rebuild with scripts/install.sh, restart the TUI. Rollback: revert.

Documentation

website/docs/cli/tui.md plan-mode note; engineering-log entry.

Contract checklist

  • Linked issue follows the current structured contract and this PR closes it
  • Issue acceptance criteria, impact map, and scope were updated when the design changed
  • All callers, consumers, sources of truth, and similar abstractions were searched
  • No unrelated cleanup, hidden scope growth, duplicated wiring, or parallel abstraction was introduced
  • Tests were written first and the expected red failure was observed, or this is a strictly docs-only minor PR
  • Targeted checks and the repository-required full regression are green
  • Security, compatibility, lifecycle, deployment, observability, documentation, and rollback were reconciled
  • Real mouse/keyboard/API/operator behavior was exercised when the change is interaction- or integration-heavy

🤖 Generated with Claude Code

https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5

dennisonbertram and others added 10 commits September 6, 2026 14:16
…nored by the TUI

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5
…he status bar, --tui --plan-mode honored

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5
…d runTUI test updated

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5
… contain no tabs; streamed-transcript and interrupted-card guards

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5
…s, trim padding so assistant bubbles never exceed the terminal width

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5
… file names

Red: want the two calc files, got []

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5
… names

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5
…border line

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5
…engineering-log entry

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@dennisonbertram
dennisonbertram merged commit 9415e10 into main Sep 6, 2026
2 checks passed
@dennisonbertram
dennisonbertram deleted the issue-tui-scenarios branch September 6, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant