mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: prevent pipeline step settings from resetting on collapse
The settings panel used conditional rendering ({isExpanded && ...})
which unmounted the Controls component on collapse, losing all state.
Switch to CSS hidden class so the component stays mounted and settings
persist when the panel is collapsed and re-expanded.
This commit is contained in:
@@ -284,17 +284,19 @@ export function PipelineBuilder({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Expanded settings */}
|
{/* Settings panel - hidden when collapsed, never unmounted so state persists */}
|
||||||
{isExpanded && (
|
<div
|
||||||
<div className="border-t border-border p-3 bg-muted/10 space-y-3">
|
className={
|
||||||
<p className="text-xs text-muted-foreground">{tool.description}</p>
|
isExpanded ? "border-t border-border p-3 bg-muted/10 space-y-3" : "hidden"
|
||||||
<PipelineStepSettings
|
}
|
||||||
toolId={step.toolId}
|
>
|
||||||
settings={step.settings}
|
<p className="text-xs text-muted-foreground">{tool.description}</p>
|
||||||
onChange={(s) => updateStepSettings(step.id, s)}
|
<PipelineStepSettings
|
||||||
/>
|
toolId={step.toolId}
|
||||||
</div>
|
settings={step.settings}
|
||||||
)}
|
onChange={(s) => updateStepSettings(step.id, s)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user