Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ export class MiniMapComponent implements AfterViewInit, OnDestroy {
});
this.hidden = JSON.parse(localStorage.getItem("mini-map") as string) || false;

// Redraw the navigator box when an operator is dragged on the main canvas,
// otherwise the minimap keeps showing the pre-drag layout until the next
// translate/scale/resize event.
this.workflowActionService
.getJointGraphWrapper()
.getElementPositionChangeEvent()
.subscribe(() => this.updateNavigator());

Comment on lines +90 to +94

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Tear down the position-change subscription.

If MiniMapComponent is destroyed while jointGraph remains active, this subscription retains the component and continues calling updateNavigator() for later graph events. This can leak destroyed components and access removed DOM nodes. Pipe the stream through untilDestroyed(this), as done for the other subscriptions.

Proposed fix
     this.workflowActionService
       .getJointGraphWrapper()
       .getElementPositionChangeEvent()
+      .pipe(untilDestroyed(this))
       .subscribe(() => this.updateNavigator());
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
this.workflowActionService
.getJointGraphWrapper()
.getElementPositionChangeEvent()
.subscribe(() => this.updateNavigator());
this.workflowActionService
.getJointGraphWrapper()
.getElementPositionChangeEvent()
.pipe(untilDestroyed(this))
.subscribe(() => this.updateNavigator());
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/src/app/workspace/component/workflow-editor/mini-map/mini-map.component.ts`
around lines 90 - 94, Update the position-change subscription in
MiniMapComponent to pipe the getElementPositionChangeEvent() stream through
untilDestroyed(this) before subscribing, matching the teardown pattern used by
the component’s other subscriptions while preserving the updateNavigator
callback.

this.panelService.closePanelStream.pipe(untilDestroyed(this)).subscribe(() => (this.hidden = true));
this.panelService.resetPanelStream.pipe(untilDestroyed(this)).subscribe(() => (this.hidden = false));
}
Expand Down