Rename tui_app_server to tui (#16104)

This is a follow-up to https://github.com/openai/codex/pull/15922. That
previous PR deleted the old `tui` directory and left the new
`tui_app_server` directory in place. This PR renames `tui_app_server` to
`tui` and fixes up all references.
This commit is contained in:
Eric Traut
2026-03-28 11:23:07 -06:00
committed by GitHub
parent 3d1abf3f3d
commit 61429a6c10
1128 changed files with 151 additions and 3814 deletions

View File

@@ -35,9 +35,9 @@ In the codex-rs folder where the rust code lives:
- If a file exceeds roughly 800 LoC, add new functionality in a new module instead of extending
the existing file unless there is a strong documented reason not to.
- This rule applies especially to high-touch files that already attract unrelated changes, such
as `codex-rs/tui_app_server/src/app.rs`, `codex-rs/tui_app_server/src/bottom_pane/chat_composer.rs`,
`codex-rs/tui_app_server/src/bottom_pane/footer.rs`, `codex-rs/tui_app_server/src/chatwidget.rs`,
`codex-rs/tui_app_server/src/bottom_pane/mod.rs`, and similarly central orchestration modules.
as `codex-rs/tui/src/app.rs`, `codex-rs/tui/src/bottom_pane/chat_composer.rs`,
`codex-rs/tui/src/bottom_pane/footer.rs`, `codex-rs/tui/src/chatwidget.rs`,
`codex-rs/tui/src/bottom_pane/mod.rs`, and similarly central orchestration modules.
- When extracting code from a large module, move the related tests and module/type docs toward
the new implementation so the invariants stay close to the code that owns them.
- When running Rust commands (e.g. `just fix` or `cargo test`) be patient with the command and never try to kill them using the PID. Rust lock can make the execution slow, this is expected.
@@ -66,12 +66,10 @@ Likewise, when reviewing code, do not hesitate to push back on PRs that would un
## TUI style conventions
See `codex-rs/tui_app_server/styles.md`.
See `codex-rs/tui/styles.md`.
## TUI code conventions
- When a change lands in `codex-rs/tui` and `codex-rs/tui_app_server` has a parallel implementation of the same behavior, reflect the change in `codex-rs/tui_app_server` too unless there is a documented reason not to.
- Use concise styling helpers from ratatuis Stylize trait.
- Basic spans: use "text".into()
- Styled spans: use "text".red(), "text".green(), "text".magenta(), "text".dim(), etc.

View File

@@ -49,7 +49,7 @@ members = [
"sandboxing",
"stdio-to-uds",
"otel",
"tui_app_server",
"tui",
"tools",
"v8-poc",
"utils/absolute-path",
@@ -149,7 +149,7 @@ codex-state = { path = "state" }
codex-stdio-to-uds = { path = "stdio-to-uds" }
codex-terminal-detection = { path = "terminal-detection" }
codex-tools = { path = "tools" }
codex-tui = { path = "tui_app_server" }
codex-tui = { path = "tui" }
codex-v8-poc = { path = "v8-poc" }
codex-utils-absolute-path = { path = "utils/absolute-path" }
codex-utils-approval-presets = { path = "utils/approval-presets" }

View File

@@ -24,10 +24,10 @@ use codex_execpolicy::ExecPolicyCheckCommand;
use codex_responses_api_proxy::Args as ResponsesApiProxyArgs;
use codex_state::StateRuntime;
use codex_state::state_db_path;
use codex_tui_app_server::AppExitInfo;
use codex_tui_app_server::Cli as TuiCli;
use codex_tui_app_server::ExitReason;
use codex_tui_app_server::update_action::UpdateAction;
use codex_tui::AppExitInfo;
use codex_tui::Cli as TuiCli;
use codex_tui::ExitReason;
use codex_tui::update_action::UpdateAction;
use codex_utils_cli::CliConfigOverrides;
use owo_colors::OwoColorize;
use std::io::IsTerminal;
@@ -1228,7 +1228,7 @@ async fn run_interactive_tui(
let normalized_remote = remote
.as_deref()
.map(codex_tui_app_server::normalize_remote_addr)
.map(codex_tui::normalize_remote_addr)
.transpose()
.map_err(std::io::Error::other)?;
if remote_auth_token_env.is_some() && normalized_remote.is_none() {
@@ -1241,7 +1241,7 @@ async fn run_interactive_tui(
.map(read_remote_auth_token_from_env_var)
.transpose()
.map_err(std::io::Error::other)?;
codex_tui_app_server::run_main(
codex_tui::run_main(
interactive,
arg0_paths,
codex_core::config_loader::LoaderOverrides::default(),

View File

@@ -931,7 +931,7 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
if page.composer.flush_paste_burst_if_due() { needs_redraw = true; }
if page.composer.is_in_paste_burst() {
let _ = frame_tx
.send(Instant::now() + codex_tui_app_server::ComposerInput::recommended_flush_delay());
.send(Instant::now() + codex_tui::ComposerInput::recommended_flush_delay());
}
}
// Keep spinner pulsing only while loading.
@@ -1492,7 +1492,7 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
_ => {
if page.submitting {
// Ignore input while submitting
} else if let codex_tui_app_server::ComposerAction::Submitted(text) =
} else if let codex_tui::ComposerAction::Submitted(text) =
page.composer.input(key)
{
// Submit only if we have an env id
@@ -1526,7 +1526,7 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
if page.composer.is_in_paste_burst() {
let _ = frame_tx.send(
Instant::now()
+ codex_tui_app_server::ComposerInput::recommended_flush_delay(),
+ codex_tui::ComposerInput::recommended_flush_delay(),
);
}
// Always schedule an immediate redraw for key edits in the composer.
@@ -2136,8 +2136,8 @@ mod tests {
use codex_cloud_tasks_client::TaskId;
use codex_cloud_tasks_client::TaskStatus;
use codex_cloud_tasks_client::TaskSummary;
use codex_tui_app_server::ComposerAction;
use codex_tui_app_server::ComposerInput;
use codex_tui::ComposerAction;
use codex_tui::ComposerInput;
use crossterm::event::KeyCode;
use crossterm::event::KeyEvent;
use crossterm::event::KeyModifiers;

View File

@@ -1,4 +1,4 @@
use codex_tui_app_server::ComposerInput;
use codex_tui::ComposerInput;
pub struct NewTaskPage {
pub composer: ComposerInput,

View File

@@ -23,7 +23,7 @@ use crate::app::AttemptView;
use crate::util::format_relative_time_now;
use codex_cloud_tasks_client::AttemptStatus;
use codex_cloud_tasks_client::TaskStatus;
use codex_tui_app_server::render_markdown_text;
use codex_tui::render_markdown_text;
pub fn draw(frame: &mut Frame, app: &mut App) {
let area = frame.area();

View File

@@ -1,8 +1,8 @@
load("//:defs.bzl", "codex_rust_crate")
codex_rust_crate(
name = "tui_app_server",
crate_name = "codex_tui_app_server",
name = "tui",
crate_name = "codex_tui",
compile_data = glob(
include = ["**"],
exclude = [

View File

@@ -6,19 +6,15 @@ license.workspace = true
autobins = false
[[bin]]
name = "codex-tui-app-server"
name = "codex-tui"
path = "src/main.rs"
[[bin]]
name = "codex-tui"
path = "src/bin/codex-tui.rs"
[[bin]]
name = "md-events-app-server"
name = "md-events"
path = "src/bin/md-events.rs"
[lib]
name = "codex_tui_app_server"
name = "codex_tui"
path = "src/lib.rs"
[features]

Some files were not shown because too many files have changed in this diff Show More