feat(recipes): add sync changes dropdown menu for recipe refresh

- Add syncChanges() function to recipeApi.js for quick refresh without cache rebuild
- Implement dropdown menu UI in recipes page with quick refresh and full rebuild options
- Add initDropdowns() method to RecipeManager for dropdown interaction handling
- Update AGENTS.md with more precise instruction about running sync_translation_keys.py
- Integrate sync changes functionality as default refresh behavior
This commit is contained in:
Will Miao
2026-03-04 20:31:58 +08:00
parent f402505f97
commit acc625ead3
4 changed files with 101 additions and 7 deletions

View File

@@ -259,6 +259,26 @@ export async function resetAndReload(updateFolders = false) {
});
}
/**
* Sync changes - quick refresh without rebuilding cache (similar to models page)
*/
export async function syncChanges() {
try {
state.loadingManager.showSimpleLoading('Syncing changes...');
// Simply reload the recipes without rebuilding cache
await resetAndReload();
showToast('toast.recipes.syncComplete', {}, 'success');
} catch (error) {
console.error('Error syncing recipes:', error);
showToast('toast.recipes.syncFailed', { message: error.message }, 'error');
} finally {
state.loadingManager.hide();
state.loadingManager.restoreProgressBar();
}
}
/**
* Refreshes the recipe list by first rebuilding the cache and then loading recipes
*/