PG1204 opened a new pull request, #5702:
URL: https://github.com/apache/texera/pull/5702

   ### What changes were proposed in this PR?
   
   WorkflowEditorComponent.applyOperatorBorder(operatorID)` always recomputes 
validation as its first step:
   
   ```typescript
   const validation = 
this.validationWorkflowService.validateOperator(operatorID);
   ```
   
   This is redundant when the helper is called from the validation-stream 
subscriber in handleOperatorValidation, the stream's emitted event already 
carries the Validation result that was just computed by updateValidationState.
   
   This PR:
   Adds an optional validation?: Validation parameter to applyOperatorBorder. 
The helper uses it when provided, and falls back to 
validateOperator(operatorID) otherwise.
   Updates handleOperatorValidation to pass value.validation from the stream 
into the helper.
   Leaves the operator-add stream subscriber unchanged and hence it doesn't 
have a Validation in hand at that point, so it correctly falls through to the 
lazy-fetch path.
   Functionally identical (the stream emits the same Validation that would have 
been recomputed), purely avoids the duplicate call.
   
   Originally flagged as an optional nit during the PR #5146 review. Attempted 
in PR #5626 but split out per reviewer request so that PR could stay scoped to 
test restructuring; this PR completes the follow-up.
   ### Any related issues, documentation, discussions?
   
   Closes #5683
   Related: PR #5146 (where the nit was raised), PR #5626 (where this was 
attempted and split out).
   
   ### How was this PR tested?
   
   Added one focused unit test in `workflow-editor.component.spec.ts` inside 
the existing `operator border restoration after navigation` describe block: 
`it("uses the Validation passed in instead of recomputing it", ...)`. The test 
clears the `validateOperator` spy after the operator-add validation chain 
settles, then calls `applyOperatorBorder` directly with a `Validation` argument 
and asserts `validateOperator` is not called.
   
   Verified locally:
   - `tsc --noEmit`: clean
   - `eslint`: clean
   - `ng test` (jsdom): 26/26 pass in the editor spec (was 25 — new test adds 
one)
   - `ng run gui:test-browser`: 13/13 pass
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   This PR was co-authored using Claude Code (Anthropic Claude Opus 4.7)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to