mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
Two issues caused intermittent step addition failures in the automation pipeline: 1. RemoveBgControls had onChange in its useEffect deps. Since onChange is a new function reference on every parent render, this created an infinite re-render loop (effect -> setState -> render -> effect). Fixed by using the onChangeRef pattern matching other settings components. 2. All step mutation callbacks read from stepsRef.current and passed values to setSteps. Concurrent callbacks (e.g. addStep + a settings effect) would overwrite each other. Fixed by switching to functional state updates (setSteps(prev => ...)) and removing stepsRef. Also rewrites automate e2e tests to use manual step addition instead of referencing templates that no longer exist in the UI.