From 2835f46c376e3287de7c3a1ce1287535bd78f64e Mon Sep 17 00:00:00 2001 From: locphamtran Date: Thu, 10 Sep 2026 15:16:21 +0700 Subject: [PATCH] Keep the dialled-in look when swapping film simulations --- App.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/App.tsx b/App.tsx index 45ae053..4f71175 100644 --- a/App.tsx +++ b/App.tsx @@ -402,6 +402,19 @@ export default function App() { // never flip the watermark on/off. }; + // Picking a film sim swaps the look only: everything the user dialled in on + // the LIGHT/WB/FX tabs and the frame they picked stay exactly as they are. + // A saved recipe still loads its own stored values (that is what saving it + // was for). Same trick as the session restore below: set the recipe without + // applyRecipe, which would snap the sliders back to the sim's canonical set. + const handleSelectRecipe = (recipe: Recipe) => { + if (!FILM_SIMS.some((s) => s.id === recipe.id)) { + applyRecipe(recipe); + return; + } + setSelectedRecipe({ ...recipe, adjustments, frameId: selectedFrame }); + }; + // The recipe exactly as the user picked it. `selectedRecipe` is NOT a safe // copy of it: every slider move rewrites its `adjustments` in place // (handleUpdateAdjustments), so the canonical values only survive in the @@ -1084,7 +1097,7 @@ export default function App() { onOpenParamChange={setOpenParamKey} currentBaseFilter={selectedRecipe?.baseFilter} onCreateRecipe={handleCreateRecipe} - onSelectRecipe={applyRecipe} + onSelectRecipe={handleSelectRecipe} onUpdateAdjustments={handleUpdateAdjustments} onUpdateFrame={handleUpdateFrame} onToggleGeotag={handleToggleGeotag}