Enforces display name for model selection
Removes fallback to model ID for display names Ensures consistent and user-friendly model representation Improves model dropdown experience by requiring display names from API
This commit is contained in:
2 files changed
+3
-3
No files matched your search
@@ -158,14 +158,14 @@ export class ModelService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Format ModelInfo array to ModelOption array for dropdown
|
* Format ModelInfo array to ModelOption array for dropdown
|
||||||
* Uses display_name if available, otherwise falls back to id
|
* Uses display_name from API for user-friendly model names
|
||||||
* Sorted by displayName for consistent UX across cache/API ordering
|
* Sorted by displayName for consistent UX across cache/API ordering
|
||||||
*/
|
*/
|
||||||
private formatModels(models: ModelInfo[]): ModelOption[] {
|
private formatModels(models: ModelInfo[]): ModelOption[] {
|
||||||
return models
|
return models
|
||||||
.map(model => ({
|
.map(model => ({
|
||||||
id: model.id,
|
id: model.id,
|
||||||
displayName: model.display_name || model.id
|
displayName: model.display_name
|
||||||
}))
|
}))
|
||||||
.sort((a, b) => a.displayName.localeCompare(b.displayName));
|
.sort((a, b) => a.displayName.localeCompare(b.displayName));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user