fix(ui): improve ModelMultiselect empty and error states - #6077
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
Walkthrough
ChangesModel multiselect feedback
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ui/components/ui/modelMultiselect.tsx`:
- Around line 85-87: Update the state selection in the model multiselect flow to
use the query corresponding to shouldUseBaseModels: derive loading from the
active query’s isLoading or isFetching, derive errors from its isError, and pass
the active isFetching value to AsyncMultiSelect. Ensure error state is gated
when neither query is enabled, using getModels/getBaseModels and their
associated state variables.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d8998c1a-aa30-4284-973d-d6068d008bc1
📒 Files selected for processing (1)
ui/components/ui/modelMultiselect.tsx
ed35a8f to
ae486df
Compare
Merge activity
|
## Summary Improves the placeholder messages shown in the model multiselect dropdown to better reflect the actual state of the component, including distinguishing between load errors, empty results, and missing provider selection. ## Changes - Tracks `isFetching` and `isError` states from both `useLazyGetModelsQuery` and `useLazyGetBaseModelsQuery` - Introduces a `modelLoadError` flag that is true when a fetch has completed with an error (and is not currently re-fetching) - Replaces generic placeholder strings with context-aware messages: - On error: `"Couldn't load models."` - On empty results with a provider selected: `"No models available for this provider."` - On empty results with no provider: `"Select a provider first."` - On empty results when loading on empty is enabled: `"No models available."` - When no results match a search: `"No matching models."` - Adds a trailing newline to the end of the file ## Type of change - [x] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [x] UI (React) - [ ] Docs ## How to test 1. Open a form that includes the model multiselect component. 2. Select a provider and observe the placeholder before typing — it should read `"No models available for this provider."` if no models are returned. 3. Clear the provider selection and confirm the placeholder reads `"Select a provider first."` 4. Simulate a network error (e.g., disable the API or use devtools to block the request) and confirm the placeholder reads `"Couldn't load models."` 5. Type a search term that returns no results and confirm the placeholder reads `"No matching models."` ```sh cd ui pnpm i || npm i pnpm build || npm run build ``` ## Screenshots/Recordings Before: - `noResultsFoundPlaceholder`: `"No models found"` - `emptyResultPlaceholder`: `"Start typing to search models..."` / `"Please select a provider first"` After: - `noResultsFoundPlaceholder`: `"No matching models."` / `"Couldn't load models."` - `emptyResultPlaceholder`: `"Couldn't load models."` / `"No models available for this provider."` / `"No models available."` / `"Select a provider first."` ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations None. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable
## Summary Improves the placeholder messages shown in the model multiselect dropdown to better reflect the actual state of the component, including distinguishing between load errors, empty results, and missing provider selection. ## Changes - Tracks `isFetching` and `isError` states from both `useLazyGetModelsQuery` and `useLazyGetBaseModelsQuery` - Introduces a `modelLoadError` flag that is true when a fetch has completed with an error (and is not currently re-fetching) - Replaces generic placeholder strings with context-aware messages: - On error: `"Couldn't load models."` - On empty results with a provider selected: `"No models available for this provider."` - On empty results with no provider: `"Select a provider first."` - On empty results when loading on empty is enabled: `"No models available."` - When no results match a search: `"No matching models."` - Adds a trailing newline to the end of the file ## Type of change - [x] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [x] UI (React) - [ ] Docs ## How to test 1. Open a form that includes the model multiselect component. 2. Select a provider and observe the placeholder before typing — it should read `"No models available for this provider."` if no models are returned. 3. Clear the provider selection and confirm the placeholder reads `"Select a provider first."` 4. Simulate a network error (e.g., disable the API or use devtools to block the request) and confirm the placeholder reads `"Couldn't load models."` 5. Type a search term that returns no results and confirm the placeholder reads `"No matching models."` ```sh cd ui pnpm i || npm i pnpm build || npm run build ``` ## Screenshots/Recordings Before: - `noResultsFoundPlaceholder`: `"No models found"` - `emptyResultPlaceholder`: `"Start typing to search models..."` / `"Please select a provider first"` After: - `noResultsFoundPlaceholder`: `"No matching models."` / `"Couldn't load models."` - `emptyResultPlaceholder`: `"Couldn't load models."` / `"No models available for this provider."` / `"No models available."` / `"Select a provider first."` ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations None. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable
## Summary Improves the placeholder messages shown in the model multiselect dropdown to better reflect the actual state of the component, including distinguishing between load errors, empty results, and missing provider selection. ## Changes - Tracks `isFetching` and `isError` states from both `useLazyGetModelsQuery` and `useLazyGetBaseModelsQuery` - Introduces a `modelLoadError` flag that is true when a fetch has completed with an error (and is not currently re-fetching) - Replaces generic placeholder strings with context-aware messages: - On error: `"Couldn't load models."` - On empty results with a provider selected: `"No models available for this provider."` - On empty results with no provider: `"Select a provider first."` - On empty results when loading on empty is enabled: `"No models available."` - When no results match a search: `"No matching models."` - Adds a trailing newline to the end of the file ## Type of change - [x] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [x] UI (React) - [ ] Docs ## How to test 1. Open a form that includes the model multiselect component. 2. Select a provider and observe the placeholder before typing — it should read `"No models available for this provider."` if no models are returned. 3. Clear the provider selection and confirm the placeholder reads `"Select a provider first."` 4. Simulate a network error (e.g., disable the API or use devtools to block the request) and confirm the placeholder reads `"Couldn't load models."` 5. Type a search term that returns no results and confirm the placeholder reads `"No matching models."` ```sh cd ui pnpm i || npm i pnpm build || npm run build ``` ## Screenshots/Recordings Before: - `noResultsFoundPlaceholder`: `"No models found"` - `emptyResultPlaceholder`: `"Start typing to search models..."` / `"Please select a provider first"` After: - `noResultsFoundPlaceholder`: `"No matching models."` / `"Couldn't load models."` - `emptyResultPlaceholder`: `"Couldn't load models."` / `"No models available for this provider."` / `"No models available."` / `"Select a provider first."` ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations None. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable
## Summary Improves the placeholder messages shown in the model multiselect dropdown to better reflect the actual state of the component, including distinguishing between load errors, empty results, and missing provider selection. ## Changes - Tracks `isFetching` and `isError` states from both `useLazyGetModelsQuery` and `useLazyGetBaseModelsQuery` - Introduces a `modelLoadError` flag that is true when a fetch has completed with an error (and is not currently re-fetching) - Replaces generic placeholder strings with context-aware messages: - On error: `"Couldn't load models."` - On empty results with a provider selected: `"No models available for this provider."` - On empty results with no provider: `"Select a provider first."` - On empty results when loading on empty is enabled: `"No models available."` - When no results match a search: `"No matching models."` - Adds a trailing newline to the end of the file ## Type of change - [x] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [x] UI (React) - [ ] Docs ## How to test 1. Open a form that includes the model multiselect component. 2. Select a provider and observe the placeholder before typing — it should read `"No models available for this provider."` if no models are returned. 3. Clear the provider selection and confirm the placeholder reads `"Select a provider first."` 4. Simulate a network error (e.g., disable the API or use devtools to block the request) and confirm the placeholder reads `"Couldn't load models."` 5. Type a search term that returns no results and confirm the placeholder reads `"No matching models."` ```sh cd ui pnpm i || npm i pnpm build || npm run build ``` ## Screenshots/Recordings Before: - `noResultsFoundPlaceholder`: `"No models found"` - `emptyResultPlaceholder`: `"Start typing to search models..."` / `"Please select a provider first"` After: - `noResultsFoundPlaceholder`: `"No matching models."` / `"Couldn't load models."` - `emptyResultPlaceholder`: `"Couldn't load models."` / `"No models available for this provider."` / `"No models available."` / `"Select a provider first."` ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations None. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable

Summary
Improves the placeholder messages shown in the model multiselect dropdown to better reflect the actual state of the component, including distinguishing between load errors, empty results, and missing provider selection.
Changes
isFetchingandisErrorstates from bothuseLazyGetModelsQueryanduseLazyGetBaseModelsQuerymodelLoadErrorflag that is true when a fetch has completed with an error (and is not currently re-fetching)"Couldn't load models.""No models available for this provider.""Select a provider first.""No models available.""No matching models."Type of change
Affected areas
How to test
"No models available for this provider."if no models are returned."Select a provider first.""Couldn't load models.""No matching models."Screenshots/Recordings
Before:
noResultsFoundPlaceholder:"No models found"emptyResultPlaceholder:"Start typing to search models..."/"Please select a provider first"After:
noResultsFoundPlaceholder:"No matching models."/"Couldn't load models."emptyResultPlaceholder:"Couldn't load models."/"No models available for this provider."/"No models available."/"Select a provider first."Breaking changes
Related issues
Security considerations
None.
Checklist
docs/contributing/README.mdand followed the guidelines