Skip to content

Conversation

@kfc35
Copy link
Contributor

@kfc35 kfc35 commented Jan 6, 2026

Objective

Solution

  • Creates a new example called directional_navigation_overrides (examples/ui/navigation/directional_navigation_overrides.rs) that demonstrates both auto navigation and manually defining edges via the DirectionalNavigationMap. The example uses the previous auto navigation example (now at examples/ui/navigation/directional_navigation.rs) as a base. It creates pages of AutoDirectionalNavigation buttons depicting different scenarioes where manual navigation is needed to create a desired experience.
  • Refactors the navigation examples like @it-me-joda into a subfolder. Renamed the examples to express their purpose, and removed the purely manual nav example since it is not useful anymore.

Testing

  • The example runs great cargo run --example directional_navigation_overrides. Screen recording attached.
  • The other example still runs via cargo run --example directional_navigation

Showcase

Screen Recording
Screen.Recording.2026-01-13.at.1.46.09.AM.mov

Copy link
Contributor

@it-me-joda it-me-joda left a comment

Choose a reason for hiding this comment

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

I think that I personally would rather have each navigation mode in a separate example. Then maybe a third that demonstrates that you could combine them? This current state is overwhelming at first glance. I think I would have examples like:

ui/navigation/
    auto-navigation
    manual-navigation
    combined-navigation

But that's just my personal opinion. I'd be curious to see what others think about it.

@alice-i-cecile alice-i-cecile added C-Examples An addition or correction to our examples A-UI Graphical user interfaces, styles, layouts, and widgets S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 7, 2026
@alice-i-cecile
Copy link
Member

I agree with @it-me-joda here, with the emphasis in the third example focusing on how and why to use overrides.

@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 7, 2026
@kfc35 kfc35 marked this pull request as draft January 7, 2026 19:14
@kfc35 kfc35 force-pushed the 22299_auto_and_manual_dir_nav branch 3 times, most recently from 159b127 to fc1c24d Compare January 11, 2026 21:31
@kfc35 kfc35 force-pushed the 22299_auto_and_manual_dir_nav branch from 8709d09 to 425a63b Compare January 12, 2026 04:04
@kfc35 kfc35 marked this pull request as ready for review January 12, 2026 04:13
@kfc35 kfc35 changed the title New navigation example combining auto and manual directional nav New combined_navigation example combining auto and manual directional nav Jan 12, 2026
@kfc35 kfc35 added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Jan 12, 2026
@kfc35
Copy link
Contributor Author

kfc35 commented Jan 12, 2026

Alrighty this is ready for review again! I refactored the navigation examples, tried to make a clear example where combined navigation is best suited, and put in the update_focus_display change (although the memory leak has been merged to main since then).

I updated the screen recording with this example in the first comment. Basically it is now three pages of buttons where transitions between pages and rows is and must be set up manually, but all other navigation is via the automatic system.

@kfc35 kfc35 requested a review from ickshonpe January 12, 2026 05:04
@viridia
Copy link
Contributor

viridia commented Jan 12, 2026

One of the motivations for manual navigation is to resolve ambiguities in automatic navigation. Consider the following:

A --- B
 \   /
  \ /
   C

          D

In this example, we might want D to be reachable from C in both the "down" and "right" direction. So while auto navigation will be sufficient for A B and C, we may want to add additional manual links from C to D.

@kfc35
Copy link
Contributor Author

kfc35 commented Jan 12, 2026

One of the motivations for manual navigation is to resolve ambiguities in automatic navigation. Consider the following:

A --- B
 \   /
  \ /
   C

          D

In this example, we might want D to be reachable from C in both the "down" and "right" direction. So while auto navigation will be sufficient for A B and C, we may want to add additional manual links from C to D.

Thanks for this! I’ll try to fit something like this in the example, probably as a separate bespoke page of buttons depicting this (or replacing one of the pages with this scenario)

@kfc35
Copy link
Contributor Author

kfc35 commented Jan 13, 2026

I incorporated @viridia ’s scenario as the page 2 of buttons ,and I inverted vertical navigation in page 3 to demonstrate a whimsy override.

The updated screen recording (which is also available in the description) is here
Screen.Recording.2026-01-13.at.1.46.09.AM.mov

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Okay, this is starting to look good!

There's a few notes on pedagogical structure:

  1. Automatic directional navigation should be the default for 99% of users; the example should be renamed to simply directional_navigation.
  2. Now that it exists, the manual_navigation example is misleading: no one should be doing this. It should be removed completely.
  3. The primary point of manual navigation is now for overriding edge cases produced by automatic directional navigation. The example name and module docs providing context should be reworked to reflect that; perhaps directional_navigation_overrides.rs?

The setup and content of the new example are quite nice though; I have no complaints there! Lots of boilerplate to set up the complex layout, but I'm happy with how clear it is.

@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged X-Contentious There are nontrivial implications that should be thought through D-Straightforward Simple bug fixes and API improvements, docs, test and examples and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 13, 2026
@kfc35 kfc35 added the C-Docs An addition or correction to our documentation label Jan 13, 2026
@kfc35 kfc35 force-pushed the 22299_auto_and_manual_dir_nav branch from 39207ce to f246aeb Compare January 13, 2026 20:55
@kfc35
Copy link
Contributor Author

kfc35 commented Jan 13, 2026

@alice-i-cecile I agree with your structure notes and implemented them. directional_navigation_overrides.rs sounds fine if not long, but could not think of a better name

I also went over the comments in the modules and updated them to the best of my ability to make the recommended uses clearer and the interactions with each other

I’m happy with the example now too :) feels comprehensive

@kfc35 kfc35 requested a review from alice-i-cecile January 13, 2026 21:26
@kfc35 kfc35 added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Jan 13, 2026
@kfc35 kfc35 changed the title New combined_navigation example combining auto and manual directional nav New directional_navigation_overrides example combining auto dir nav w/ manual overrides Jan 13, 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-Docs An addition or correction to our documentation C-Examples An addition or correction to our examples D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Contentious There are nontrivial implications that should be thought through

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bevy_input_focus: No example demonstrates how to use the DirectionalNavigationMap and automatic navigation together

5 participants