Skip to content

fix(ui): improve ModelMultiselect empty and error states - #6077

Merged
akshaydeo merged 1 commit into
devfrom
08-12-fix_ui_improve_modelmultiselect_empty_and_error_states
Aug 12, 2026
Merged

fix(ui): improve ModelMultiselect empty and error states#6077
akshaydeo merged 1 commit into
devfrom
08-12-fix_ui_improve_modelmultiselect_empty_and_error_states

Conversation

@Madhuvod

@Madhuvod Madhuvod commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

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

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • 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."
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
  • 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

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: aa2eefba-9196-481d-95ad-948ef831eab8

📥 Commits

Reviewing files that changed from the base of the PR and between ed35a8f and ae486df.

📒 Files selected for processing (1)
  • ui/components/ui/modelMultiselect.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • ui/components/ui/modelMultiselect.tsx

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved model selection feedback by distinguishing loading failures, empty results, unavailable providers, and missing provider selections.
    • Error messages now appear only after model loading completes, reducing misleading status messages.

Walkthrough

ModelMultiselect now tracks fetching and error states for model queries. It derives completed-request errors, uses the active query for loading, and displays distinct messages for load failures and result states.

Changes

Model multiselect feedback

Layer / File(s) Summary
Query status and result messages
ui/components/ui/modelMultiselect.tsx
The component tracks query fetching and errors, derives modelLoadError after requests finish, uses the active query for loading, and renders state-specific result messages.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: roroghost17

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main UI change: improved empty and error states in ModelMultiselect.
Description check ✅ Passed The description covers the purpose, changes, testing steps, UI impact, breaking changes, and security considerations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 08-12-fix_ui_improve_modelmultiselect_empty_and_error_states

Comment @coderabbitai help to get the list of available commands.

@Madhuvod
Madhuvod marked this pull request as ready for review August 11, 2026 20:31

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@coderabbitai
coderabbitai Bot requested a review from roroghost17 August 11, 2026 20:34

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between dab597c and ed35a8f.

📒 Files selected for processing (1)
  • ui/components/ui/modelMultiselect.tsx

Comment thread ui/components/ui/modelMultiselect.tsx Outdated
@Madhuvod
Madhuvod force-pushed the 08-12-fix_ui_improve_modelmultiselect_empty_and_error_states branch from ed35a8f to ae486df Compare August 11, 2026 20:57

akshaydeo commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • Aug 12, 4:35 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Aug 12, 4:35 AM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo
akshaydeo merged commit 5dbf56b into dev Aug 12, 2026
15 checks passed
@akshaydeo
akshaydeo deleted the 08-12-fix_ui_improve_modelmultiselect_empty_and_error_states branch August 12, 2026 04:35
akshaydeo pushed a commit that referenced this pull request Aug 13, 2026
## 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
akshaydeo pushed a commit that referenced this pull request Aug 13, 2026
## 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
akshaydeo pushed a commit that referenced this pull request Aug 14, 2026
## 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
akshaydeo pushed a commit that referenced this pull request Aug 19, 2026
## 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
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.

2 participants