detail
Added a 'Load directions from a recipe' dropdown to the Save-as-Recipe card in DoughCalc, connecting it back to the Recipes app for the first time (previously the connection was one-way: Save-as-Recipe could only WRITE to Recipes, never read from it). On page load, populates the dropdown by fetching get_recipes and sorting by title. Selecting a recipe + clicking Load pulls that recipe's title and directions into the Title/Directions fields -- confirms before overwriting if there's already unsaved text in Directions, since this is a deliberate user action that should override the softer 'only prefill while blank' guard used for the auto-computed calculator steps. SCOPE DECISION: only Title + Directions load, NOT ingredients/amounts. USR369's own wording asked specifically for directions ('so it'll use the directions from the recipes in the calculator'), and most saved recipes (like #29, Classic White Sandwich Bread -- milk/butter/sugar/instant yeast, no starter, no baker's-percentage hydration) don't map onto DoughCalc's percentage-based sliders at all -- auto-filling flour/hydration/salt from an arbitrary recipe would either be impossible (no percentages to extract) or silently wrong. Flagged this limitation directly in the card's own UI text rather than only in the decision log, so USR369 sees it in-app. Also refreshed the dropdown automatically after every successful save, so newly created/updated recipes show up without a page reload. Backed up DoughCalc first (BACKUP.php all_pass true), node --check passed on the extracted script, byte-verified deploy. Functionally confirmed the exact data path against real recipe #29: fetched it via get_recipes, parsed its 8 steps with the same parseStepsForLoad() logic the dropdown uses, confirmed clean parse of both first and last steps.