Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

fix(recipe-studio): prevent stale empty fitView from offsetting first block zoom

Shine1i4c97591e4c53
diff --git a/studio/frontend/src/features/recipe-studio/recipe-studio-page.tsx b/studio/frontend/src/features/recipe-studio/recipe-studio-page.tsx
index a5359b63fb7..cfe6b72250f 100644
--- a/studio/frontend/src/features/recipe-studio/recipe-studio-page.tsx
+++ b/studio/frontend/src/features/recipe-studio/recipe-studio-page.tsx
@@ -632,6 +632,10 @@ export function RecipeStudioPage({
return;
}
lastProcessedFitTickRef.current = fitViewTick;
+ const targetNodes = getFitNodeIdsIgnoringNotes(reactFlowInstance.getNodes());
+ if (targetNodes.length === 0) {
+ return;
+ }
let frame2 = 0;
let frame3 = 0;
const frame1 = window.requestAnimationFrame(() => {
@@ -639,7 +643,7 @@ export function RecipeStudioPage({
frame3 = window.requestAnimationFrame(() => {
reactFlowInstance.fitView({
duration: 320,
- nodes: getFitNodeIdsIgnoringNotes(reactFlowInstance.getNodes()),
+ nodes: targetNodes,
});
});
});