From a0e778795ce64864e11cb024cac0ca74594a57a5 Mon Sep 17 00:00:00 2001 From: Charles Cunningham Date: Thu, 15 Jan 2026 18:17:14 -0800 Subject: [PATCH] Remove diff --- codex-rs/tui/src/chatwidget.rs | 1 + codex-rs/tui/src/lib.rs | 19 ++++++----- codex-rs/tui2/src/bottom_pane/skill_popup.rs | 36 +++++++++++++++----- codex-rs/tui2/src/chatwidget.rs | 1 + codex-rs/tui2/src/lib.rs | 19 ++++++----- 5 files changed, 49 insertions(+), 27 deletions(-) diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs index 5850969137..117d947ac9 100644 --- a/codex-rs/tui/src/chatwidget.rs +++ b/codex-rs/tui/src/chatwidget.rs @@ -4781,6 +4781,7 @@ fn skills_for_cwd(cwd: &Path, skills_entries: &[SkillsListEntry]) -> Vec page - .items - .first() - .map(|it| resume_picker::SessionSelection::Resume(it.path.clone())) - .unwrap_or(resume_picker::SessionSelection::StartFresh), - Err(_) => resume_picker::SessionSelection::StartFresh, + Ok(Some(path)) => resume_picker::SessionSelection::Resume(path), + _ => resume_picker::SessionSelection::StartFresh, } } else if cli.resume_picker { match resume_picker::run_resume_picker( diff --git a/codex-rs/tui2/src/bottom_pane/skill_popup.rs b/codex-rs/tui2/src/bottom_pane/skill_popup.rs index faf386e29c..d4d4a6828f 100644 --- a/codex-rs/tui2/src/bottom_pane/skill_popup.rs +++ b/codex-rs/tui2/src/bottom_pane/skill_popup.rs @@ -87,12 +87,8 @@ impl SkillPopup { .into_iter() .map(|(idx, indices, _score)| { let skill = &self.skills[idx]; - let name = truncate_text(&skill.name, 21); - let description = skill - .short_description - .as_ref() - .unwrap_or(&skill.description) - .clone(); + let name = truncate_text(skill_display_name(skill), 21); + let description = skill_description(skill).to_string(); GenericDisplayRow { name, match_indices: indices, @@ -116,15 +112,20 @@ impl SkillPopup { } for (idx, skill) in self.skills.iter().enumerate() { - if let Some((indices, score)) = fuzzy_match(&skill.name, filter) { + let display_name = skill_display_name(skill); + if let Some((indices, score)) = fuzzy_match(display_name, filter) { out.push((idx, Some(indices), score)); + } else if display_name != skill.name + && let Some((_indices, score)) = fuzzy_match(&skill.name, filter) + { + out.push((idx, None, score)); } } out.sort_by(|a, b| { a.2.cmp(&b.2).then_with(|| { - let an = &self.skills[a.0].name; - let bn = &self.skills[b.0].name; + let an = skill_display_name(&self.skills[a.0]); + let bn = skill_display_name(&self.skills[b.0]); an.cmp(bn) }) }); @@ -176,3 +177,20 @@ fn skill_popup_hint_line() -> Line<'static> { " to close".into(), ]) } + +fn skill_display_name(skill: &SkillMetadata) -> &str { + skill + .interface + .as_ref() + .and_then(|interface| interface.display_name.as_deref()) + .unwrap_or(&skill.name) +} + +fn skill_description(skill: &SkillMetadata) -> &str { + skill + .interface + .as_ref() + .and_then(|interface| interface.short_description.as_deref()) + .or(skill.short_description.as_deref()) + .unwrap_or(&skill.description) +} diff --git a/codex-rs/tui2/src/chatwidget.rs b/codex-rs/tui2/src/chatwidget.rs index cd408df51b..70332704f5 100644 --- a/codex-rs/tui2/src/chatwidget.rs +++ b/codex-rs/tui2/src/chatwidget.rs @@ -4493,6 +4493,7 @@ fn skills_for_cwd(cwd: &Path, skills_entries: &[SkillsListEntry]) -> Vec page - .items - .first() - .map(|it| resume_picker::SessionSelection::Resume(it.path.clone())) - .unwrap_or(resume_picker::SessionSelection::StartFresh), - Err(_) => resume_picker::SessionSelection::StartFresh, + Ok(Some(path)) => resume_picker::SessionSelection::Resume(path), + _ => resume_picker::SessionSelection::StartFresh, } } else if cli.resume_picker { match resume_picker::run_resume_picker(