diff --git a/tools/ui/src/lib/components/app/models/ModelsManager/ModelsManagerModelsTable.svelte b/tools/ui/src/lib/components/app/models/ModelsManager/ModelsManagerModelsTable.svelte index 73648cf211..b0ad48adfb 100644 --- a/tools/ui/src/lib/components/app/models/ModelsManager/ModelsManagerModelsTable.svelte +++ b/tools/ui/src/lib/components/app/models/ModelsManager/ModelsManagerModelsTable.svelte @@ -19,7 +19,6 @@ Trash2 } from '@lucide/svelte'; import { - ActionIcon, DropdownMenuActions, GroupedList, type GroupedListGroup, @@ -110,20 +109,15 @@ }) ); - /** Families of one section, the ones the user pinned leading it. */ + /** Families of one section. */ function familyGroups( group: (typeof sections)[number] ): GroupedListGroup, ModelQuantGroup>[] { - return group.families - .map((family) => ({ - entries: family.entries, - group: family, - key: `${group.key}::${family.key}` - })) - .sort( - (a, b) => - Number(modelsStore.isFavoriteFamily(b.key)) - Number(modelsStore.isFavoriteFamily(a.key)) - ); + return group.families.map((family) => ({ + entries: family.entries, + group: family, + key: `${group.key}::${family.key}` + })); } // Cancel is confirmed once for the whole list, so a single dialog instance @@ -434,16 +428,13 @@ {#snippet familyRow({ expanded, group: family, - key, toggle }: { expanded: boolean; group: ModelFamilyGroup; - key: string; toggle: () => void; })} {@const countLabel = `${family.entries.length} model${family.entries.length === 1 ? '' : 's'}`} - {@const favorite = modelsStore.isFavoriteFamily(key)}
{family.label} {countLabel} - - event.stopPropagation()} - onkeydown={(event) => event.stopPropagation()} - role="presentation" - > - {#if favorite} - modelsStore.toggleFamilyFavorite(key)} - tooltip="Remove family from favorites" - tooltipAsTitle - /> - {:else} - modelsStore.toggleFamilyFavorite(key)} - tooltip="Add family to favorites" - tooltipAsTitle - /> - {/if} - diff --git a/tools/ui/src/lib/constants/storage.constants.ts b/tools/ui/src/lib/constants/storage.constants.ts index d5ca6985ff..f66a0a0112 100644 --- a/tools/ui/src/lib/constants/storage.constants.ts +++ b/tools/ui/src/lib/constants/storage.constants.ts @@ -34,9 +34,6 @@ export const FAVORITE_MODELS_LOCALSTORAGE_KEY = `${STORAGE_APP_NAME}.favoriteMod /** Open state the user set for a model list section or one of its families, by id. */ export const MODEL_GROUP_OPEN_LOCALSTORAGE_KEY = `${STORAGE_APP_NAME}.modelGroupOpen`; -/** Model families pinned to the top of their provider section. */ -export const FAVORITE_MODEL_FAMILIES_LOCALSTORAGE_KEY = `${STORAGE_APP_NAME}.favoriteModelFamilies`; - /** Per-model load and inference overrides, keyed by backend-qualified model id. */ export const MODEL_OVERRIDES_LOCALSTORAGE_KEY = `${STORAGE_APP_NAME}.modelOverrides`; diff --git a/tools/ui/src/lib/stores/models/index.svelte.ts b/tools/ui/src/lib/stores/models/index.svelte.ts index 9731e8f005..f37e049dbc 100644 --- a/tools/ui/src/lib/stores/models/index.svelte.ts +++ b/tools/ui/src/lib/stores/models/index.svelte.ts @@ -9,7 +9,6 @@ import { browser } from '$app/environment'; import { - FAVORITE_MODEL_FAMILIES_LOCALSTORAGE_KEY, FAVORITE_MODELS_LOCALSTORAGE_KEY, HIDDEN_MODELS_LOCALSTORAGE_KEY, MODEL_GROUP_OPEN_LOCALSTORAGE_KEY, @@ -88,19 +87,6 @@ function loadHiddenModels(): Set { } } -/** Family keys pinned to the top of their provider section. */ -function loadFavoriteFamilies(): Set { - if (!browser) return new SvelteSet(); - - try { - const raw = localStorage.getItem(FAVORITE_MODEL_FAMILIES_LOCALSTORAGE_KEY); - - return raw ? new SvelteSet(JSON.parse(raw) as string[]) : new SvelteSet(); - } catch { - return new SvelteSet(); - } -} - /** Open state the user set for a section or family of the model lists. */ function loadGroupOpenState(): SvelteMap { if (!browser) return new SvelteMap(); @@ -141,7 +127,6 @@ function loadRecentModels(): string[] { class ModelsStore implements ModelPropsHost, ModelStatusHost { activeModels = $state([]); error = $state(null); - favoriteFamilyIds = $state>(loadFavoriteFamilies()); favoriteModelIds = $state>(this.loadFavoritesFromStorage()); groupOpenState = $state>(loadGroupOpenState()); hiddenModelIds = $state>(loadHiddenModels()); @@ -473,10 +458,6 @@ class ModelsStore implements ModelPropsHost, ModelStatusHost { return this.favoriteModelIds.has(modelId); } - isFavoriteFamily(key: string): boolean { - return this.favoriteFamilyIds.has(key); - } - isGroupOpen(id: string, fallbackOpen: boolean): boolean { return this.groupOpenState.get(id) ?? fallbackOpen; } @@ -666,25 +647,6 @@ class ModelsStore implements ModelPropsHost, ModelStatusHost { return candidate && candidate.trim().length > 0 ? candidate : id; } - /** Pin a family to the top of its provider section. */ - toggleFamilyFavorite(key: string): void { - const next = new SvelteSet(this.favoriteFamilyIds); - - if (next.has(key)) { - next.delete(key); - } else { - next.add(key); - } - - this.favoriteFamilyIds = next; - - try { - localStorage.setItem(FAVORITE_MODEL_FAMILIES_LOCALSTORAGE_KEY, JSON.stringify([...next])); - } catch { - toast.error('Failed to save favorite model families to local storage'); - } - } - toggleFavorite(modelId: string): void { this.setFavorites([modelId], !this.favoriteModelIds.has(modelId)); }