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>
|
||||
|
||||
{/* Expanded settings */}
|
||||
{isExpanded && (
|
||||
<div className="border-t border-border p-3 bg-muted/10 space-y-3">
|
||||
<p className="text-xs text-muted-foreground">{tool.description}</p>
|
||||
<PipelineStepSettings
|
||||
toolId={step.toolId}
|
||||
settings={step.settings}
|
||||
onChange={(s) => updateStepSettings(step.id, s)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{/* Settings panel - hidden when collapsed, never unmounted so state persists */}
|
||||
<div
|
||||
className={
|
||||
isExpanded ? "border-t border-border p-3 bg-muted/10 space-y-3" : "hidden"
|
||||
}
|
||||
>
|
||||
<p className="text-xs text-muted-foreground">{tool.description}</p>
|
||||
<PipelineStepSettings
|
||||
toolId={step.toolId}
|
||||
settings={step.settings}
|
||||
onChange={(s) => updateStepSettings(step.id, s)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user