Skip to content

feat(app): add abbreviation matching to model selector search - #39355

Open
DevDengChao wants to merge 1 commit into
anomalyco:devfrom
DevDengChao:model-search-abbreviation
Open

feat(app): add abbreviation matching to model selector search#39355
DevDengChao wants to merge 1 commit into
anomalyco:devfrom
DevDengChao:model-search-abbreviation

Conversation

@DevDengChao

@DevDengChao DevDengChao commented Jul 28, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #39346

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The model selector search only supported exact substring matching and compact (no-separator) matching. When the model list contains similar names like Deepseek V4 Flash Free, Deepseek V4 Flash, and Deepseek V4 Pro, users had to type the full name or enough unique characters to disambiguate.

This adds abbreviation matching as a fallback: the query is walked against model name words, where each segment of the query can be a prefix of a word or just the word's initial letter. Skipped words are allowed.

Examples:

  • deepff → Deepseek V4 Flash Free (deep→Deepseek + f→Flash + f→Free)
  • deepp → Deepseek V4 Pro (deep→Deepseek + p→Pro)
  • dvff → Deepseek V4 Flash Free (d→Deepseek + v→V4 + f→Flash + f→Free)

The algorithm is a recursive walk: for each word, try matching 1 to N characters as a prefix of that word, then recurse on the remaining query and next word. Words can also be skipped. This is tried after existing spaced-normalized and compact substring matching, so all current search behavior is preserved.

How did you verify your code works?

  • bun test dialog-select-model-search — all 5 tests pass (2 new abbreviation tests added)
  • bun typecheck — passes
  • Full test suite — 688 pass, 1 pre-existing i18n failure (unrelated)

Screenshots / recordings

This is not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Supports word-prefix and word-initial abbreviation matching in the model
selector search. Users can now type shorthand like 'deepff' to find
'Deepseek V4 Flash Free' or 'deepp' for 'Deepseek V4 Pro'.

The matching algorithm walks through model name words trying each possible
prefix length, allowing queries to mix full word prefixes and single-letter
initials with skipped words in between.

Closes anomalyco#39346
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Jul 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Abbreviation-based model selector search (e.g. deepff → Deepseek V4 Flash Free)

1 participant