detail
Added 'Save as Recipe' feature to DoughCalc (v42 -> v43): new card with editable Title + Directions fields, prefilled from the computed steps text but ONLY while those fields are still blank -- so adjusting the calculator sliders never overwrites hand-edited directions once the user starts typing. On Save: builds an ingredients array from the current calc() result (flour/water/starter/salt/oil/yeast/malt/add-ins), splits the directions textarea into steps (strips any leading '1.' numbering so it doesn't double-number on the Recipes page), then calls get_recipes and checks for an exact case-insensitive title match. Match found -> update_recipe (overwrites that recipe's ingredients+steps+title). No match -> add_recipe (category=baking, source=DoughCalc, status=untested). Per USR369's explicit direction: same-title saves overwrite, manual editing on the Recipes page stays available too (already fixed this session), and this is intentionally being built as its own feature -- USR369 confirmed Bake Log will become its own companion app later and they'll all get merged eventually, but for now build separately. Did NOT touch the existing 'Save to bake log' quick-note button/behavior -- that's a different, still-standalone quick-journal feature, left as-is per the same 'build separately for now' instruction. Backed up DoughCalc first (BACKUP.php all_pass true), byte-verified deploy, real Node.js syntax check on the extracted inline <script> block passed clean (raw brace/paren counting had shown a false-positive off-by-one from a ')' inside a regex character class [.)] -- caught and correctly diagnosed as not a real bug before trusting it).