gupta-sahil01 commented on code in PR #6437:
URL: https://github.com/apache/texera/pull/6437#discussion_r3762170687
##########
frontend/src/app/workspace/component/workflow-editor/workflow-editor.component.ts:
##########
@@ -1712,6 +1728,146 @@ export class WorkflowEditorComponent implements OnInit,
AfterViewInit, OnDestroy
return
this.operatorSummaries.get(operatorId)?.sampleRecords?.[0]?.["__is_visualization__"]
=== true;
}
+ /**
+ * Ambient operator recommender (apache/texera#5240). When an operator is
+ * added, ask the recommender for likely next operators and float them as
+ * suggestion chips on the operator's output port; clicking one materializes
+ * it. The whole feature is opt-in and self-effacing: if it is disabled or
the
+ * backend returns nothing, the canvas is untouched.
+ */
+ private handleOperatorRecommendation(): void {
+ if (!this.operatorRecommendationService.isEnabled()) {
+ return;
+ }
+
+ // Trigger: an operator was just added to the canvas.
+ this.workflowActionService
+ .getTexeraGraph()
+ .getOperatorAddStream()
+ .pipe(untilDestroyed(this))
+ .subscribe(operator => this.showRecommendationsFor(operator));
Review Comment:
Fixed. The trigger is now the drag-drop drop event rather than
getOperatorAddStream(), so workflow load, undo/redo, paste, and remote
co-editor adds no longer fire requests. On your open question: paste does not
surface suggestions — #5240 frames this as code-completion for canvas
authoring, and completions don't fire on paste. No debounce in the end; drops
are discrete gestures with nothing to coalesce. Guarded by a test that adds two
operators via addOperator and asserts zero requests.
--
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]