Skip to content

BUGFIX: moving of content nodes leads to duplicated nodes in Neos UI until reload - #4018

Merged
skurfuerst merged 2 commits into
9.0from
bugfix/5660-move-leads-to-duplicated-nodes
Mar 26, 2026
Merged

skurfuerst merged 2 commits into
9.0from
bugfix/5660-move-leads-to-duplicated-nodes

Conversation

@skurfuerst

@skurfuerst skurfuerst commented Oct 22, 2025 •

Copy link
Copy Markdown
Member

This change removes the remaining old but broken code that ensured that the parent paths of nodes were updated in the UI.
Now the backend sends one RemoveNode feedback to remove the moved node at its old position.
And it send up to three UpdateNodeInfo feedbacks to update old and new parent (if it changed) and the moved node.
This way the trees and guest frame are up-to-date.

Due to the removal of the moved node, this does not solve the redirection in case of the current document node being moved into a new parent. This should be solved in a separate PR as it doesn't cause a critical bug like an incorrect tree state.

Resolves: neos/neos-development-collection#5660

@Sebobo
Sebobo force-pushed the bugfix/5660-move-leads-to-duplicated-nodes branch 2 times, most recently from ee4498a to a2b640c Compare March 23, 2026 09:23
@Sebobo
Sebobo marked this pull request as ready for review March 23, 2026 09:28
@Sebobo
Sebobo force-pushed the bugfix/5660-move-leads-to-duplicated-nodes branch from a2b640c to b871403 Compare March 23, 2026 09:29

@Sebobo Sebobo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @skurfuerst, thx for the fix!
The tree state is now also correct after adding a feedback to update the previous parent.

I updated the PR description to delegate the redirect fix in case of moving the current document to a separate issue + PR. In general I think the UI should still know that we are moving something to f.e. take care of the redirect. I thought about adding a redirect feedback if the parent changed and the current node is a document, but that would also be wrong if the moved node was not the current document node.

A conditional redirect as last feedback could be better. But then the ui redirects twice, as the removal also would trigger one. So the atomic feedbacks keep the state in check, but don't provide a good user experience necessarily.

@kdambekalns kdambekalns left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks clean, but adds "code threplication".

Anyway, don't feel competent enough to approve this. 🤷‍♂️

@mhsdesign

mhsdesign commented Mar 25, 2026 •

Copy link
Copy Markdown
Member

With this change we should also adjust Neos 9.1 where we currently get the inline drag and drop to function by removing the dom node manually. This is no longer necessary and saves us the todo to actually verify that the server can move the node:

// Move the node to the target context path based on the drop position
moveNodes(
[draggedNodeContextPath],
targetNodeContextPath,
insertPosition
);
// Remove the original node from the DOM
// TODO: Verify that the move was successful before removing the node
const movedNode = findNodeInGuestFrame(draggedNodeContextPath, draggedNodeFusionPath);
if (movedNode) {
movedNode.remove();
}

PR -> #4103

mhsdesign added a commit to mhsdesign/neos-ui that referenced this pull request Mar 25, 2026
…al from the dom

With the 9.0 fix neos#4018 we can adjust Neos 9.1 where we currently get the inline drag and drop to function by removing the dom node manually. This is no longer necessary and saves us the todo to actually verify that the server can move the node
@Sebobo

Sebobo commented Mar 25, 2026

Copy link
Copy Markdown
Member

With this change we should also adjust Neos 9.1 where we currently get the inline drag and drop to function by removing the dom node manually. This is no longer necessary and saves us the todo to actually verify that the server can move the node:

ONLY if the response is fast enough, we have to verify that!

@skurfuerst skurfuerst left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll merge this, thanks for the addition and review :)

@skurfuerst
skurfuerst merged commit 14364da into 9.0 Mar 26, 2026
8 of 9 checks passed
@skurfuerst
skurfuerst deleted the bugfix/5660-move-leads-to-duplicated-nodes branch March 26, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

9.0 Bug Label to mark the change as bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Content sometimes appears twice when moved via content tree (old position + new position)

4 participants