Hide recentlyUsed models in the total list

This commit is contained in:
Alex Gleason committed 2025-10-04 17:12:19 -05:00
1 parent 07048d2b5f
commit 0f0f9e6945
2 files changed
+26 -4

No files matched your search

+10 -2
View File
@@ -51,17 +51,25 @@ export function ModelSelector({
const recentlyUsedModels = useMemo(() => settings.recentlyUsedModels || [], [settings.recentlyUsedModels]);
// Group models by provider
// Create a Set of recently used model IDs for efficient lookup
const recentlyUsedSet = useMemo(() => new Set(recentlyUsedModels), [recentlyUsedModels]);
// Group models by provider, excluding models that are in the recently used section
const modelsByProvider = useMemo(() => {
const groups: Record<string, typeof models> = {};
for (const model of models) {
// Skip models that are already shown in recently used
if (recentlyUsedSet.has(model.fullId)) {
continue;
}
if (!groups[model.provider]) {
groups[model.provider] = [];
}
groups[model.provider].push(model);
}
return groups;
}, [models]);
}, [models, recentlyUsedSet]);
// Determine if we should show the "Recently Used" section
const shouldShowRecentlyUsed = useMemo(() => {