Skip to content

Conversation

@kfc35
Copy link
Contributor

@kfc35 kfc35 commented Dec 15, 2025

Objective

Solution

  • Implements the solution as suggested by 21949. The Directional Navigation Map does not prune any old edges that may be connected to removed Nodes, so we clear the map between rebuilds of the map.

(If the more preferable solution figures out what nodes were removed and then calls map.remove_multiple instead, you can feel free to reject this)

Testing

  • Did you test these changes? If so, how?
    I did not test this change, but the reporter of the issue did (via backport to an older version of Bevy). However, the fix is straightforward and explains itself. If you would like an automated test somehow, some pointers to tests that do similar would be welcome.

@kfc35 kfc35 changed the title Fix: Clears dir nav map between rebuilds Fix: Clears directional navigation map between rebuilds Dec 15, 2025
@kfc35 kfc35 force-pushed the 21949_clear_dir_nav_map_btwn_renders branch from 4c18c64 to f66549f Compare December 15, 2025 07:36
@alice-i-cecile alice-i-cecile modified the milestones: 0.19, 0.18 Dec 15, 2025
@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-UI Graphical user interfaces, styles, layouts, and widgets D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Dec 15, 2025
@alice-i-cecile
Copy link
Member

A small note in the documentation about this behavior might be nice, but it also feels unsurprising that this system does this so I won't block.

@viridia
Copy link
Contributor

viridia commented Dec 15, 2025

I'm fine with this.

If you are concerned about the overhead of rebuilding the map each time, then a mark-and-sweep approach might work.

@alice-i-cecile alice-i-cecile 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 Dec 15, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Dec 15, 2025
Merged via the queue into bevyengine:main with commit 545a97d Dec 15, 2025
46 checks passed
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

None yet

Development

Successfully merging this pull request may close these issues.

DirectionalNavigation: auto_rebuild_ui_navigation_graph does not clear map, leaves stale edges after re-renders

3 participants