Repository navigation
feat(ai_chat_view): 模型下拉支持模糊搜索 - #442
Merged
Merged
Conversation
openrouter 等聚合 provider 有数百个模型,下拉一次性全量渲染难以定位。 选项超过阈值(15)时在列表顶部显示搜索框,按 provider/model/hint 子串 不区分大小写过滤,并把 model 名以关键字开头的选项排前;列表限高滚动, 无匹配时显示空态文案。搜索框独立 InputState 实体,打开下拉时自动清空, 不影响主输入框焦点与回车提交。 Closes #405
Owner
Author
|
还没发版
xiaofei
***@***.***
…---原始邮件---
发件人: ***@***.***>
发送时间: 2026年10月22日(周四) 上午9:15
收件人: ***@***.***>;
抄送: ***@***.***>;"State ***@***.***>;
主题: Re: [feigeCode/navop] feat(ai_chat_view): 模型下拉支持模糊搜索 (PR #442)
newbirdking left a comment (feigeCode/navop#442)
Image: image (view on web) 没有模糊搜索的呀,输入不了.最新版本0.20.4
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

问题
Closes #405
openrouter 这类聚合 provider 返回数百个模型,底部模型下拉一次性全量渲染,无法快速定位想要的模型。
改动
MODEL_MENU_SEARCH_MIN_OPTIONS(15)时,在下拉列表顶部显示搜索框:InputState实体(与上下文面板搜索框同款),不抢主输入框焦点、不拦截回车提交;filter_model_options:MODEL_MENU_LIST_MAX_HEIGHT(320px)内部滚动,选项标签 truncate,长模型名不再撑爆 popover。验证
cargo test -p ai_chat_view --lib:450 passed,含新增回归测试:model_option_search_matches_provider_model_and_hint(provider/model/hint 三字段命中);filter_model_options_ranks_model_prefix_first_and_keeps_order_without_query(空关键字保序、前缀优先、无匹配为空)。cargo fmt --check:本次改动文件无差异(仓库既有 118 处漂移未动);cargo clippy -p ai_chat_view --lib:无新增警告(剩余 2 处 too_many_arguments 为 main 既有)。