-
Notifications
You must be signed in to change notification settings - Fork 52
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
[3983] Add drag and drop support for explorer #4025
Conversation
d6d0c0a
to
7bb7d8d
Compare
a905a77
to
0970c1f
Compare
.../org/eclipse/sirius/web/application/views/explorer/services/ExplorerModificationService.java
Outdated
Show resolved
Hide resolved
...eclipse/sirius/web/application/views/explorer/services/api/IExplorerModificationService.java
Outdated
Show resolved
Hide resolved
packages/trees/frontend/sirius-components-trees/src/treeitems/useDropTreeItem.ts
Outdated
Show resolved
Hide resolved
06057a2
to
8de634b
Compare
packages/trees/frontend/sirius-components-trees/src/treeitems/useDropTreeItem.types.ts
Outdated
Show resolved
Hide resolved
.../trees/backend/sirius-components-collaborative-trees/src/main/resources/schema/tree.graphqls
Show resolved
Hide resolved
8de634b
to
bb8f156
Compare
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'll rebase it and merge it in a couple minutes after a quick test
<div | ||
className={`${state.partHovered === 'before' ? classes.treeItemHover : ''} ${classes.treeItemBefore}`} | ||
onDrop={onDropBefore} | ||
onDragEnter={() => handleMouseEnter('before')} |
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 won't block the PR for that but this will update the state of this treeItem and thus re-render all of its children when we are dragging elements just to update some CSS. We may have to re-create that in pure CSS since it is very similar to another major performance issue identified on tree items.
You can change the style of an element because another one is :hover
in CSS.
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.
See #4139 for an attempt at this.
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 clicked the wrong button :)
bb8f156
to
12dd8df
Compare
I'll merge it as is for now but it creates some issues with the hover feedback since tons of nodes seems to be selected after the drag and drop Enregistrement.de.l.ecran.2024-10-25.a.15.50.31.mov |
It appears that this PR makes the code coverage of |
@DisplayName("Given a studio, when we drag and drop an item in the explore, then the object is moved") | ||
@Sql(scripts = { "/scripts/studio.sql" }, executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) | ||
@Sql(scripts = { "/scripts/cleanup.sql" }, executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD, config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED)) | ||
public void givenStudioWhenWeDragAndDropAnItemThenTheObjectIsMoved() { |
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.
This test is only testing one of the three (?) kind of move possible, additional tests are required. I'll update it myself.
@@ -0,0 +1,36 @@ | |||
/******************************************************************************* |
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.
We already have a message service in Sirius Web used by multiple services of sirius-web-application
, do we really need a second one?
Hover can be very slow for nodes with lots of visible descendants: #4094. I've seen it lag for several seconds when testing with a few thousands tree items displayed. |
18708c4
to
edb4130
Compare
Bug: #3983 Signed-off-by: Florian ROUËNÉ <florian.rouene@obeosoft.com>
edb4130
to
3fa9b6c
Compare
Bug: #3983
Pull request template
General purpose
What is the main goal of this pull request?
Project management
priority:
andpr:
labels been added to the pull request? (In case of doubt, start with the labelspriority: low
andpr: to review later
)area:
,difficulty:
,type:
)CHANGELOG.adoc
been updated to reference the relevant issues?CHANGELOG.adoc
? (Including changes in the GraphQL API)CHANGELOG.adoc
? For example indoc/screenshots/2022.5.0-my-new-feature.png
Architectural decision records (ADR)
[doc]
?CHANGELOG.adoc
?Dependencies
CHANGELOG.adoc
?CHANGELOG.adoc
?Frontend
This section is not relevant if your contribution does not come with changes to the frontend.
General purpose
Typing
We need to improve the typing of our code, as such, we require every contribution to come with proper TypeScript typing for both changes contributing new files and those modifying existing files.
Please ensure that the following statements are true for each file created or modified (this may require you to improve code outside of your contribution).
useMutation<DATA_TYPE, VARIABLE_TYPE>(…)
useQuery<DATA_TYPE, VARIABLE_TYPE>(…)
useSubscription<DATA_TYPE, VARIABLE_TYPE>(…)
useMachine<CONTEXT_TYPE, EVENTS_TYPE>(…)
useState<STATE_TYPE>(…)
?.
(if the GraphQL API specifies that a field cannot benull
, do not treat it has potentiallynull
for example)let diagram: Diagram | null = null;
)Backend
This section is not relevant if your contribution does not come with changes to the backend.
General purpose
Architecture
Review
How to test this PR?
Please describe here the various use cases to test this pull request