💄 style: Optimized model list & search#9397
Conversation
🧹 chore(SearchResult): remove debug log for filtered models
|
@sxjeru is attempting to deploy a commit to the LobeHub OSS Team on Vercel. A member of the Team first needs to authorize it. |
Reviewer's GuideConverted the search input to a controlled component with local state and onBlur-triggered searches for a more user-friendly behavior, and cleaned up a leftover debug log in the search results. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
TestGru AssignmentSummary
Tip You can |
|
👍 @sxjeru Thank you for raising your pull request and contributing to our Community |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #9397 +/- ##
=========================================
Coverage 80.65% 80.65%
=========================================
Files 970 970
Lines 65922 65922
Branches 8705 10141 +1436
=========================================
Hits 53171 53171
Misses 12751 12751
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
… and remove unused created field
…ring of search results
…mance and update model filtering logic
…y prop to Search component (更换其他提供商时,复原搜索框状态)
… SearchResult components
…with enabled prop
✨ feat(ollama): 添加 Kimi K2 模型及其配置 🔧 fix(vercelAIGateway): 调整缓存读取费率 🔧 fix(nvidia): 更新 Nvidia 名称为 'Nvidia NIM'
8201750 to
243745a
Compare
There was a problem hiding this comment.
Pull request overview
This PR optimizes the model list and search functionality by introducing virtual scrolling and improving search UX. The changes address performance issues with large model lists by converting to a virtual list implementation using react-virtuoso, and enhance the search experience by triggering searches on blur in addition to explicit user actions.
Key changes:
- Implemented virtual scrolling for both search results and disabled model lists to improve rendering performance
- Made search input a controlled component that triggers searches on blur when the value changes, in addition to manual triggers
- Removed debug console.log statement from SearchResult component
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/app/[variants]/(main)/settings/provider/features/ModelList/SearchResult.tsx |
Replaced manual filtering with inline logic, removed debug log, integrated virtual list (react-virtuoso) for search results |
src/app/[variants]/(main)/settings/provider/features/ModelList/DisabledModels.tsx |
Added virtual list implementation for disabled models |
src/app/[variants]/(main)/settings/provider/features/ModelList/useModelListVirtualConfig.ts |
New hook providing device-specific virtual list configuration (item heights, viewport calculations) |
src/app/[variants]/(main)/settings/provider/features/ModelList/ModelTitle/Search.tsx |
Converted to controlled component with local state, added blur handler to trigger search when value changes |
src/app/[variants]/(main)/settings/provider/features/ModelList/ModelTitle/index.tsx |
Added key prop to Search components to reset state when provider changes |
src/app/[variants]/(main)/settings/provider/features/ModelList/index.tsx |
Added useEffect to clear search keyword when switching providers |
src/app/[variants]/(main)/settings/provider/features/ModelList/ModelItem.tsx |
Added useEffect to sync local checked state with enabled prop for proper state updates |
src/server/routers/lambda/config/index.test.ts |
Updated test to use deepseek-r1 instead of llama-3.1-8b model |
src/server/routers/lambda/config/__snapshots__/index.test.ts.snap |
Updated snapshot to match new test model |
src/locales/default/modelProvider.ts |
Fixed spacing in Chinese translation (added space after "发布于") |
src/config/modelProviders/nvidia.ts |
Updated provider name from "Nvidia" to "Nvidia NIM" |
src/config/modelProviders/google.ts |
Removed outdated comment reference |
packages/model-runtime/src/utils/modelParse.ts |
Added 'robotics' keyword to Google model parsing configuration for function call, reasoning, and video capabilities |
packages/model-bank/src/aiModels/google.ts |
Added new Gemini models (Latest variants, Preview versions, Robotics-ER), removed deprecated models (1.5 Flash/Pro 002, 1.5 Flash 8B, LearnLM) |
packages/model-bank/src/aiModels/vertexai.ts |
Removed deprecated Gemini 1.5 Flash 002 and Pro 002 models |
packages/model-bank/src/aiModels/openrouter.ts |
Removed deprecated/free models, updated Auto Router description |
packages/model-bank/src/aiModels/ollama.ts |
Added Kimi K2 model with reasoning and function call capabilities |
packages/model-bank/src/aiModels/higress.ts |
Removed deprecated Gemini 1.0 and 1.5 model variants |
packages/model-bank/src/aiModels/vercelaigateway.ts |
Updated cache read pricing for several models |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
⏳ Processing in progress |
🧹 chore(SearchResult): remove debug log for filtered models
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
📝 补充信息 | Additional Information
Summary by Sourcery
Optimize the search input component by managing its value in local state, firing searches on blur when the value changes, and cleaning up debug logs.
Enhancements:
Chores: