Skip to content
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

Properly handle move feedback if mouse up happens outside window #399

Merged
merged 2 commits into from
Nov 25, 2024

Conversation

martin-fleck-at
Copy link
Contributor

What it does

  • Handle mouse down if we should be dragging as mouse up
  • Reset feedback if selection has changed
    -- Ensure element does not have to be selected to revert move
    -- Add method for listeners to selection service

Fixes eclipse-glsp/glsp#1426

How to test

See eclipse-glsp/glsp#1426

Follow-ups

Changelog

  • This PR should be mentioned in the changelog
  • This PR introduces a breaking change (if yes, provide more details below for the changelog and the migration guide)

- Handle mouse down if we should be dragging as mouse up
- Reset feedback if selection has changed
-- Ensure element does not have to be selected to revert move
-- Add method for listeners to selection service

Fixes eclipse-glsp/glsp#1426
Copy link
Contributor

@ivy-lli ivy-lli left a comment

Choose a reason for hiding this comment

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

Looks good.
Quickly tried the workflow example with this change -> seems good
Tried also our glsp project (via replace the @eclipse-glsp/client src and lib in the node_modules), but got an error (not sure if this is because of this change or something else?
image

Comment on lines 188 to 199
const elementsToMove = this.getElementsToMove(target);
const elementToMove = this.getElementsToMove(target);
Copy link
Contributor

Choose a reason for hiding this comment

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

why rename? Still multiple elements right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, based on the wrong out-dated commit, good catch!

@martin-fleck-at
Copy link
Contributor Author

Looks good. Quickly tried the workflow example with this change -> seems good Tried also our glsp project (via replace the @eclipse-glsp/client src and lib in the node_modules), but got an error (not sure if this is because of this change or something else? image

Very interesting, do you already see that on the latest nightly? Because I don't think I changed anything regarding injection. As for the error itself, I wonder if the circular dependency is because of the ISelectionService in the file so moving that part to a separate file might help. I'll push an update to this PR soon which maybe you can try out. Otherwise we need to debug a little deeper.

@ivy-lli
Copy link
Contributor

ivy-lli commented Nov 25, 2024

Seems to work with 2.3.0-next.389
However, I don't want to pretend that I did everything correctly with the lib/src replacement in the node_modules... Maybe I missed something here.

@tortmayr
Copy link
Contributor

@ivy-lli I think this is indeed related to the lib/src replacement. I did a quick test and published the PR to a local npm registry (verdaccio). Consuming it from there seems to work without issues.

@tortmayr
Copy link
Contributor

@martin-fleck-at There also seems to be an issue if I drag outside of the window during a move and then release the mouse.
Then the element gets not reseted and remains on the invalid position.
But I'm not sure if we can fix that easily.

@martin-fleck-at
Copy link
Contributor Author

martin-fleck-at commented Nov 25, 2024

Based on the comment by Tobias, I just fixed the variable naming. I'd suggest we merge the PR if everyone is happy with it and then see if the consumption works and if not I can work on a fix since it is otherwise quite hard to test. What do you think?

EDIT: @tortmayr for your second comment: What should happen is that once you are back in the window, the element will follow the mouse cursor again and invalid clicks are correctly recognized.

@martin-fleck-at martin-fleck-at merged commit accf3f9 into master Nov 25, 2024
7 checks passed
@martin-fleck-at martin-fleck-at deleted the issues/1426 branch November 25, 2024 11:48
holkerveen pushed a commit to holkerveen/glsp-client that referenced this pull request Dec 21, 2024
+Fix eclipse-glsp#401 Node creation  (eclipse-glsp#402)
+ Resolve eclipse-glsp#398 Refactor TypeHints API (eclipse-glsp#399)
+ Resolve eclipse-glsp#396 RouterKind for FeedbackEdge (eclipse-glsp#397)
+ Reuse Sprotty's request/response system and remove custom solution(eclipse-glsp#404)
+ Add support for context menu and harmonize with command palette (eclipse-glsp#405)
holkerveen pushed a commit to holkerveen/glsp-client that referenced this pull request Dec 21, 2024
+Fix eclipse-glsp#401 Node creation  (eclipse-glsp#402)
+ Resolve eclipse-glsp#398 Refactor TypeHints API (eclipse-glsp#399)
+ Resolve eclipse-glsp#396 RouterKind for FeedbackEdge (eclipse-glsp#397)
+ Reuse Sprotty's request/response system and remove custom solution(eclipse-glsp#404)
+ Add support for context menu and harmonize with command palette (eclipse-glsp#405)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move element out of window and then to a invalid location don't reset the move feedback
3 participants