Skip to content

[Feature]: add a balanced transcript-first TUI mode for interactive chat #689

@gh-xj

Description

@gh-xj

Surface

Conversation / session runtime

Problem statement

LoongClaw's interactive chat now has a stronger line-oriented terminal surface after the shared screen-spec work in #518 and the live phase surfaces in #531, but it still does not offer a dedicated full-screen chat shell for longer-running interactive sessions. The current path is good for startup summaries, structured replies, and phase updates, yet it cannot keep the transcript, composer, current execution state, and detailed tool output visible within one stable terminal layout.

That gap matters once interactive chat becomes a daily-use operator surface rather than a one-shot terminal exchange. Users need a transcript-first shell that keeps conversation context anchored, keeps tool activity visible without flooding the screen, and only expands into richer execution detail when approvals, errors, or explicit inspection demand it.

Proposed solution

Add an opt-in balanced TUI mode for interactive chat, exposed as loongclaw chat --ui tui, while keeping the current text path as the default and fallback.

Scope the first iteration narrowly:

  • keep the implementation Rust-native in loongclaw-app
  • preserve the existing text/screen-spec surface as --ui text
  • add a transcript-first full-screen shell for --ui tui
  • keep the main screen centered on one active foreground session
  • show a quiet execution band for running tools, latest result, background count, and pending approvals
  • open richer tool output, shell logs, diffs, and approval/error detail in an inline drawer rather than a permanent operator dashboard
  • degrade cleanly back to the text path when stdout/stdin are not suitable for a full-screen TUI or terminal capability checks fail

This should build on the existing live-surface/runtime observation work instead of replacing it: the TUI should consume the same typed chat/runtime state and observer signals, but render them through a dedicated terminal shell.

Related but not duplicate:

Non-goals / out of scope

  • Do not change the default loongclaw chat behavior away from the current text path in the first iteration.
  • Do not redesign loongclaw ask or other one-shot stdout contracts.
  • Do not introduce a multi-session/operator-console dashboard in v1.
  • Do not move terminal rendering ownership into loongclaw-daemon; CLI flag parsing there is enough.
  • Do not require a web UI, browser runtime, or external JS stack.
  • Do not replace the current shared screen-spec renderer; keep it as the compatible fallback and non-TUI path.

Alternatives considered

  • Continue extending the current shared text/screen-spec surface only. This keeps scope smaller, but it cannot provide a persistent transcript/composer/execution layout without bending a line-oriented renderer into a second job it was not designed for.
  • Build an operator-first multi-pane dashboard immediately. This would improve raw observability, but it overweights background state and pulls the product away from the conversation-first interactive chat experience.
  • Route the next UX step into a browser or local web launcher instead of a terminal TUI. That may still be useful for onboarding or operator control planes, but it does not solve the need for a native interactive terminal chat shell.

Acceptance criteria

  • loongclaw chat --ui tui launches an interactive full-screen terminal shell while loongclaw chat and loongclaw chat --ui text preserve the current text behavior.
  • The TUI keeps the conversation transcript as the primary persistent surface and includes a composer for interactive input.
  • Tool/runtime activity remains visible through a compact execution band without forcing a permanent multi-pane dashboard.
  • Approval requests and execution errors auto-surface richer detail, and users can inspect tool output or diffs via an inline drawer.
  • Non-interactive or incompatible terminal environments degrade safely to the existing text mode instead of failing unpredictably.
  • Workspace tests, all-features tests, and clippy remain green after the change.

Policy / security / breaking sensitivity

No, this looks routine

Rollout / rollback notes

Land the first iteration behind the explicit --ui tui selector only. Keep --ui text as the default and compatibility path. If regressions appear, disable or revert the TUI-specific path without disturbing the existing shared text/screen-spec surfaces.

Impact

Affected users: operators using loongclaw chat for sustained interactive sessions
Frequency: every interactive chat session that outgrows the current line-oriented surface
Consequence if missing: LoongClaw keeps improving chat status visibility incrementally, but still lacks a cohesive transcript-first terminal shell for daily interactive use.

Submission checks

  • I searched existing issues and did not find the same request already tracked.
  • I used project-scoped wording and removed secrets or private data from examples.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesttriageNeeds maintainer routing or follow-up.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions