fix(recipe): align refresh split button behavior with models page

- refreshRecipes() now accepts fullRebuild param and passes it to scan endpoint
- Use consistent toast.api.refreshComplete / toast.api.refreshFailed keys
- Use loadingManager.show() with progress bar (matching models page style)
- Both Refresh and Rebuild Cache now hit the real /api/lm/recipes/scan endpoint
- Add sidebarManager.refresh() after recipe scan completes
- Backend scan_recipes handler reads full_rebuild query param
This commit is contained in:
Will Miao
2026-06-02 09:50:59 +08:00
parent d9fd60bec1
commit dd5d9cfcb2
3 changed files with 27 additions and 36 deletions

View File

@@ -8,7 +8,7 @@ import { getSessionItem, removeSessionItem } from './utils/storageHelpers.js';
import { RecipeContextMenu } from './components/ContextMenu/index.js';
import { DuplicatesManager } from './components/DuplicatesManager.js';
import { refreshVirtualScroll } from './utils/infiniteScroll.js';
import { refreshRecipes, syncChanges, RecipeSidebarApiClient } from './api/recipeApi.js';
import { refreshRecipes, RecipeSidebarApiClient } from './api/recipeApi.js';
import { sidebarManager } from './components/SidebarManager.js';
class RecipePageControls {
@@ -23,12 +23,9 @@ class RecipePageControls {
}
async refreshModels(fullRebuild = false) {
if (fullRebuild) {
await refreshRecipes();
return;
}
await refreshRecipes(fullRebuild);
await syncChanges();
await sidebarManager.refresh();
}
getSidebarApiClient() {