fix(recipe): prevent empty grid by removing preserveScroll from refresh triggers

Bug: when scrolling down on recipes page, any operation with
preserveScroll: true would fetch only page 1 data then restore
scroll position to beyond the loaded items, leaving the grid empty.

Fix:
- Remove preserveScroll: true from all 7 must-refresh trigger
  paths (filter, search, sort, import, settings reload, sync,
  rebuild cache, sidebar folder nav)
- Replace full list refresh with updateSingleItem() for repair
  and bulk missing-LoRA download operations
- Update tests to match new scroll-free behavior
This commit is contained in:
Will Miao
2026-06-02 08:15:29 +08:00
parent 1ffa543160
commit b633b22779
10 changed files with 40 additions and 23 deletions

View File

@@ -301,7 +301,7 @@ export async function syncChanges() {
state.loadingManager.showSimpleLoading('Syncing changes...');
// Simply reload the recipes without rebuilding cache
await resetAndReload(false, { preserveScroll: true });
await resetAndReload(false);
showToast('toast.recipes.syncComplete', {}, 'success');
} catch (error) {
@@ -329,7 +329,7 @@ export async function refreshRecipes() {
}
// After successful cache rebuild, reload the recipes
await resetAndReload(false, { preserveScroll: true });
await resetAndReload(false);
showToast('toast.recipes.refreshComplete', {}, 'success');
} catch (error) {