[tui] Rework TUI with CLI-style command flow - #10
Conversation
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
There was a problem hiding this comment.
💡 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() |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
.envmodel and package version before agent initialization./help,/clear,/skills,/model, and/exit, including filtering, arrow-key navigation, and Tab completion.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 passedgit diff --check-> clean