Skip to content

[tui] Rework TUI with CLI-style command flow - #10

Merged
hzhaoy merged 1 commit into
mainfrom
tui-cli-style-slash-commands
Jul 2, 2026
Merged

[tui] Rework TUI with CLI-style command flow#10
hzhaoy merged 1 commit into
mainfrom
tui-cli-style-slash-commands

Conversation

@hzhaoy

@hzhaoy hzhaoy commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Reworked the Textual TUI into a transcript-first CLI-style layout with a compact session header, full-width chat log, status row, and bottom composer.
  • Fixed TUI startup metadata so the header/status can read the project .env model and package version before agent initialization.
  • Added local slash commands for /help, /clear, /skills, /model, and /exit, including filtering, arrow-key navigation, and Tab completion.
  • Updated TUI widgets and tests for local command handling, approval display, tool call rendering, Enter-to-send behavior, and slash command suggestions.

Why

The previous TUI felt heavy and did not match the smoother command-agent interaction expected from modern terminal coding assistants. This change keeps the existing Textual stack but makes the first screen quieter, faster to scan, and keyboard-oriented.

Validation

  • uv run pytest -> 113 passed
  • git diff --check -> clean

Reshape the Textual interface around a transcript-first flow, fix TUI startup metadata from dotenv, and keep common slash commands local so exit, clear, help, and model commands do not reach the agent. The composer now sends on Enter, shows slash command suggestions, supports arrow navigation, and completes the selected command with Tab.

Constraint: Keep the existing Textual dependency and avoid adding packages
Rejected: Keep the multiline TextArea composer | Enter-to-send and slash completion need single-line prompt semantics
Confidence: high
Scope-risk: moderate
Directive: Slash commands are local TUI commands; do not forward exact local command aliases to the agent
Tested: uv run pytest
Tested: git diff --check
@hzhaoy
hzhaoy marked this pull request as ready for review July 2, 2026 11:49
@hzhaoy
hzhaoy merged commit 5ec5514 into main Jul 2, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79cfc06ebd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

def action_clear_chat(self) -> None:
"""Clear the conversation stream."""
chat_log = self.get_chat_log()
chat_log.clear_messages()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Disable clearing while a stream is active

Because the new Ctrl+L binding remains active while the input is disabled, a user can clear the transcript during an in-flight agent response or tool call. This removes the mounted message/tool widgets, but AgentBridge still keeps _streaming_bubble and pending tool widget references, so subsequent chunks/results update detached widgets and the rest of the current response disappears from the chat log. Guard this action while the status is working/streaming/waiting, or reset the bridge state when clearing.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant