Skip to content

Commit e274079

Browse files
committed
better empty detection
1 parent f7eca7a commit e274079

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

frontend/src/components/pages/rp-connect/pipeline/pipeline-flow-diagram.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,13 @@ export const PipelineFlowDiagram = ({
246246
);
247247
}
248248

249-
const isPipelineEmpty = !(configYaml.includes('input:') || configYaml.includes('output:'));
249+
// Pipeline is "empty" only when there are no user-defined nodes — sections
250+
// (INPUT/OUTPUT/PROCESSORS/RESOURCES labels) and `none` placeholders don't
251+
// count. A non-placeholder leaf or a group means the user has authored
252+
// something (an input, output, processor, resource, buffer, cache, etc.).
253+
const isPipelineEmpty = !nodes.some(
254+
(n) => n.kind === 'group' || (n.kind === 'leaf' && n.label !== 'none')
255+
);
250256
const showTemplateFab = Boolean(onBrowseTemplates) && isPipelineEmpty;
251257

252258
return (

0 commit comments

Comments
 (0)