Skip to content

Conversation

@odeimaiz
Copy link
Member

@odeimaiz odeimaiz commented Jul 24, 2025

What do these changes do?

In order to reduce the number of patches sent to the backend and these broadcasted, this PR makes the Node Moving action less noisy: the node position is consolidated when it stops moving. It also moves shared functionality from BaseNodeUI into NodeUI and removes the BaseNodeUI class entirely.

Before:
Before

After:
After

Related issue/s

How to test

Dev-ops

@odeimaiz odeimaiz self-assigned this Jul 24, 2025
@odeimaiz odeimaiz added t:enhancement Improvement or request on an existing feature a:frontend issue affecting the front-end (area group) labels Jul 24, 2025
@odeimaiz odeimaiz added this to the Engage milestone Jul 24, 2025
@odeimaiz odeimaiz marked this pull request as ready for review July 24, 2025 08:52
@odeimaiz odeimaiz requested a review from Copilot July 24, 2025 08:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reduces the frequency of node position updates sent to the backend during node movement by consolidating position changes only when the node stops moving, rather than continuously during the drag operation. This optimization decreases the number of patches sent to the backend and subsequently broadcasted to other clients.

  • Moves shared functionality from BaseNodeUI into NodeUI and removes the BaseNodeUI class entirely
  • Changes the "nodeMoving" event to pass coordinate data instead of just triggering an event
  • Consolidates node position updates to occur only when movement stops rather than continuously during drag

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
WorkbenchUI.js Updates event handling to use coordinate data from nodeMoving event and fixes references from BaseNodeUI to NodeUI
NodeUI.js Inherits directly from qx.ui.window.Window, incorporates all BaseNodeUI functionality, and modifies movement logic to consolidate position updates
BaseNodeUI.js Completely removed as its functionality has been moved to NodeUI
AvatarGroup.js Adds missing __avatars array initialization
Comments suppressed due to low confidence (2)

services/static-webserver/client/source/class/osparc/workbench/NodeUI.js:880

  • The method name __setPositionFromEvent is misleading as it doesn't actually set the node's position in the data model, it only updates the DOM position. Consider renaming to __updateDomPositionFromEvent or __calculatePositionFromEvent.
    __setPositionFromEvent: function(e) {

services/static-webserver/client/source/class/osparc/workbench/NodeUI.js:652

  • Method name changed from _createPort to __createPort but the call here wasn't updated consistently. This should be this.__createPort(isInput, true);
        this.__createPort(isInput, true);

@sonarqubecloud
Copy link

Copy link
Contributor

@giancarloromeo giancarloromeo left a comment

Choose a reason for hiding this comment

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

🎱

Copy link
Contributor

@wvangeit wvangeit left a comment

Choose a reason for hiding this comment

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

Less noise is always good. Thanks.

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

🙏 the backend is thankful for this change

@odeimaiz odeimaiz added the 🤖-automerge marks PR as ready to be merged for Mergify label Jul 24, 2025
@odeimaiz
Copy link
Member Author

@mergify queue

@mergify
Copy link
Contributor

mergify bot commented Jul 24, 2025

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 233031b

@mergify mergify bot merged commit 233031b into ITISFoundation:master Jul 24, 2025
60 checks passed
@odeimaiz odeimaiz deleted the enh/node-moving branch August 5, 2025 07:17
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Aug 5, 2025
88 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-automerge marks PR as ready to be merged for Mergify a:frontend issue affecting the front-end (area group) t:enhancement Improvement or request on an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants