Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement llm model search #1322

Merged
merged 10 commits into from
Feb 18, 2025

Conversation

kamilfurtak
Copy link

This Pull Request updates the ModelSelector component to replace the traditional dropdown UI for selecting models with a searchable and keyboard-navigable dropdown menu. The changes aim to improve usability by providing enhanced search and navigation capabilities.

  • Added state and refs:

Introduced state variables for managing the search query, dropdown state, and keyboard navigation.
Added refs for handling search input focus and tracking dropdown options.

  • Implemented searchable dropdown:

Users can now filter models by typing in a search box.
Models are dynamically filtered based on provider and search criteria.

  • Added keyboard navigation:

Arrow keys support navigating between filtered models.
Other key events (Enter, Escape, Tab) provide improved dropdown interaction.

  • Replaced static select element:

Removed standard element and replaced it with a custom searchable dropdown UI styled with class-based utilities for responsive design and interactivity. Enhanced user-focused interactivity: Automatically focuses the search input when the dropdown is opened. Highlights selected or focused items within the dropdown for accessibility.

@leex279
Copy link
Collaborator

leex279 commented Feb 15, 2025

@kamilfurtak thx for the PR. Here a few things:

Size of dropdowns should be always the same and not break into 2 lines (doesnt look good in my view):
image

Remove Transparency:
image

Accessibillty / Tab selection order is wrong. From Provider it goes to edit instead of to the model dropdown. See this GIF:
2025-02-15_15h06_58

Added keyboard support for toggling the dropdown using Enter or Space keys, improving accessibility. Also set appropriate focus properties by adding tabindex to the combobox element.
@kamilfurtak
Copy link
Author

kamilfurtak commented Feb 15, 2025

@leex279 Thanks for feedback. I made fixes to your comments and added small UI and accessibility improvements.

@leex279 leex279 self-requested a review February 15, 2025 21:30
Copy link
Collaborator

@leex279 leex279 left a comment

Choose a reason for hiding this comment

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

Working now as expected. Can be merged to main (by another Core Member)

@leex279 leex279 requested review from Stijnus and xKevIsDev February 17, 2025 22:19
Copy link
Collaborator

@xKevIsDev xKevIsDev left a comment

Choose a reason for hiding this comment

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

Reviewed and looks good! Will go ahead and merge this now. Thanks @kamilfurtak

@xKevIsDev xKevIsDev merged commit 0e2e183 into stackblitz-labs:main Feb 18, 2025
1 check passed
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.

3 participants