Apply the CREATE form's knobs to the photo in realtime

Every row now feeds the open render as it is typed, so a recipe's effect is
visible before it is saved. The draft is not an undo step: SAVE/EXPORT stays the
only thing that commits it, and merely opening the tab changes nothing.
This commit is contained in:
2026-09-17 19:05:59 +07:00
parent a684b178b6
commit 1446e852b1
2 changed files with 25 additions and 1 deletions
+8
View File
@@ -324,6 +324,13 @@ export function Workspace() {
[user, applyRecipe, t]
);
// CREATE edits the photo live: each knob lands on the render as it is typed so
// the recipe can be judged before saving. No undo entry — this is a draft, and
// SAVE/EXPORT is what commits it.
const previewCreatedRecipe = useCallback((draft: Pick<Recipe, 'baseFilter' | 'adjustments'>) => {
setRecipe((prev) => ({ ...prev, ...draft, isCustom: true }));
}, []);
// The phone's encrypted .recipe envelope (`shared/utils/recipeShare` is the
// app's own file, byte-identical). Signed in only — a guest's recipe is never
// written to disk.
@@ -781,6 +788,7 @@ export function Workspace() {
currentBase={recipe.baseFilter}
current={recipe.adjustments}
signedIn={!!user}
onPreview={previewCreatedRecipe}
onSave={(draft) => void addCreatedRecipe(draft)}
onExport={exportRecipeFile}
/>