You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an operator is newly added, its border is currently validated and painted twice, once by the operator-add stream subscriber and once by the validation stream that fires shortly after. This task unifies the two border-coloring paths in WorkflowEditorComponent so a newly-added operator is validated and painted exactly once, while preserving the navigation-reset restore behavior from #3614.
Context
WorkflowEditorComponent.applyOperatorBorder decides an operator's border color (invalid -> red, valid + cached run status -> state color, valid + no status -> default gray). It has two callers:
handleOperatorValidation: the validation-stream subscriber, which already has the Validation result and passes it in.
The operator-add stream subscriber: which has no Validation in hand and relies on the helper recomputing it.
These run off two separate event streams. As a result, when an operator is newly added, it ends up validated and its border painted twice:
The operator-add subscriber fires (getOperatorAddStream) -> paints the border using a freshly-computed validation.
A moment later, validation for the new operator runs via getOperatorDynamicSchemaChangedStream -> operatorValidationStream fires → handleOperatorValidation paints the border again.
Raised as a follow-up suggestion during review of the applyOperatorBorder optimization (PR #).
Proposed change
Unify the two paths so a newly-added operator is validated and painted exactly once, ideally with both callers obtaining the Validation the same way, allowing the optional-parameter fallback in applyOperatorBorder to be removed.
In frontend/src/app/workspace/component/workflow-editor/workflow-editor.component.ts.
Considerations
The operator-add subscriber was added for the navigation-reset fix (Operator Status Color Resets After Page Navigation #3614): when the user navigates back to a workflow, reloadWorkflow re-adds every operator and the border (plus cached run status) must be restored immediately. Any unification must preserve that the border can't be left blank waiting on a later validation event.
This is a non-functional cleanup; behavior should be unchanged. Existing tests in workflow-editor.component.spec.ts (the "operator border restoration after navigation" block) should continue to pass, with coverage added for the single-paint behavior.
Task Summary
When an operator is newly added, its border is currently validated and painted twice, once by the operator-add stream subscriber and once by the validation stream that fires shortly after. This task unifies the two border-coloring paths in WorkflowEditorComponent so a newly-added operator is validated and painted exactly once, while preserving the navigation-reset restore behavior from #3614.
Context
WorkflowEditorComponent.applyOperatorBorderdecides an operator's border color (invalid -> red, valid + cached run status -> state color, valid + no status -> default gray). It has two callers:handleOperatorValidation: the validation-stream subscriber, which already has theValidationresult and passes it in.Validationin hand and relies on the helper recomputing it.These run off two separate event streams. As a result, when an operator is newly added, it ends up validated and its border painted twice:
getOperatorAddStream) -> paints the border using a freshly-computed validation.getOperatorDynamicSchemaChangedStream->operatorValidationStreamfires →handleOperatorValidationpaints the border again.Raised as a follow-up suggestion during review of the
applyOperatorBorderoptimization (PR #).Proposed change
Unify the two paths so a newly-added operator is validated and painted exactly once, ideally with both callers obtaining the
Validationthe same way, allowing the optional-parameter fallback inapplyOperatorBorderto be removed.In
frontend/src/app/workspace/component/workflow-editor/workflow-editor.component.ts.Considerations
reloadWorkflowre-adds every operator and the border (plus cached run status) must be restored immediately. Any unification must preserve that the border can't be left blank waiting on a later validation event.workflow-editor.component.spec.ts(the "operator border restoration after navigation" block) should continue to pass, with coverage added for the single-paint behavior.Related
applyOperatorBorderand the Operator Status Color Resets After Page Navigation #3614 navigation fix)Validationparameter; this issue was raised in its review)Task Type