feat(frontend): ambient operator recommender suggestions on the canvas#6437
feat(frontend): ambient operator recommender suggestions on the canvas#6437gupta-sahil01 wants to merge 2 commits into
Conversation
Automated Reviewer SuggestionsBased on the
|
|
great feature, could you please include screenshots/gifs in the PR description? |
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 373 | 0.228 | 26,923/32,355/32,355 us | 🔴 +13.4% / 🔴 +131.7% |
| ⚪ | bs=100 sw=10 sl=64 | 793 | 0.484 | 125,476/134,482/134,482 us | ⚪ within ±5% / 🔴 +37.5% |
| ⚪ | bs=1000 sw=10 sl=64 | 913 | 0.557 | 1,100,195/1,126,374/1,126,374 us | ⚪ within ±5% / 🔴 +21.9% |
Baseline details
Latest main 181e38b from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 373 tuples/sec | 411 tuples/sec | 847.3 tuples/sec | -9.2% | -56.0% |
| bs=10 sw=10 sl=64 | MB/s | 0.228 MB/s | 0.251 MB/s | 0.517 MB/s | -9.2% | -55.9% |
| bs=10 sw=10 sl=64 | p50 | 26,923 us | 23,740 us | 11,621 us | +13.4% | +131.7% |
| bs=10 sw=10 sl=64 | p95 | 32,355 us | 35,239 us | 14,154 us | -8.2% | +128.6% |
| bs=10 sw=10 sl=64 | p99 | 32,355 us | 35,239 us | 19,069 us | -8.2% | +69.7% |
| bs=100 sw=10 sl=64 | throughput | 793 tuples/sec | 831 tuples/sec | 1,104 tuples/sec | -4.6% | -28.2% |
| bs=100 sw=10 sl=64 | MB/s | 0.484 MB/s | 0.507 MB/s | 0.674 MB/s | -4.5% | -28.2% |
| bs=100 sw=10 sl=64 | p50 | 125,476 us | 120,718 us | 91,279 us | +3.9% | +37.5% |
| bs=100 sw=10 sl=64 | p95 | 134,482 us | 131,993 us | 97,771 us | +1.9% | +37.5% |
| bs=100 sw=10 sl=64 | p99 | 134,482 us | 131,993 us | 107,798 us | +1.9% | +24.8% |
| bs=1000 sw=10 sl=64 | throughput | 913 tuples/sec | 932 tuples/sec | 1,127 tuples/sec | -2.0% | -19.0% |
| bs=1000 sw=10 sl=64 | MB/s | 0.557 MB/s | 0.569 MB/s | 0.688 MB/s | -2.1% | -19.0% |
| bs=1000 sw=10 sl=64 | p50 | 1,100,195 us | 1,075,607 us | 902,553 us | +2.3% | +21.9% |
| bs=1000 sw=10 sl=64 | p95 | 1,126,374 us | 1,101,228 us | 941,491 us | +2.3% | +19.6% |
| bs=1000 sw=10 sl=64 | p99 | 1,126,374 us | 1,101,228 us | 979,025 us | +2.3% | +15.1% |
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,536.36,200,128000,373,0.228,26923.17,32355.08,32355.08
1,100,10,64,20,2522.41,2000,1280000,793,0.484,125475.72,134482.36,134482.36
2,1000,10,64,20,21901.91,20000,12800000,913,0.557,1100194.50,1126374.01,1126374.01
added screenshots |
| public materialize( | ||
| sourceOperator: OperatorPredicate, | ||
| sourceOutputPortID: string, | ||
| recommendedType: string | ||
| ): string | undefined { | ||
| const newOperator = this.workflowUtilService.getNewOperatorPredicate(recommendedType); | ||
|
|
||
| const sourcePosition = this.workflowActionService | ||
| .getJointGraphWrapper() | ||
| .getElementPosition(sourceOperator.operatorID); | ||
| const newPosition: Point = { | ||
| x: sourcePosition.x + JointUIService.DEFAULT_OPERATOR_WIDTH + OperatorRecommendationService.MATERIALIZE_GAP_X, | ||
| y: sourcePosition.y, | ||
| }; |
| this.operatorRecommendationService | ||
| .getRecommendations(operator) | ||
| .pipe(untilDestroyed(this)) | ||
| .subscribe(recommendations => { | ||
| // The operator may have been deleted while the request was in flight. | ||
| if ( | ||
| recommendations.length === 0 || | ||
| !this.workflowActionService.getTexeraGraph().hasOperator(operator.operatorID) | ||
| ) { | ||
| return; | ||
| } | ||
| const position = this.getRecommendationPosition(operator.operatorID); | ||
| if (!position) { | ||
| return; | ||
| } | ||
| this.ghostSuggestion = { | ||
| operatorId: operator.operatorID, | ||
| sourceOutputPortID, | ||
| position, | ||
| recommendations, | ||
| }; | ||
| this.changeDetectorRef.detectChanges(); | ||
| }); |
|
Hi @gupta-sahil01 a high level comment: let's not name it |
I thought since they were blurred like a "ghost". If you have a better name for it, I'm open to changing it. |
|
How about just call them "suggested operators"? On the UI, the suggested operators are rendered with faded, blurred effect, but they are real suggestion instances. "ghost" the word has a negative semantic and I'd like to avoid it, and it is bundled with its UI effect: if we were to change such operators UI effect to be not blurred, the naming will be obsolete. |
Well, the word "ghost" doesn't appear directly in the UI. When we drag an operator from the panel, the 3 suggestions will show up with it. |
|
Not only about UI, or what user sees, but also for code comments, variable names as well as GitHub discussion, pr titles and description, etc. can we avoid this naming in general? Thanks |
Frontend half of the ambient operator recommender (apache#5240). After an operator is added to the canvas, 1-3 faded suggestion chips appear on its output port showing likely next operators; clicking one materializes the operator and wires the link as a single undoable action. - OperatorRecommendationService: calls the stateless agent-service POST /api/recommend endpoint and turns a chosen suggestion into a real operator. Fails soft - a disabled feature, an output-less operator, or a backend error simply yields no suggestions, leaving the canvas unchanged. - Suggestion overlay in the workflow editor, reusing the chat-popover anchoring pattern (screen-coord conversion, re-anchored on move / zoom / pan); dismissed on blank click or when the anchor operator is deleted. - Opt-in GUI config flag `operatorRecommendationEnabled`, default off, threaded through gui.conf, GuiConfig, ConfigResource, and the frontend GuiConfig type + mock.
1a02c7d to
a0794b6
Compare
|
Am I allowed to update the branches because I made some changes with respect to eliminating the word "ghost" from everywhere? |
of course. thought out the review please update the code as requested, or as you see fit. |
What changes were proposed in this PR?
Frontend half (PR 2 of 2) of the ambient operator recommender, Version 1 — see #6293 (design discussion #5240). Depends on the backend
/api/recommendendpoint added in the companion backend PR.After an operator is added to the canvas, 1–3 faded suggestion chips appear on its output port; clicking one materializes that operator and wires the link as a single undoable action. Behaves like code completion, but for dataflow graphs. Opt-in and default-off.
OperatorRecommendationServicecallsPOST /api/recommendand materializes a chosen suggestion. Fails soft: a disabled feature, an output-less operator (e.g. a chart sink), or a backend error all yield no suggestions and leave the canvas unchanged.operatorRecommendationEnabled(defaultfalse), threaded throughgui.conf→GuiConfig→ConfigResource→ the frontendGuiConfigtype + mock.frontend/proxy.config.json) and the prod gateway (bin/k8s/.../gateway-routes.yaml), alongside the existing/api/agents.Any related issues, documentation, discussions?
How was this PR tested?
yarn ng test—operator-recommendation.service.spec.ts, 7 passed (enabled/disabled gating, POST body, empty-list fallbacks on error and output-less operators, materialize link wiring).yarn ng build --configuration=production— succeeds under strict templates.GUI_WORKFLOW_WORKSPACE_OPERATOR_RECOMMENDATION_ENABLED=true; verified suggestion chips render on the output port, clicking materializes + links the operator, andPOST /api/recommendis reached through the proxy.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Anthropic Claude (Claude Code)