fix(recipes): steps shown as raw JSON when AI uses instruction/appliance_function objects
- _stepStr: parse JSON-string steps; handle s.instruction key (backward-compat with already-saved recipes) - _stepAppliance: new helper to extract appliance_function hint; returns null for 'Nessuno'/'None' - renderRecipe steps list: shows appliance badge inline after step text when present - CSS: .recipe-step-appliance badge (green chip, dark-mode variant) - Prompt (both generateRecipe + generateRecipeStream): rule 9/10 explicitly forbids step objects; appliance info must be embedded in the step text string directly
This commit is contained in:
@@ -4276,6 +4276,19 @@ body.server-offline .bottom-nav {
|
||||
color: #3730a3;
|
||||
white-space: nowrap;
|
||||
}
|
||||
/* Appliance/mode badge shown inline next to a step text */
|
||||
.recipe-step-appliance {
|
||||
display: inline-block;
|
||||
margin-left: 6px;
|
||||
background: #f0fdf4;
|
||||
border: 1px solid #bbf7d0;
|
||||
border-radius: 12px;
|
||||
padding: 1px 8px;
|
||||
font-size: 0.72rem;
|
||||
color: #15803d;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Recipe ingredient use buttons */
|
||||
.recipe-ingredients {
|
||||
@@ -7653,6 +7666,7 @@ body.cooking-mode-active .app-header {
|
||||
[data-theme="dark"] .recipe-expiry-note { background: #2a1e00; color: #fde68a; }
|
||||
[data-theme="dark"] .recipe-tools-banner { background: #1a1040; border-color: #3730a3; color: #c4b5fd; }
|
||||
[data-theme="dark"] .recipe-tool-chip { background: #2e1a4a; color: #c4b5fd; }
|
||||
[data-theme="dark"] .recipe-step-appliance { background: #052e16; border-color: #166534; color: #4ade80; }
|
||||
[data-theme="dark"] .recipe-subtype-chip { background: #1c1300; border-color: #78350f; color: var(--text); }
|
||||
[data-theme="dark"] .recipe-subtype-chip:has(input:checked) { background: #2a1e00; border-color: #d97706; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user