feat(planner): add isLoading prop to SwapSuggestionList — disables Pick buttons during PATCH

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-09 10:32:59 +02:00
parent 9482ecbf36
commit b4fa3ca23e
3 changed files with 21 additions and 2 deletions

View File

@@ -61,6 +61,7 @@
let pickerOpen = $state(false);
let actionSheetOpen = $state(false);
let swapSheetOpen = $state(false);
let swapLoading = $state(false);
// Recipes already in any slot this week — used for ⚠ overlap warnings
let currentWeekRecipeIds = $derived(
@@ -139,8 +140,10 @@
}
async function handleSwapPick(recipeId: string, recipeName: string) {
swapSheetOpen = false;
swapLoading = true;
await handleRecipePick(recipeId, recipeName);
swapSheetOpen = false;
swapLoading = false;
}
function closePanelToIdle() {
@@ -306,6 +309,7 @@
replacingMeta={replacingMeta || undefined}
recipes={sortedRecipes}
{currentWeekRecipeIds}
isLoading={swapLoading}
onpick={handleSwapPick}
oncancel={() => (swapSheetOpen = false)}
/>