tui: clarify import picker focus

This commit is contained in:
stefanstokic-oai
2026-06-09 11:43:38 -04:00
parent 753e41154e
commit ff65430ccd
6 changed files with 108 additions and 10 deletions

View File

@@ -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();

View File

@@ -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(),

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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