36 lines
1.3 KiB
Markdown
36 lines
1.3 KiB
Markdown
|
|
# 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
|
||
|
|
- [ ] The model dropdown list is sorted alphabetically (case-insensitive)
|
||
|
|
- [ ] The currently selected model remains selected after sorting
|
||
|
|
- [ ] The sorting works for all models returned from Ollama
|
||
|
|
- [ ] The sorted list updates correctly when models are added/removed
|
||
|
|
|
||
|
|
## 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
|