feat: Remove sorting from Status column in Models Table

This commit is contained in:
Aleksander Grygier
2026-10-09 13:57:35 +02:00
parent 5d44c8f33b
commit a872e623be
3 changed files with 4 additions and 31 deletions
@@ -7,8 +7,7 @@
hasActiveFilters, hasActiveFilters,
modelContextLength, modelContextLength,
type ModelQuantGroup, type ModelQuantGroup,
type ModelsTableGroup, type ModelsTableGroup
statusRank
} from './utils'; } from './utils';
import { import {
ArrowDown, ArrowDown,
@@ -155,10 +154,6 @@
return (modelContextLength(a) ?? 0) - (modelContextLength(b) ?? 0); return (modelContextLength(a) ?? 0) - (modelContextLength(b) ?? 0);
case ModelsTableSortKey.NAME: case ModelsTableSortKey.NAME:
return a.model.localeCompare(b.model); return a.model.localeCompare(b.model);
case ModelsTableSortKey.STATUS:
// a running model leads, then one that is being worked on (loading,
// sleeping), then the rest; the reported status sorts the row's own cell
return statusRank(b) - statusRank(a);
default: default:
return 0; return 0;
} }
@@ -357,9 +352,7 @@
{@render sortHeader(ModelsTableSortKey.CONTEXT, 'Context')} {@render sortHeader(ModelsTableSortKey.CONTEXT, 'Context')}
</span> </span>
<span class="justify-self-center max-md:hidden"> <span class="justify-self-center max-md:hidden">Status</span>
{@render sortHeader(ModelsTableSortKey.STATUS, 'Status')}
</span>
<span class="text-center max-md:hidden">Actions</span> <span class="text-center max-md:hidden">Actions</span>
</div> </div>
@@ -1,10 +1,5 @@
import { LOCAL_BACKEND_ID, type ModalityKey } from '$lib/constants'; import { LOCAL_BACKEND_ID, type ModalityKey } from '$lib/constants';
import { import { ModelCapability, ModelGroupKind, ModelsTableGroupKind } from '$lib/enums';
ModelCapability,
ModelGroupKind,
ModelsTableGroupKind,
ServerModelStatus
} from '$lib/enums';
import { HuggingFaceService, ModelsService } from '$lib/services'; import { HuggingFaceService, ModelsService } from '$lib/services';
import { modelsStore } from '$lib/stores'; import { modelsStore } from '$lib/stores';
import type { ModelDownloadEntry, ModelDownloadProgress, ModelOption } from '$lib/types/models'; import type { ModelDownloadEntry, ModelDownloadProgress, ModelOption } from '$lib/types/models';
@@ -27,20 +22,6 @@ export function hasActiveFilters(
return contextLimit > 0 || modalities.length > 0 || capabilities.length > 0; return contextLimit > 0 || modalities.length > 0 || capabilities.length > 0;
} }
/**
* Order a status sorts behind: loaded first, then a model being worked on
* (loading, sleeping), then the rest.
*/
export function statusRank(option: ModelOption): number {
const status = modelsStore.getModelStatus(option.model);
if (modelsStore.isModelRunning(option.model)) return 2;
if (status === ServerModelStatus.LOADING || status === ServerModelStatus.SLEEPING) return 1;
return 0;
}
/** Byte counts of a tracked download: live while it runs, frozen while paused. */ /** Byte counts of a tracked download: live while it runs, frozen while paused. */
export function downloadProgressFor(repoWithTag: string): ModelDownloadProgress | null { export function downloadProgressFor(repoWithTag: string): ModelDownloadProgress | null {
return ( return (
+1 -2
View File
@@ -80,6 +80,5 @@ export enum ModelRowDownloadState {
/** Column the models manager table can be ordered by. */ /** Column the models manager table can be ordered by. */
export enum ModelsTableSortKey { export enum ModelsTableSortKey {
CONTEXT = 'context', CONTEXT = 'context',
NAME = 'name', NAME = 'name'
STATUS = 'status'
} }