feat(pipeline): Add completion view support to pipeline definitions#112603
Conversation
cc56909 to
585549a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 585549a. Configure here.
| if (state.status === 'complete') { | ||
| onCompleteRef.current?.(state.data); | ||
| } | ||
| }, [state]); |
There was a problem hiding this comment.
finish lacks guard against repeated onComplete invocations
Medium Severity
The finish callback has no guard to prevent multiple invocations. Each call fires onCompleteRef.current, so a rapid double-click on the "Done" button fires onComplete twice. Unlike advance, which exposes isPending so step components can disable their buttons, PipelineCompletionProps provides no equivalent mechanism for completion views to prevent repeated submission. In the modal, each finish() call triggers handleComplete, which calls both the consumer's onComplete and closeModal(), potentially causing duplicate side effects before the modal unmounts.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 585549a. Configure here.
Add a completionView property to PipelineDefinition that allows pipelines to render a custom view after completion before firing onComplete. When set, onComplete is deferred until the component calls finish(). When null, existing behavior is preserved. Adds JSDoc comments to PipelineDefinition and PipelineStepDefinition.
585549a to
3f79427
Compare
…112603) Add a `completionView` property to `PipelineDefinition` that allows pipelines to render a custom view after completion before firing `onComplete` and closing the modal. When set, `onComplete` is deferred until the component calls finish(). When null, existing behavior is preserved.


Add a
completionViewproperty toPipelineDefinitionthat allows pipelines to render a custom view after completion before firingonCompleteand closing the modal. When set,onCompleteis deferred until the component calls finish(). When null, existing behavior is preserved.