Skip to content

feat(frontend): ambient operator recommender suggestions on the canvas#6437

Open
gupta-sahil01 wants to merge 2 commits into
apache:mainfrom
gupta-sahil01:feat/operator-recommender-frontend
Open

feat(frontend): ambient operator recommender suggestions on the canvas#6437
gupta-sahil01 wants to merge 2 commits into
apache:mainfrom
gupta-sahil01:feat/operator-recommender-frontend

Conversation

@gupta-sahil01

@gupta-sahil01 gupta-sahil01 commented Jul 15, 2026

Copy link
Copy Markdown

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/recommend endpoint 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.

  • OperatorRecommendationService calls POST /api/recommend and 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.
  • Suggestion overlay in the workflow editor, reusing the existing chat-popover anchoring pattern (screen-coord conversion; re-anchored on operator move / zoom / pan); dismissed on blank click or when the anchor operator is deleted.
  • Opt-in flag operatorRecommendationEnabled (default false), threaded through gui.confGuiConfigConfigResource → the frontend GuiConfig type + mock.
  • Routing for the endpoint added to the dev proxy (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 testoperator-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.
  • End-to-end (manual): ran the full local-dev stack with GUI_WORKFLOW_WORKSPACE_OPERATOR_RECOMMENDATION_ENABLED=true; verified suggestion chips render on the output port, clicking materializes + links the operator, and POST /api/recommend is reached through the proxy.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Anthropic Claude (Claude Code)

@github-actions github-actions Bot added feature frontend Changes related to the frontend GUI infra common platform Non-amber Scala service paths labels Jul 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @Ma77Ball, @xuang7, @bobbai00
    You can notify them by mentioning @Ma77Ball, @xuang7, @bobbai00 in a comment.

@Yicong-Huang

Copy link
Copy Markdown
Contributor

great feature, could you please include screenshots/gifs in the PR description?

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 2 better · 🔴 3 worse · ⚪ 10 noise (<±5%) · 0 without baseline

Compared against main 181e38b benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

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

@gupta-sahil01

Copy link
Copy Markdown
Author

great feature, could you please include screenshots/gifs in the PR description?

added screenshots

@chenlica

Copy link
Copy Markdown
Contributor

@xuang7 @zuozhiw : Per the discussion #5240, can you review it?

@xuang7

xuang7 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@xuang7 @zuozhiw : Per the discussion #5240, can you review it?

I'm not very familiar with this part of the codebase, so I'll leave general comments where I can. It would probably be helpful to assign someone more familiar with this area for a thorough review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.

Comment on lines +123 to +136
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,
};
Comment on lines +1791 to +1813
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();
});
@Yicong-Huang

Copy link
Copy Markdown
Contributor

Hi @gupta-sahil01 a high level comment: let's not name it ghost suggestions. Let's find a better name for it?

@gupta-sahil01

Copy link
Copy Markdown
Author

Hi @gupta-sahil01 a high level comment: let's not name it ghost suggestions. Let's find a better name for it?

I thought since they were blurred like a "ghost". If you have a better name for it, I'm open to changing it.

@Yicong-Huang

Copy link
Copy Markdown
Contributor

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.

@gupta-sahil01

Copy link
Copy Markdown
Author

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.

@Yicong-Huang

Yicong-Huang commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

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

@chenlica
chenlica requested review from xuang7 and zuozhiw July 18, 2026 04:06
@chenlica

Copy link
Copy Markdown
Contributor

@xuang7 and @zuozhiw : can you review it?

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.
@gupta-sahil01
gupta-sahil01 force-pushed the feat/operator-recommender-frontend branch from 1a02c7d to a0794b6 Compare July 18, 2026 04:29
@gupta-sahil01 gupta-sahil01 changed the title feat(frontend): ambient operator recommender ghost suggestions feat(frontend): ambient operator recommender suggestions on the canvas Jul 18, 2026
@gupta-sahil01

Copy link
Copy Markdown
Author

Am I allowed to update the branches because I made some changes with respect to eliminating the word "ghost" from everywhere?

@Yicong-Huang

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common feature frontend Changes related to the frontend GUI infra platform Non-amber Scala service paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ambient "operator recommender"

5 participants