-
Notifications
You must be signed in to change notification settings - Fork 3
fix: unify filter names in model selector #551
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
Conversation
Separate provider slug (for filtering/grouping) from logo ID (for images). Previously `providerId` served both purposes, causing "Meta Llama" to use "llama" as the filter key. Now filters group by the actual provider slug from the model ID, and logos load from the dedicated `logoId` field. Also renames "Meta Llama" → "Llama" for consistency with other model-brand-based filter names (Qwen, DeepSeek, Mistral). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
🚅 Deployed to the openchat-pr-551 environment in OpenChat
|
Greptile SummaryThis PR separates provider identification logic from logo display logic by introducing a distinct Key Changes:
Impact:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant API as OpenRouter API
participant Store as model.ts
participant Selector as model-selector.tsx
participant Settings as settings.tsx
participant Logo as ProviderLogo Component
API->>Store: Fetch models data
Store->>Store: transformModel(raw)
Note over Store: Extract providerSlug from model ID<br/>(e.g., "meta-llama")
Store->>Store: Lookup PROVIDER_INFO[providerSlug]
Note over Store: Get display name "Llama"<br/>and logoId "llama"
Store->>Store: Create Model object<br/>providerId: "meta-llama"<br/>logoId: "llama"<br/>provider: "Llama"
Store->>Selector: models array
Selector->>Selector: Build uniqueProviders map
Note over Selector: Group by providerId<br/>Store logoId for each provider
Selector->>Selector: Filter models by providerId
Note over Selector: selectedProvider filters<br/>using model.providerId
Selector->>Logo: providerId={model.logoId}
Logo->>Logo: Fetch logo from models.dev
Note over Logo: URL: models.dev/logos/llama.svg
Settings->>Logo: src={model.logoId}
Logo->>Logo: Display logo using logoId
Note over Logo: Separates filtering logic<br/>from logo display logic
|
- Add a "Filter Display" setting in Settings > Models to toggle between showing provider names (default) or icons in model selector filter tabs - Revert "Meta Llama" → "Llama" renaming from PR #551 (keep original names) - Persist filter display preference in localStorage via the UI store Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
providerId(provider slug from model ID, used for filtering/grouping) fromlogoId(used for logo image URLs) in the Model interfaceTest plan
Closes #548
🤖 Generated with Claude Code