Skip to content

Fix GhostNode updates#24001

Merged
alice-i-cecile merged 4 commits intobevyengine:mainfrom
ickshonpe:fix-ghost-node-updates
Apr 28, 2026
Merged

Fix GhostNode updates#24001
alice-i-cecile merged 4 commits intobevyengine:mainfrom
ickshonpe:fix-ghost-node-updates

Conversation

@ickshonpe
Copy link
Copy Markdown
Contributor

@ickshonpe ickshonpe commented Apr 27, 2026

Objective

The UI node and Taffy node trees aren't synchronised correctly after GhostNodes are added, removed, or detached.

Solution

Collect the closest non-ghost ancestor of entities where GhostNode was added or removed since the last layout update, and update their corresponding children in the taffy tree.

Testing

Un#[ignore]ed the failing ghost node tests and they pass now:

cargo test -p bevy_ui --lib layout::tests --features="ghost_nodes"

…hment.

Collect the parents of entities that had `GhostNode` added or removed since the last layout update and update their children in the taffy tree..
@ickshonpe ickshonpe added this to the 0.19 milestone Apr 27, 2026
@ickshonpe ickshonpe added the A-UI Graphical user interfaces, styles, layouts, and widgets label Apr 27, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in UI Apr 27, 2026
@ickshonpe ickshonpe added D-Straightforward Simple bug fixes and API improvements, docs, test and examples C-Bug An unexpected or incorrect behavior S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 27, 2026
Copy link
Copy Markdown
Contributor

@kfc35 kfc35 left a comment

Choose a reason for hiding this comment

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

“dirty ghost children” is going to be a phrase I will remember randomly

@kfc35 kfc35 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 28, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 28, 2026
Merged via the queue into bevyengine:main with commit 8d88f59 Apr 28, 2026
40 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in UI Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants