-
Notifications
You must be signed in to change notification settings - Fork 30
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
GLSP-1423 Add MovementBehavior to control invalid multi element movements #397
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this change and everything works as expected, thank you very much, Lukas! I just have a few minor comments and then we can merge this PR in my opinion.
- Should also the red border feedback be on both elements?
Good question! I can see arguments for both sides as you may not know which move is the culprit if all elements get the erroneous feedback. So I think leaving it only on the actual invalid move for now is fine.
- Better name for the options type / flag on the type?
(see inline comment)
packages/client/src/features/tools/change-bounds/change-bounds-tool-move-feedback.ts
Outdated
Show resolved
Hide resolved
@@ -63,6 +63,10 @@ import { | |||
import { FeedbackMoveMouseListener } from './change-bounds-tool-move-feedback'; | |||
import { ChangeBoundsTracker, TrackedElementResize, TrackedResize } from './change-bounds-tracker'; | |||
|
|||
export interface IMovementBehavior { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little bit on the fence about whether it should be called IMovementBehavior
(as we have with the IMarqueeBehavior
) or IMovementOptions
(as we have with the IHelperLineOptions
). I think both are probably fine, just wanted to note that down somewhere. We should probably unify that at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I named it indeed after the MarqueeBehavior (as I invented this too 🙈), however, I think I like Options more, so I will call it options.
packages/client/src/features/tools/change-bounds/change-bounds-tool.ts
Outdated
Show resolved
Hide resolved
packages/client/src/features/tools/change-bounds/change-bounds-tool-move-feedback.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you very much for the quick turnaround! LGTM!
+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)
+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)
What it does
Fixes: eclipse-glsp/glsp#1423
Per default change the behavior that all selected elements will be reset to it's origin location when one move is invalid. But add an
IMovementBehavior
type where this can be changed to the old style.Question:
How to test
Add to the
examples/workflow-standalone/src/di.config.ts
New behavior:
![Screen Recording 2024-11-20 at 16 02 56](https://private-user-images.githubusercontent.com/42733123/388146914-f8d9c4f2-6a17-44de-99b0-22ab358bae24.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4ODcyMTQsIm5iZiI6MTczOTg4NjkxNCwicGF0aCI6Ii80MjczMzEyMy8zODgxNDY5MTQtZjhkOWM0ZjItNmExNy00NGRlLTk5YjAtMjJhYjM1OGJhZTI0LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDEzNTUxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMyY2ZjNmVlNGIxZTNjYzJmMzc5YmMxN2FhMzhhYzYxOGQ3NmM2ZWY3MmZkNmQ3ZjBlZjQyOWY1ZWM0NTBmZWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.2diTuSrV3CH0hzdHJnymptx8lkA_gsCh6m1yfAjMEoc)
Old behavior:
![Screen Recording 2024-11-20 at 15 50 45](https://private-user-images.githubusercontent.com/42733123/388142872-aa2ecf6a-9ad6-459f-903c-83787e6a42d6.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4ODcyMTQsIm5iZiI6MTczOTg4NjkxNCwicGF0aCI6Ii80MjczMzEyMy8zODgxNDI4NzItYWEyZWNmNmEtOWFkNi00NTlmLTkwM2MtODM3ODdlNmE0MmQ2LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDEzNTUxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBmZTIwMWZjZTU1OTg2NTI5NGJlN2Q2NWQ4ZGY5MjAyZjE3ZmJmYWE0ZWY3ZDVkMzk2Y2ZkZjM3MDI2OGE5MDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.sDOBc3hOA75SqKhq5jXS-Wz3ZiDzmLryMvhEeLvtFno)
Changelog