Reconsider design of `WindowTraversal` to decouple `input_focus`
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
Originally posted by @ickshonpe in https://github.com/bevyengine/bevy/pull/19736#discussion_r2160081772:
> I really don't like that part of the design of `WindowTraversal` then, but I can see that it's out of scope to complain about it here. Feels like probably the input focus module shouldn't need to have any knowledge of windows at all.
>> Given that there are several places in Bevy where a UI node wants to know what window it's on, I wonder if it makes sense to propagate the window ref downward in the hierarchy (now that we have propagation).
>
> The UI already does window entity propagation through the `ComputedNodeTarget` component. Maybe the propagation system needs to be replaced using the new features though.
Contributor guide
Research direction
Start by reading the WindowTraversal and input_focus design discussed in PR #19736, then inspect how ComputedNodeTarget propagates a UI node's window entity. Determine whether window knowledge can be removed from input focus and whether existing propagation should be replaced. Done means an agreed, implemented design that decouples these responsibilities without losing window information for UI nodes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100