mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
a2c86e5d8830006cb30c9367d70f4f84ef3bb6cc
2 Commits
-
Sync tui2 with tui and keep dual-run glue (#7965)
- Copy latest tui sources into tui2 - Restore notifications, tests, and styles - Keep codex-tui interop conversions and snapshots The expected changes that are necessary to make this work are still in place: diff -ru codex-rs/tui codex-rs/tui2 --exclude='*.snap' --exclude='*.snap.new' ```diff diff -ru --ex codex-rs/tui/Cargo.toml codex-rs/tui2/Cargo.toml --- codex-rs/tui/Cargo.toml 2025-12-12 16:39:12 +++ codex-rs/tui2/Cargo.toml 2025-12-12 17:31:01 @@ -1,15 +1,15 @@ [package] -name = "codex-tui" +name = "codex-tui2" version.workspace = true edition.workspace = true license.workspace = true [[bin]] -name = "codex-tui" +name = "codex-tui2" path = "src/main.rs" [lib] -name = "codex_tui" +name = "codex_tui2" path = "src/lib.rs" [features] @@ -42,6 +42,7 @@ codex-login = { workspace = true } codex-protocol = { workspace = true } codex-utils-absolute-path = { workspace = true } +codex-tui = { workspace = true } color-eyre = { workspace = true } crossterm = { workspace = true, features = ["bracketed-paste", "event-stream"] } derive_more = { workspace = true, features = ["is_variant"] } diff -ru --ex codex-rs/tui/src/app.rs codex-rs/tui2/src/app.rs --- codex-rs/tui/src/app.rs 2025-12-12 16:39:05 +++ codex-rs/tui2/src/app.rs 2025-12-12 17:30:36 @@ -69,6 +69,16 @@ pub update_action: Option<UpdateAction>, } +impl From<AppExitInfo> for codex_tui::AppExitInfo { + fn from(info: AppExitInfo) -> Self { + codex_tui::AppExitInfo { + token_usage: info.token_usage, + conversation_id: info.conversation_id, + update_action: info.update_action.map(Into::into), + } + } +} + fn session_summary( token_usage: TokenUsage, conversation_id: Option<ConversationId>, Only in codex-rs/tui/src/bin: md-events.rs Only in codex-rs/tui2/src/bin: md-events2.rs diff -ru --ex codex-rs/tui/src/cli.rs codex-rs/tui2/src/cli.rs --- codex-rs/tui/src/cli.rs 2025-11-19 13:40:42 +++ codex-rs/tui2/src/cli.rs 2025-12-12 17:30:43 @@ -88,3 +88,28 @@ #[clap(skip)] pub config_overrides: CliConfigOverrides, } + +impl From<codex_tui::Cli> for Cli { + fn from(cli: codex_tui::Cli) -> Self { + Self { + prompt: cli.prompt, + images: cli.images, + resume_picker: cli.resume_picker, + resume_last: cli.resume_last, + resume_session_id: cli.resume_session_id, + resume_show_all: cli.resume_show_all, + model: cli.model, + oss: cli.oss, + oss_provider: cli.oss_provider, + config_profile: cli.config_profile, + sandbox_mode: cli.sandbox_mode, + approval_policy: cli.approval_policy, + full_auto: cli.full_auto, + dangerously_bypass_approvals_and_sandbox: cli.dangerously_bypass_approvals_and_sandbox, + cwd: cli.cwd, + web_search: cli.web_search, + add_dir: cli.add_dir, + config_overrides: cli.config_overrides, + } + } +} diff -ru --ex codex-rs/tui/src/main.rs codex-rs/tui2/src/main.rs --- codex-rs/tui/src/main.rs 2025-12-12 16:39:05 +++ codex-rs/tui2/src/main.rs 2025-12-12 16:39:06 @@ -1,8 +1,8 @@ use clap::Parser; use codex_arg0::arg0_dispatch_or_else; use codex_common::CliConfigOverrides; -use codex_tui::Cli; -use codex_tui::run_main; +use codex_tui2::Cli; +use codex_tui2::run_main; #[derive(Parser, Debug)] struct TopCli { diff -ru --ex codex-rs/tui/src/update_action.rs codex-rs/tui2/src/update_action.rs --- codex-rs/tui/src/update_action.rs 2025-11-19 11:11:47 +++ codex-rs/tui2/src/update_action.rs 2025-12-12 17:30:48 @@ -9,6 +9,20 @@ BrewUpgrade, } +impl From<UpdateAction> for codex_tui::update_action::UpdateAction { + fn from(action: UpdateAction) -> Self { + match action { + UpdateAction::NpmGlobalLatest => { + codex_tui::update_action::UpdateAction::NpmGlobalLatest + } + UpdateAction::BunGlobalLatest => { + codex_tui::update_action::UpdateAction::BunGlobalLatest + } + UpdateAction::BrewUpgrade => codex_tui::update_action::UpdateAction::BrewUpgrade, + } + } +} + impl UpdateAction { /// Returns the list of command-line arguments for invoking the update. pub fn command_args(self) -> (&'static str, &'static [&'static str]) { ```Josh McKinney ·
2025-12-12 20:46:18 -08:00 -
feat(tui2): copy tui crate and normalize snapshots (#7833)
Introduce a full codex-tui source snapshot under the new codex-tui2 crate so viewport work can be replayed in isolation. This change copies the entire codex-rs/tui/src tree into codex-rs/tui2/src in one atomic step, rather than piecemeal, to keep future diffs vs the original viewport bookmark easy to reason about. The goal is for codex-tui2 to render identically to the existing TUI behind the `features.tui2` flag while we gradually port the viewport/history commits from the joshka/viewport bookmark onto this forked tree. While on this baseline change, we also ran the codex-tui2 snapshot test suite and accepted all insta snapshots for the new crate, so the snapshot files now use the codex-tui2 naming scheme and encode the unmodified legacy TUI behavior. This keeps later viewport commits focused on intentional behavior changes (and their snapshots) rather than on mechanical snapshot renames.
Josh McKinney ·
2025-12-10 22:53:46 +00:00