2025-12-27 19:21:34 +00:00
|
|
|
# Story 23: Alphabetize LLM Dropdown List
|
|
|
|
|
|
|
|
|
|
## User Story
|
|
|
|
|
As a user, I want the LLM model dropdown to be alphabetically sorted so I can quickly find the model I'm looking for.
|
|
|
|
|
|
|
|
|
|
## Acceptance Criteria
|
2025-12-27 19:30:17 +00:00
|
|
|
- [x] The model dropdown list is sorted alphabetically (case-insensitive)
|
|
|
|
|
- [x] The currently selected model remains selected after sorting
|
|
|
|
|
- [x] The sorting works for all models returned from Ollama
|
|
|
|
|
- [x] The sorted list updates correctly when models are added/removed
|
2025-12-27 19:21:34 +00:00
|
|
|
|
|
|
|
|
## Out of Scope
|
|
|
|
|
- Grouping models by type or provider
|
|
|
|
|
- Custom sort orders (e.g., by popularity, recency)
|
|
|
|
|
- Search/filter functionality in the dropdown
|
|
|
|
|
- Favoriting or pinning specific models to the top
|
|
|
|
|
|
|
|
|
|
## Technical Notes
|
|
|
|
|
- Models are fetched from `get_ollama_models` Tauri command
|
|
|
|
|
- Currently displayed in the order returned by the backend
|
|
|
|
|
- Sort should be case-insensitive (e.g., "Llama" and "llama" treated equally)
|
|
|
|
|
- JavaScript's `sort()` with `localeCompare()` is ideal for this
|
|
|
|
|
|
|
|
|
|
## Implementation Approach
|
|
|
|
|
```tsx
|
|
|
|
|
// After fetching models from backend
|
|
|
|
|
const sortedModels = models.sort((a, b) =>
|
|
|
|
|
a.toLowerCase().localeCompare(b.toLowerCase())
|
|
|
|
|
);
|
|
|
|
|
setAvailableModels(sortedModels);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Design Considerations
|
|
|
|
|
- Keep it simple - alphabetical order is intuitive
|
|
|
|
|
- Case-insensitive to handle inconsistent model naming
|
|
|
|
|
- No need to change backend - sorting on frontend is sufficient
|