Skip to content

Commit b654fb7

Browse files
committed
feat(ui): 优化模型选择框的搜索体验和显示效果
主要改进: - 增加选择框最小宽度从200px到300px,添加最大宽度500px限制 - 添加自定义过滤函数,支持大小写不敏感的模糊搜索 - 支持同时搜索模型显示名称(label)和模型ID(value) - 改进长模型名称的显示完整性 现在用户可以: - 输入部分关键词(如'sonnet')找到相关模型 - 输入完整模型ID(如'claude-sonnet-4-20250514')精确匹配 - 继续使用自定义模型ID功能
1 parent 05c1a64 commit b654fb7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/ui/src/components/ImageModelEditModal.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@
8080
:options="modelOptions"
8181
:placeholder="t('image.model.placeholder')"
8282
:loading="isLoadingModels"
83-
style="flex: 1; min-width: 200px;"
83+
style="flex: 1; min-width: 300px; max-width: 500px;"
8484
clearable
8585
filterable
86+
:filter="(pattern, option) => option.label.toLowerCase().includes(pattern.toLowerCase()) || option.value.toLowerCase().includes(pattern.toLowerCase())"
8687
tag
8788
required
8889
@update:value="onModelChange"

packages/ui/src/components/TextModelEditModal.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@
9191
:options="modelOptions"
9292
:loading="isLoadingModelOptions"
9393
:placeholder="t('modelManager.defaultModelPlaceholder')"
94-
style="flex: 1; min-width: 200px;"
94+
style="flex: 1; min-width: 300px; max-width: 500px;"
9595
clearable
9696
filterable
97+
:filter="(pattern, option) => option.label.toLowerCase().includes(pattern.toLowerCase()) || option.value.toLowerCase().includes(pattern.toLowerCase())"
9798
tag
9899
required
99100
/>

0 commit comments

Comments
 (0)