This is an automated email from the ASF dual-hosted git repository. github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-8615-53ad65021b875e025d23b643f5f02f560afc8492 in repository https://gitbox.apache.org/repos/asf/texera.git
commit 09220c21fad973b1b9b53b77b91a8ecaa4a76c5e Author: Xinyuan Lin <[email protected]> AuthorDate: Thu Sep 24 03:43:52 2026 +0000 chore(frontend): remove the dead link-breakpoint plumbing (#8615) ### What changes were proposed in this PR? Removes the plumbing left behind when the link-breakpoint feature was deleted from the UI. None of these streams can emit — there is no `.next()` on any of them anywhere in production, so the getters hand out streams that never fire and `linksWithBreakpoints` is permanently empty. Pure deletion, no behaviour change: **−100 lines**. ### History | | | | --- | --- | | **Introduced by** | the original breakpoint implementation, commit `f80c9a43db` (2020-03-29) — predates the PR workflow | | **Usage removed by** | #2392 (2024-02-19) — "Remove breakpoint feature" deleted `setLinkBreakpoint` and the `breakpointChangeStream.next` producers. #3033 (2024-11-13) — "Remove Operator Group" then removed the last `jointLinkBreakpointShowStream.next` / `HideStream.next` calls | Since #3033 there has been no producer at all. | Removed | Where | | --- | --- | | `jointLinkBreakpointShowStream` / `HideStream` + their getters, and the `linkIDType` alias only they used | `joint-graph-wrapper.ts` | | `linksWithBreakpoints` + `getLinkIDsWithBreakpoint` | `joint-graph-wrapper.ts` | | `breakpointChangeStream` + `getBreakpointChangeStream`, and the `"setLinkBreakpoint"` / `"breakpointChangeStream"` entries in the restricted-method union | `workflow-graph.ts` | | the merge operand | `workflow-action.service.ts` | | `handleLinkBreakpointToggleEvents` + its call | `workflow-editor.component.ts` | > Reviewer note — one guard collapses rather than disappearing. The `link:mouseleave` handler skipped `hideTools()` for links that had a breakpoint; since `getLinkIDsWithBreakpoint()` always returns empty, that branch was always taken, so the call is now unconditional. Same behaviour, one branch fewer. The doc comment above it, which explained the breakpoint exception, is updated to match. > The `"setLinkBreakpoint"` union entry names a method that no longer exists — it is a string in a restricted-method union, not a call site. > These picked up coverage in #7481 (2026-08-09) and #6586 (2026-07-20), which is why they look live; those tests poke the dead subjects directly through `(wrapper as any)` rather than exercising a feature. ### Any related issues, documentation, discussions? Closes #8612 ### How was this PR tested? Existing tests only — this PR removes code and the tests that poked it. From `frontend/`: - `npx ng build` — **success**. This PR edits a component, so the AOT build is the gate that proves no template still binds to a removed member. - `npx ng test --watch=false --include='**/joint-graph-wrapper.spec.ts' --include='**/workflow-graph.spec.ts' --include='**/workflow-editor.component.spec.ts'` — 251 tests pass across the three files. - `yarn --cwd frontend format:ci` — clean. Verification, re-runnable by a reviewer: ``` git grep -n "LinkBreakpoint\|breakpointChangeStream\|linksWithBreakpoints\|linkIDType" ``` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- .../workflow-editor.component.spec.ts | 18 ------------- .../workflow-editor/workflow-editor.component.ts | 27 +------------------ .../model/joint-graph-wrapper.spec.ts | 4 --- .../workflow-graph/model/joint-graph-wrapper.ts | 30 ---------------------- .../model/workflow-action.service.ts | 1 - .../workflow-graph/model/workflow-graph.spec.ts | 5 ---- .../service/workflow-graph/model/workflow-graph.ts | 16 ------------ 7 files changed, 1 insertion(+), 100 deletions(-) diff --git a/frontend/src/app/workspace/component/workflow-editor/workflow-editor.component.spec.ts b/frontend/src/app/workspace/component/workflow-editor/workflow-editor.component.spec.ts index ed2d314124..02688a3116 100644 --- a/frontend/src/app/workspace/component/workflow-editor/workflow-editor.component.spec.ts +++ b/frontend/src/app/workspace/component/workflow-editor/workflow-editor.component.spec.ts @@ -1865,24 +1865,6 @@ describe("WorkflowEditorComponent link breakpoints", () => { expect(wrapper.multiSelect).toBe(true); }); - - it("shows and hides the tool as the breakpoint streams ask", () => { - // These two streams are how a link that already has a breakpoint keeps its marker visible after - // the cursor leaves it. - const { linkID, view } = withLink(); - const wrapper = workflowActionService.getJointGraphWrapper(); - const show = vi.spyOn(view, "showTools"); - const hide = vi.spyOn(view, "hideTools"); - - (wrapper as any).jointLinkBreakpointShowStream.next({ linkID }); - (wrapper as any).jointLinkBreakpointHideStream.next({ linkID }); - - expect(show).toHaveBeenCalledTimes(1); - expect(hide).toHaveBeenCalledTimes(1); - // Order matters, otherwise a handler pair wired to each other's stream passes: both would - // still be called once, just for the opposite reason. - expect(show.mock.invocationCallOrder[0]).toBeLessThan(hide.mock.invocationCallOrder[0]); - }); }); /** diff --git a/frontend/src/app/workspace/component/workflow-editor/workflow-editor.component.ts b/frontend/src/app/workspace/component/workflow-editor/workflow-editor.component.ts index bc5a7f5c6b..e8b3e9f587 100644 --- a/frontend/src/app/workspace/component/workflow-editor/workflow-editor.component.ts +++ b/frontend/src/app/workspace/component/workflow-editor/workflow-editor.component.ts @@ -1580,8 +1580,6 @@ export class WorkflowEditorComponent implements OnInit, AfterViewInit, OnDestroy /** * When the cursor leaves a link, the delete button disappears. - * If there is no breakpoint present on that link, the breakpoint button also disappears, - * otherwise, the breakpoint button is not changed. */ fromJointPaperEvent(this.paper, "link:mouseleave") .pipe(map(value => value[0])) @@ -1589,10 +1587,7 @@ export class WorkflowEditorComponent implements OnInit, AfterViewInit, OnDestroy .subscribe(elementView => { // ensure that the link element exists if (this.paper.getModelById(elementView.model.id)) { - const LinksWithBreakpoint = this.wrapper.getLinkIDsWithBreakpoint(); - if (!LinksWithBreakpoint.includes(elementView.model.id.toString())) { - this.paper.getModelById(elementView.model.id).findView(this.paper).hideTools(); - } + this.paper.getModelById(elementView.model.id).findView(this.paper).hideTools(); this.paper.getModelById(elementView.model.id).attr({ ".tool-remove": { display: "none" }, }); @@ -1607,7 +1602,6 @@ export class WorkflowEditorComponent implements OnInit, AfterViewInit, OnDestroy this.handleLinkBreakpointToolAttachment(); this.handleLinkBreakpointButtonClick(); this.handleLinkBreakpointHighlightEvents(); - this.handleLinkBreakpointToggleEvents(); } // when a link is added, append a breakpoint link-tool to its LinkView @@ -1696,25 +1690,6 @@ export class WorkflowEditorComponent implements OnInit, AfterViewInit, OnDestroy }); } - /** - * show/hide the breakpoint button according to the observable value received - */ - private handleLinkBreakpointToggleEvents(): void { - this.wrapper - .getLinkBreakpointShowStream() - .pipe(this.wrapper.jointGraphContext.bufferWhileAsync, untilDestroyed(this)) - .subscribe(linkID => { - this.paper.getModelById(linkID.linkID).findView(this.paper).showTools(); - }); - - this.wrapper - .getLinkBreakpointHideStream() - .pipe(this.wrapper.jointGraphContext.bufferWhileAsync, untilDestroyed(this)) - .subscribe(linkID => { - this.paper.getModelById(linkID.linkID).findView(this.paper).hideTools(); - }); - } - /** * Handles mouse events to enable shared cursor. */ diff --git a/frontend/src/app/workspace/service/workflow-graph/model/joint-graph-wrapper.spec.ts b/frontend/src/app/workspace/service/workflow-graph/model/joint-graph-wrapper.spec.ts index 0d5c0db507..0ea0864881 100644 --- a/frontend/src/app/workspace/service/workflow-graph/model/joint-graph-wrapper.spec.ts +++ b/frontend/src/app/workspace/service/workflow-graph/model/joint-graph-wrapper.spec.ts @@ -1078,10 +1078,6 @@ describe("JointGraphWrapperService", () => { ); }); - it("getLinkIDsWithBreakpoint starts empty", () => { - expect(jointGraphWrapper.getLinkIDsWithBreakpoint()).toEqual([]); - }); - it("getElementPositionChangeEvent reports the old and new position of a moved element", () => { jointGraph.addCell(jointUIService.getJointOperatorElement(mockScanPredicate, mockPoint)); diff --git a/frontend/src/app/workspace/service/workflow-graph/model/joint-graph-wrapper.ts b/frontend/src/app/workspace/service/workflow-graph/model/joint-graph-wrapper.ts index fe43258a11..08eed79a15 100644 --- a/frontend/src/app/workspace/service/workflow-graph/model/joint-graph-wrapper.ts +++ b/frontend/src/app/workspace/service/workflow-graph/model/joint-graph-wrapper.ts @@ -31,8 +31,6 @@ import { dia } from "jointjs/types/joint"; import * as _ from "lodash"; import Selectors = dia.Cell.Selectors; -type linkIDType = { linkID: string }; - type JointModelEventInfo = { add: boolean; merge: boolean; @@ -152,17 +150,10 @@ export class JointGraphWrapper { // event stream of restoring zoom / offset default of the jointJS paper private restorePaperOffsetSubject: Subject<void> = new Subject<void>(); - // event stream of showing the breakpoint button of a link - private jointLinkBreakpointShowStream = new Subject<linkIDType>(); - // event stream of hiding the breakpoint button of a link - private jointLinkBreakpointHideStream = new Subject<linkIDType>(); // the currently highlighted links' ids private currentHighlightedLinks: string[] = []; - // the linkIDs of those links with a breakpoint - private currentHighlightedPorts: LogicalPort[] = []; // the IDs of ports currently being edited - private linksWithBreakpoints: string[] = []; // current zoom ratio private zoomRatio: number = JointGraphWrapper.INIT_ZOOM_VALUE; @@ -489,13 +480,6 @@ export class JointGraphWrapper { return this.jointOperatorUnhighlightStream.pipe(this.jointGraphContext.bufferWhileAsync); } - /** - * get the ids of all the links that have a breakpoint - */ - public getLinkIDsWithBreakpoint(): readonly string[] { - return this.linksWithBreakpoints; - } - /** * get the event stream of a link being highlighted. */ @@ -510,20 +494,6 @@ export class JointGraphWrapper { return this.jointLinkUnhighlightStream.pipe(this.jointGraphContext.bufferWhileAsync); } - /** - * get the event stream of showing the breakpoint button of a link - */ - public getLinkBreakpointShowStream(): Observable<linkIDType> { - return this.jointLinkBreakpointShowStream.asObservable(); - } - - /** - * get the event stream of hiding the breakpoint button of a link - */ - public getLinkBreakpointHideStream(): Observable<linkIDType> { - return this.jointLinkBreakpointHideStream.asObservable(); - } - /** * Gets the event stream of an operator being dragged. */ diff --git a/frontend/src/app/workspace/service/workflow-graph/model/workflow-action.service.ts b/frontend/src/app/workspace/service/workflow-graph/model/workflow-action.service.ts index 14168a9c03..b4aba75013 100644 --- a/frontend/src/app/workspace/service/workflow-graph/model/workflow-action.service.ts +++ b/frontend/src/app/workspace/service/workflow-graph/model/workflow-action.service.ts @@ -760,7 +760,6 @@ export class WorkflowActionService { this.getTexeraGraph().getLinkDeleteStream(), this.getTexeraGraph().getPortAddedOrDeletedStream(), this.getTexeraGraph().getOperatorPropertyChangeStream(), - this.getTexeraGraph().getBreakpointChangeStream(), this.getJointGraphWrapper().getElementPositionChangeEvent(), this.getTexeraGraph().getDisabledOperatorsChangedStream(), this.getTexeraGraph().getCommentBoxAddStream(), diff --git a/frontend/src/app/workspace/service/workflow-graph/model/workflow-graph.spec.ts b/frontend/src/app/workspace/service/workflow-graph/model/workflow-graph.spec.ts index 41942cd7a5..0b1a8a830e 100644 --- a/frontend/src/app/workspace/service/workflow-graph/model/workflow-graph.spec.ts +++ b/frontend/src/app/workspace/service/workflow-graph/model/workflow-graph.spec.ts @@ -789,11 +789,6 @@ describe("WorkflowGraph", () => { workflowGraph.operatorPropertyChangeSubject, { operator: mockScanPredicate }, ], - [ - workflowGraph.getBreakpointChangeStream(), - workflowGraph.breakpointChangeStream, - { oldBreakpoint: undefined, linkID: "link-1" }, - ], [ workflowGraph.getPortAddedOrDeletedStream(), workflowGraph.portAddedOrDeletedSubject, diff --git a/frontend/src/app/workspace/service/workflow-graph/model/workflow-graph.ts b/frontend/src/app/workspace/service/workflow-graph/model/workflow-graph.ts index 9c77ad4170..16366c8969 100644 --- a/frontend/src/app/workspace/service/workflow-graph/model/workflow-graph.ts +++ b/frontend/src/app/workspace/service/workflow-graph/model/workflow-graph.ts @@ -48,14 +48,12 @@ type restrictedMethods = | "setOperatorProperty" | "addPort" | "removePort" - | "setLinkBreakpoint" | "operatorAddSubject" | "operatorDeleteSubject" | "operatorDisplayNameChangedSubject" | "linkAddSubject" | "linkDeleteSubject" | "operatorPropertyChangeSubject" - | "breakpointChangeStream" | "commentBoxAddSubject" | "commentBoxDeleteSubject" | "commentBoxAddCommentSubject" @@ -130,10 +128,6 @@ export class WorkflowGraph { public readonly operatorPropertyChangeSubject = new Subject<{ operator: OperatorPredicate; }>(); - public readonly breakpointChangeStream = new Subject<{ - oldBreakpoint: object | undefined; - linkID: string; - }>(); public readonly portAddedOrDeletedSubject = new Subject<{ newOperator: OperatorPredicate; }>(); @@ -984,16 +978,6 @@ export class WorkflowGraph { return this.operatorPropertyChangeSubject.asObservable(); } - /** - * Gets the observable event stream of a link breakpoint is changed. - */ - public getBreakpointChangeStream(): Observable<{ - oldBreakpoint: object | undefined; - linkID: string; - }> { - return this.breakpointChangeStream.asObservable(); - } - public getPortAddedOrDeletedStream(): Observable<{ newOperator: OperatorPredicate; }> {
