fix(tui): sort skill mentions by display name first#16710
Merged
fcoury-oai merged 5 commits intomainfrom Apr 3, 2026
Merged
Conversation
Preserve the `interface.display_name` match score when filtering skill mentions in the composer popup, and only fall back to secondary `search_terms` when the display name does not match. Add a regression test covering `PR Babysitter`, whose canonical `babysit-pr` name previously pushed it below weaker visible-label matches.
Sort mention popup results by fuzzy-match score before `sort_rank` when the user has typed a non-empty query, so weaker plugin matches no longer stay above stronger skill matches. Keep the existing plugin-first grouping for the empty-query state and add regression coverage for `$pr` returning `PR Babysitter` before a weaker plugin match.
Annotate the positional `sort_rank` literals in the mention popup test helpers so Bazel argument-comment lint accepts the new regression coverage. This keeps the plugin-vs-skill ordering test in place while fixing the PR-only CI break introduced by the helper refactor.
Adjust the mention popup regression fixture so the plugin row also matches `$pr` via search terms, which mirrors the real composer scenario from the screenshot. This keeps the assertion focused on the intended behavior: the plugin still appears, but it no longer outranks the stronger skill match.
Rank alias-only mention matches behind display-name matches for non-empty popup queries, so plugin search terms do not outrank the visible skill labels users are actually typing for. This fixes the `$pr` case where a plugin could stay above `PR Babysitter` even though the plugin only matched through fallback search terms.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The skill list opened by '$' shows
interface.display_namepreferably if available but the sorting order of the search results use theskill.namefor sorting the results regardless.This can be clearly seen in this example below: I expected with "pr" as the search term to have "PR Babysitter" be the first item, but instead it's way down the list.
The reason is because "PR Babysitter" skill name is "babysit-pr" and therefore it doesn't rank as high as "pr-review-triage".
This PR fixes this behavior.
Testing
just fmtcargo test -p codex-tui bottom_pane::skill_popup::tests::display_name_match_sorting_beats_worse_secondary_search_term_matches --lib -- --exactcargo test -p codex-tui