Skip to content

feat: MoveCollection COMPASS-9434 #7060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

paula-stacho
Copy link
Contributor

@paula-stacho paula-stacho commented Jun 27, 2025

Description

Adds MoveCollection Edit. Now that we have a first non-placeholder edit, I took the opportunity to update e2e tests to use this for history checking and clean up the temporary editor.
Note on the e2e tests - I've had some trouble to get reactflow to register the webdriverio's actions. In the end I was happy to get some combination of actions that moves the node somewhere else.

Screen.Recording.2025-06-27.at.11.14.23.mov

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@github-actions github-actions bot added the feat label Jun 27, 2025
@paula-stacho paula-stacho added the feature flagged PRs labeled with this label will not be included in the release notes of the next release label Jun 27, 2025
@paula-stacho paula-stacho marked this pull request as ready for review June 27, 2025 09:17
@paula-stacho paula-stacho requested a review from a team as a code owner June 27, 2025 09:17
Comment on lines +155 to +164
.action('pointer')
.move({
x: Math.round(startPosition.x) + 10,
y: Math.round(startPosition.y) + 10,
})
.down({ button: 0 }) // Left mouse button
.move({ x: 10, y: 0, duration: 100 })
.pause(1000)
.move({ x: 10, y: 0, duration: 100 })
.up({ button: 0 }) // Release the left mouse button
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm assuming we tried browser.dragAndDrop method that wdio has and it didn't work that's why we rolled out our own logic, is that right?

Copy link
Contributor Author

@paula-stacho paula-stacho Jun 27, 2025

Choose a reason for hiding this comment

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

Yes, doesn't work. Internally it does the simple obvious sequence of pointer actions. From debugging I saw that Reactflow would report a drag stop, but it wouldn't update the position with that alone. Only if it registered ongoing dragging before, and looks like it's doing some debouncing on that, would the node actually move.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Gotcha, thanks for context, if this is a better version of drag and drop, you might want to move it to other reusable commands that we keep in commands

Comment on lines +183 to +184
expect(Math.round(nodes[0].position.x)).to.equal(originalPosition.x);
expect(Math.round(nodes[0].position.y)).to.equal(originalPosition.y);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is honestly too much internal testing for an e2e test, if we can't verify the exact numbers, checking that new position is different from the old one is good enough, and for undo / redo I'm assuming browser location should also suffice (like we expect it to return to whatever getLocation returned us initially on "Undo" click)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's true actually, thank you!

Copy link
Contributor Author

@paula-stacho paula-stacho Jun 27, 2025

Choose a reason for hiding this comment

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

Eerr.. okay so.. I'm afraid this is more stable 🙈 . When I said I was happy to get it moved somewhere, I really meant it. I have no theories on this one, but I can't control where it moves. I've been playing again with the params but the only way I've seen it move is slightly to the left&up, which shifts the diagram viewport, and that messes up the rest of the checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But now I really don't like the tests like this.. let me change it so that we ignore the original startPosition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat feature flagged PRs labeled with this label will not be included in the release notes of the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants