From ff65430ccd8e8fd3ed55c0a106bfb2f6e7b993c2 Mon Sep 17 00:00:00 2001 From: stefanstokic-oai Date: Tue, 9 Jun 2026 11:43:38 -0400 Subject: [PATCH] tui: clarify import picker focus --- .../src/external_agent_config_migration.rs | 38 ++++++++++++++++--- .../external_agent_config_migration/render.rs | 14 +++++++ ...rnal_agent_config_migration_customize.snap | 4 +- ...ent_config_migration_customize_action.snap | 29 ++++++++++++++ ...ig_migration_customize_action_windows.snap | 29 ++++++++++++++ ...nt_config_migration_customize_windows.snap | 4 +- 6 files changed, 108 insertions(+), 10 deletions(-) create mode 100644 codex-rs/tui/src/snapshots/codex_tui__external_agent_config_migration__tests__external_agent_config_migration_customize_action.snap create mode 100644 codex-rs/tui/src/snapshots/codex_tui__external_agent_config_migration__tests__external_agent_config_migration_customize_action_windows.snap diff --git a/codex-rs/tui/src/external_agent_config_migration.rs b/codex-rs/tui/src/external_agent_config_migration.rs index ff3bb503fd..dfa1e15b15 100644 --- a/codex-rs/tui/src/external_agent_config_migration.rs +++ b/codex-rs/tui/src/external_agent_config_migration.rs @@ -44,7 +44,7 @@ impl ActionMenuOption { Self::Proceed => "Import selected", Self::Customize => "Customize selection", Self::Skip => "Cancel", - Self::Back => "Done customizing", + Self::Back => "Review selection", } } } @@ -640,11 +640,15 @@ impl ExternalAgentConfigMigrationScreen { lines.push(RenderLineEntry { item_idx: Some(idx), kind: RenderLineKind::Item, - line: Line::from(format!( - " [{}] {}", - if item.enabled { "x" } else { " " }, - external_agent_config_migration_item_label(&item.item) - )), + line: Line::from(vec![ + " ".into(), + format!( + "[{}] {}", + if item.enabled { "x" } else { " " }, + external_agent_config_migration_item_label(&item.item) + ) + .into(), + ]), }); lines.push(RenderLineEntry { item_idx: None, @@ -845,6 +849,28 @@ mod tests { assert_snapshot!("external_agent_config_migration_customize", rendered); } + #[test] + fn customize_action_snapshot() { + let items = sample_items(); + let mut screen = ExternalAgentConfigMigrationScreen::new( + FrameRequester::test_dummy(), + &items, + &items, + /*error*/ None, + ); + screen.customize(); + screen.move_up(); + + let rendered = render_screen(&screen, /*width*/ 80, /*height*/ 30); + #[cfg(windows)] + assert_snapshot!( + "external_agent_config_migration_customize_action_windows", + rendered + ); + #[cfg(not(windows))] + assert_snapshot!("external_agent_config_migration_customize_action", rendered); + } + #[test] fn proceed_returns_selected_items() { let items = sample_items(); diff --git a/codex-rs/tui/src/external_agent_config_migration/render.rs b/codex-rs/tui/src/external_agent_config_migration/render.rs index 5c49eee125..e0e4926a9e 100644 --- a/codex-rs/tui/src/external_agent_config_migration/render.rs +++ b/codex-rs/tui/src/external_agent_config_migration/render.rs @@ -44,6 +44,9 @@ impl ExternalAgentConfigMigrationScreen { self.focus == FocusArea::Items && self.selected_item_idx == entry.item_idx; let mut line = entry.line.clone(); if selected { + if let Some(cursor) = line.spans.first_mut() { + cursor.content = "› ".into(); + } line.spans.iter_mut().for_each(|span| { span.style = span.style.cyan().bold(); }); @@ -175,6 +178,17 @@ impl WidgetRef for &ExternalAgentConfigMigrationScreen { "c".cyan(), " to customize".dim(), ]), + MigrationView::Customize if self.focus == FocusArea::Actions => Line::from(vec![ + "Press ".dim(), + key_hint::plain(KeyCode::Enter).into(), + " to continue, ".dim(), + key_hint::plain(KeyCode::Up).into(), + "/".dim(), + key_hint::plain(KeyCode::Down).into(), + " to move, ".dim(), + "b".cyan(), + " to go back".dim(), + ]), MigrationView::Customize => Line::from(vec![ "Use ".dim(), key_hint::plain(KeyCode::Up).into(), diff --git a/codex-rs/tui/src/snapshots/codex_tui__external_agent_config_migration__tests__external_agent_config_migration_customize.snap b/codex-rs/tui/src/snapshots/codex_tui__external_agent_config_migration__tests__external_agent_config_migration_customize.snap index e3fa159a81..8809334281 100644 --- a/codex-rs/tui/src/snapshots/codex_tui__external_agent_config_migration__tests__external_agent_config_migration_customize.snap +++ b/codex-rs/tui/src/snapshots/codex_tui__external_agent_config_migration__tests__external_agent_config_migration_customize.snap @@ -8,7 +8,7 @@ expression: rendered Codex may add files to your current project folder. Your existing Claude Code setup will not be changed. Home - [x] Settings (settings.json -> config.toml) + › [x] Settings (settings.json -> config.toml) Import /Users/alex/.claude/settings.json into /Users/alex/.codex/conf… [x] Recent chat sessions Import recent Claude Code sessions @@ -25,5 +25,5 @@ expression: rendered Import CLAUDE.md to AGENTS.md Selected 4 of 4 items. - 1. Done customizing + 1. Review selection Use ↑/↓ to move, space to toggle, b to go back diff --git a/codex-rs/tui/src/snapshots/codex_tui__external_agent_config_migration__tests__external_agent_config_migration_customize_action.snap b/codex-rs/tui/src/snapshots/codex_tui__external_agent_config_migration__tests__external_agent_config_migration_customize_action.snap new file mode 100644 index 0000000000..70132d75ae --- /dev/null +++ b/codex-rs/tui/src/snapshots/codex_tui__external_agent_config_migration__tests__external_agent_config_migration_customize_action.snap @@ -0,0 +1,29 @@ +--- +source: tui/src/external_agent_config_migration.rs +expression: rendered +--- + + > Choose what to import + Choose the Claude Code items to import. + Codex may add files to your current project folder. + Your existing Claude Code setup will not be changed. + Home + [x] Settings (settings.json -> config.toml) + Import /Users/alex/.claude/settings.json into /Users/alex/.codex/conf… + [x] Recent chat sessions + Import recent Claude Code sessions + 1 chat session: Investigate migration UX + + Current project: /workspace/project + [x] Plugins + Import enabled plugins from .claude/settings.json (4 marketplaces, 6 … + • acme-tools: deployer, formatter, +1 more + • team-marketplace: asana + • debug: sample + • +1 more marketplaces + [x] Instructions (CLAUDE.md -> AGENTS.md) + Import CLAUDE.md to AGENTS.md + + Selected 4 of 4 items. + › 1. Review selection + Press enter to continue, ↑/↓ to move, b to go back diff --git a/codex-rs/tui/src/snapshots/codex_tui__external_agent_config_migration__tests__external_agent_config_migration_customize_action_windows.snap b/codex-rs/tui/src/snapshots/codex_tui__external_agent_config_migration__tests__external_agent_config_migration_customize_action_windows.snap new file mode 100644 index 0000000000..48dfe2e22b --- /dev/null +++ b/codex-rs/tui/src/snapshots/codex_tui__external_agent_config_migration__tests__external_agent_config_migration_customize_action_windows.snap @@ -0,0 +1,29 @@ +--- +source: tui/src/external_agent_config_migration.rs +expression: rendered +--- + + > Choose what to import + Choose the Claude Code items to import. + Codex may add files to your current project folder. + Your existing Claude Code setup will not be changed. + Home + [x] Settings (settings.json -> config.toml) + Import /Users/alex/.claude/settings.json into /Users/alex/.codex/conf… + [x] Recent chat sessions + Import recent Claude Code sessions + 1 chat session: Investigate migration UX + + Current project: C:\workspace\project + [x] Plugins + Import enabled plugins from .claude/settings.json (4 marketplaces, 6 … + • acme-tools: deployer, formatter, +1 more + • team-marketplace: asana + • debug: sample + • +1 more marketplaces + [x] Instructions (CLAUDE.md -> AGENTS.md) + Import CLAUDE.md to AGENTS.md + + Selected 4 of 4 items. + › 1. Review selection + Press enter to continue, ↑/↓ to move, b to go back diff --git a/codex-rs/tui/src/snapshots/codex_tui__external_agent_config_migration__tests__external_agent_config_migration_customize_windows.snap b/codex-rs/tui/src/snapshots/codex_tui__external_agent_config_migration__tests__external_agent_config_migration_customize_windows.snap index 01885b909a..db6c14a0ca 100644 --- a/codex-rs/tui/src/snapshots/codex_tui__external_agent_config_migration__tests__external_agent_config_migration_customize_windows.snap +++ b/codex-rs/tui/src/snapshots/codex_tui__external_agent_config_migration__tests__external_agent_config_migration_customize_windows.snap @@ -8,7 +8,7 @@ expression: rendered Codex may add files to your current project folder. Your existing Claude Code setup will not be changed. Home - [x] Settings (settings.json -> config.toml) + › [x] Settings (settings.json -> config.toml) Import /Users/alex/.claude/settings.json into /Users/alex/.codex/conf… [x] Recent chat sessions Import recent Claude Code sessions @@ -25,5 +25,5 @@ expression: rendered Import CLAUDE.md to AGENTS.md Selected 4 of 4 items. - 1. Done customizing + 1. Review selection Use ↑/↓ to move, space to toggle, b to go back