Skip to content

Conversation

@kfc35
Copy link
Contributor

@kfc35 kfc35 commented Dec 19, 2025

Objective

Solution

At the suggestion of @viridia and affirmed by @ickshonpe on Discord, the directional navigation map should no longer contain any AutoDirectionalNavigation node connections. This PR:

  • Removes the system that inserts those types of connections into the map and places the burden of the map’s management fully onto the developer. The directional navigation map is now only used to specify manual edges.
  • Adds a brute force search among AutoDirectionalNavigation nodes within the navigate function of the DirectionalNavigation system parameter. navigate will prefer to find a destination within the map of manual edges first before conducting the brute force search.

Testing

  • Did you test these changes? If so, how?
    There are two relevant examples that I tested to ensure there were no regressions:
    cargo run --example directional_navigation: manually defined edges are respected. Navigating east and west along the same row loops correctly, and navigating north and south along a column works without looping as specified in the example.
    cargo run --example auto_directional_navigation: Navigation also works as expected here.
    However, I did not manually test whether removing an AutoDirectionalNavigation node during execution of an app results in the navigation system adapting, but I assume it would be evident since the algorithm is no longer using a cached map of those types of edges.
  • Are there any parts that need more testing?
    I wanted to have a go at writing an automated test for the “automatic” portion of it, but I got stuck trying to get the spawned nodes to have valid values for their ComputedNode and UiGlobalTransform (values that didn't represent zero sized content or no translation despite my attempts at specifying so). I just stuck to validating that behavior via the auto_directional_navigation example.
    It would be nice to have a test with both automatic and manual navigation would be nice to have, but may be overkill. It’s just relatively simple if/else logic there.
  • How can other people (reviewers) test your changes? Is there anything specific they need to know?
    You can test out the examples to make sure that the directional navigation behaves as expected. If you’d like to go above and beyond, you could try removing some AutoDirectionalNavigation nodes during execution and seeing if navigation adapts.
  • If relevant, what platforms did you test these changes on, and are there any important ones you can't test?
    I’ve only run the examples on MacOS

@kfc35 kfc35 changed the title DirectionalNavigationMap no longer caches AutoDirectionalNavigation node connections DirectionalNavigationMap no longer caches AutoDirectionalNavigation node connections Dec 19, 2025
@ickshonpe ickshonpe added C-Bug An unexpected or incorrect behavior A-UI Graphical user interfaces, styles, layouts, and widgets D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Dec 21, 2025
@ickshonpe ickshonpe self-requested a review December 21, 2025 10:59
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-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward

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

2 participants