mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-10-03 11:27:25 -05:00
ui : record only the models the user picks
Assisted-by: pi:llama.cpp/DeepSeek-V4.1-Flash
This commit is contained in:
@@ -240,7 +240,7 @@ export function useModelsSelector(opts: UseModelsSelectorOptions): UseModelsSele
|
||||
shouldCloseMenu = false;
|
||||
}
|
||||
} else {
|
||||
await modelsStore.selectModelById(option.id);
|
||||
await modelsStore.selectModelById(option.id, { recordRecent: true });
|
||||
}
|
||||
|
||||
if (shouldCloseMenu) {
|
||||
|
||||
@@ -394,7 +394,11 @@ class ModelsStore implements ModelPropsHost, ModelStatusHost {
|
||||
);
|
||||
}
|
||||
|
||||
async selectModelById(modelId: string): Promise<void> {
|
||||
/**
|
||||
* Select a model. `recordRecent` marks a pick the user made in the selector, so
|
||||
* automatic picks (startup default, conversation sync) stay out of the recency list.
|
||||
*/
|
||||
async selectModelById(modelId: string, options?: { recordRecent?: boolean }): Promise<void> {
|
||||
if (!modelId || this.updating) return;
|
||||
|
||||
const backendId = backendIdFromModelId(modelId) ?? backendsStore.active.id;
|
||||
@@ -410,7 +414,11 @@ class ModelsStore implements ModelPropsHost, ModelStatusHost {
|
||||
await this.switchBackend();
|
||||
}
|
||||
|
||||
if (this.selectedModelId === qualifiedId) return;
|
||||
if (this.selectedModelId === qualifiedId) {
|
||||
if (options?.recordRecent) this.recordRecentModel(qualifiedId);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const option = this.activeModels.find((model) => model.id === rawId);
|
||||
|
||||
@@ -424,7 +432,8 @@ class ModelsStore implements ModelPropsHost, ModelStatusHost {
|
||||
this.selectedModelName = option.model;
|
||||
this.selectionFromStorage = false;
|
||||
this.persistSelection();
|
||||
this.recordRecentModel(qualifiedId);
|
||||
|
||||
if (options?.recordRecent) this.recordRecentModel(qualifiedId);
|
||||
} finally {
|
||||
this.updating = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user