Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions codex-rs/tui/src/bottom_pane/chat_composer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3580,6 +3580,7 @@ impl ChatComposer {
search_terms,
path: Some(skill.path_to_skills_md.to_string_lossy().into_owned()),
category_tag: Some("[Skill]".to_string()),
sort_rank: 1,
});
}
}
Expand Down Expand Up @@ -3631,6 +3632,7 @@ impl ChatComposer {
search_terms,
path: Some(format!("plugin://{}", plugin.config_name)),
category_tag: Some("[Plugin]".to_string()),
sort_rank: 0,
});
}
}
Expand All @@ -3654,6 +3656,7 @@ impl ChatComposer {
search_terms,
path: Some(format!("app://{connector_id}")),
category_tag: Some("[App]".to_string()),
sort_rank: 1,
});
}
}
Expand Down
23 changes: 13 additions & 10 deletions codex-rs/tui/src/bottom_pane/skill_popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub(crate) struct MentionItem {
pub(crate) search_terms: Vec<String>,
pub(crate) path: Option<String>,
pub(crate) category_tag: Option<String>,
pub(crate) sort_rank: u8,
}

const MENTION_NAME_TRUNCATE_LEN: usize = 24;
Expand Down Expand Up @@ -130,14 +131,12 @@ impl SkillPopup {
let filter = self.query.trim();
let mut out: Vec<(usize, Option<Vec<usize>>, i32)> = Vec::new();

if filter.is_empty() {
for (idx, _mention) in self.mentions.iter().enumerate() {
for (idx, mention) in self.mentions.iter().enumerate() {
if filter.is_empty() {
out.push((idx, None, 0));
continue;
}
return out;
}

for (idx, mention) in self.mentions.iter().enumerate() {
let mut best_match: Option<(Option<Vec<usize>>, i32)> = None;

if let Some((indices, score)) = fuzzy_match(&mention.display_name, filter) {
Expand Down Expand Up @@ -170,11 +169,15 @@ impl SkillPopup {
}

out.sort_by(|a, b| {
a.2.cmp(&b.2).then_with(|| {
let an = self.mentions[a.0].display_name.as_str();
let bn = self.mentions[b.0].display_name.as_str();
an.cmp(bn)
})
self.mentions[a.0]
.sort_rank
.cmp(&self.mentions[b.0].sort_rank)
.then_with(|| a.2.cmp(&b.2))
.then_with(|| {
let an = self.mentions[a.0].display_name.as_str();
let bn = self.mentions[b.0].display_name.as_str();
an.cmp(bn)
})
});

out
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ expression: terminal.backend()
"› $goog "
" "
" "
" Google Calendar [Skill] Find availability and plan event changes "
" Google Calendar [Plugin] Connect Google Calendar for scheduling, ava…"
" Google Calendar [Skill] Find availability and plan event changes "
" Google Calendar [App] Look up events and availability "
" "
" Press enter to insert or esc to close "
Loading