Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5335b24
Squashed commit of the following:
micttyoid Mar 13, 2026
e7bab9f
Apply migration guide to examples
micttyoid Mar 13, 2026
6c8b886
Include `InputDispatchPlugin` in `DefaultPlugins`
micttyoid Mar 14, 2026
714bd13
Move popover and scrollbar to bevy_ui
micttyoid Mar 15, 2026
d310bdf
Ambiguate the execution orders of systems in `InputDispatchPlugin`
micttyoid Mar 15, 2026
79940d7
Wrap the execution orders in system sets
micttyoid Mar 16, 2026
8ec74b4
Wrap the execution orders in system sets
micttyoid Mar 16, 2026
fb25d06
Stub in migration guide
micttyoid Mar 16, 2026
f7fad09
Regress update_scrollbar_thumb and position_popover to private
micttyoid Mar 16, 2026
12bb5f7
Update the migration guide
micttyoid Mar 16, 2026
36ddbad
Resolve MD031/blanks-around-fences
micttyoid Mar 16, 2026
9c21ed7
Update the migration guide
micttyoid Mar 16, 2026
e2d6051
Merge branch 'main' into ui-widgets-to-default-2
micttyoid Mar 17, 2026
d36148e
Update release-content/migration-guides/ui_widgets_plugins_and_input_…
micttyoid Mar 17, 2026
aee5607
Merge branch 'main' into ui-widgets-to-default-2
micttyoid Mar 17, 2026
56937a6
Merge branch 'main' into ui-widgets-to-default-2
micttyoid Mar 20, 2026
e2ff949
Merge branch 'main' into ui-widgets-to-default-2
micttyoid Mar 23, 2026
3e1f711
Merge branch 'main' into ui-widgets-to-default-2
micttyoid Mar 27, 2026
39cc0e3
Merge branch 'main' into ui-widgets-to-default-2
micttyoid Mar 28, 2026
69fa98e
Add `UiSystems::ComputeRelative`
micttyoid Mar 28, 2026
25880c6
Remove unused import
micttyoid Mar 29, 2026
8e6a735
Remove dead code
micttyoid Mar 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
title: "`UiWidgetsPlugins` and `InputDispatchPlugin` are now in `DefaultPlugins`"
pull_requests: [23346]
---

`UiWidgetsPlugins` and `InputDispatchPlugin` are now part of `DefaultPlugins`.

TODO: Why did we make this breaking change?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I’m not sure if this is necessary to be answered in every migration guide, but someone else can give more context for this. I wouldn’t say it’s just for deprecation of Interaction, but because these plugins are mature enough that they now can be included in the default experience.


Remove `UiWidgetsPlugins` if you have `DefaultPlugins`

```rs
// 0.18
fn main() {
App::new()
.add_plugins(DefaultPlugins, UiWidgetsPlugins)
.add_plugins((my_ambitious_game::game_plugin))
.run();
}

// 0.19
fn main() {
App::new()
.add_plugins(DefaultPlugins) // Puff!
.add_plugins((my_ambitious_game::game_plugin))
.run();
}
```

Remove `InputDispatchPlugin` if you have `DefaultPlugins`

```rs
// 0.18
fn main() {
App::new()
.add_plugins(DefaultPlugins, UiWidgetsPlugins, InputDispatchPlugin)
.add_plugins((my_sequel_game::game_plugin))
.run();
}

// 0.19
fn main() {
App::new()
.add_plugins(DefaultPlugins) // Puff!
.add_plugins((my_sequel_game::game_plugin))
.run();
}
```

Remove `PopoverPlugin` if you have `DefaultPlugins`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I personally would remove the Popover and ScrollbarPlugin sections, since I’m not sure how many people are explicitly adding these two plugins over just importing all of UiWidgetsPlugins. Plus, I’m not sure why only those two should be specified explicitly at this point in time, considering they now aren’t being moved out from UiWidgetsPlugins anymore.


```rs
// 0.18
fn main() {
App::new()
.add_plugins(DefaultPlugins, PopoverPlugin)
.add_plugins((my_threequel_game::game_plugin))
.run();
}

// 0.19
fn main() {
App::new()
.add_plugins(DefaultPlugins) // Puff!
.add_plugins((my_threequel_game::game_plugin))
.run();
}
```

Remove `ScrollbarPlugin` if you have `DefaultPlugins`

```rs
// 0.18
fn main() {
App::new()
.add_plugins(DefaultPlugins, ScrollbarPlugin)
.add_plugins((my_fourquel_game::game_plugin))
.run();
}

// 0.19
fn main() {
App::new()
.add_plugins(DefaultPlugins) // Puff!
.add_plugins((my_fourquel_game::game_plugin))
.run();
}
```
5 changes: 1 addition & 4 deletions crates/bevy_feathers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ use bevy_app::{
};
use bevy_asset::embedded_asset;
use bevy_ecs::{query::With, schedule::IntoScheduleConfigs};
use bevy_input_focus::{tab_navigation::TabNavigationPlugin, InputDispatchPlugin};
use bevy_input_focus::tab_navigation::TabNavigationPlugin;
use bevy_text::{TextColor, TextFont};
use bevy_ui::UiSystems;
use bevy_ui_render::UiMaterialPlugin;
use bevy_ui_widgets::UiWidgetsPlugins;

use crate::{
alpha_pattern::{AlphaPatternMaterial, AlphaPatternResource},
Expand Down Expand Up @@ -101,8 +100,6 @@ pub struct FeathersPlugins;
impl PluginGroup for FeathersPlugins {
fn build(self) -> PluginGroupBuilder {
PluginGroupBuilder::start::<Self>()
.add_group(UiWidgetsPlugins)
.add(InputDispatchPlugin)
.add(TabNavigationPlugin)
.add(FeathersPlugin)
}
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_gizmos_render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ bevy_reflect = { path = "../bevy_reflect", version = "0.19.0-dev" }
bevy_color = { path = "../bevy_color", version = "0.19.0-dev" }
bevy_material = { path = "../bevy_material", version = "0.19.0-dev" }
bevy_log = { path = "../bevy_log", version = "0.19.0-dev" }
bevy_ui = { path = "../bevy_ui", version = "0.19.0-dev" }

# other
bytemuck = "1.0"
Expand Down
3 changes: 2 additions & 1 deletion crates/bevy_gizmos_render/src/transform_gizmo_render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ impl Plugin for TransformGizmoRenderPlugin {
PostUpdate,
update_gizmo_meshes
.after(bevy_transform::TransformSystems::Propagate)
.after(bevy_camera::visibility::VisibilitySystems::VisibilityPropagate),
.after(bevy_camera::visibility::VisibilitySystems::VisibilityPropagate)
.ambiguous_with(bevy_ui::UiSystems::ComputeRelative),
);
}
}
Expand Down
6 changes: 5 additions & 1 deletion crates/bevy_input_focus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ use bevy_input::gamepad::GamepadButtonChangedEvent;
use bevy_input::keyboard::KeyboardInput;
#[cfg(feature = "mouse")]
use bevy_input::mouse::MouseWheel;
use bevy_input::InputSystems;
use bevy_window::{PrimaryWindow, Window};
use core::fmt::Debug;

Expand Down Expand Up @@ -219,6 +220,7 @@ impl Traversal<AcquireFocus> for WindowTraversal {
///
/// To add bubbling to your own input events, add the [`dispatch_focused_input::<MyEvent>`](dispatch_focused_input) system to your app,
/// as described in the docs for [`FocusedInput`].
#[derive(Default)]
pub struct InputDispatchPlugin;

impl Plugin for InputDispatchPlugin {
Expand All @@ -238,7 +240,9 @@ impl Plugin for InputDispatchPlugin {
#[cfg(feature = "mouse")]
dispatch_focused_input::<MouseWheel>,
)
.in_set(InputFocusSystems::Dispatch),
.in_set(InputFocusSystems::Dispatch)
.ambiguous_with(InputFocusSystems::Dispatch)
.after(InputSystems),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Technically I think you only need this.after() statement on dispatch_focused_input::<GamepadButtonChangedEvent>

);
}
}
Expand Down
5 changes: 5 additions & 0 deletions crates/bevy_internal/src/default_plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ plugin_group! {
bevy_transform:::TransformPlugin,
bevy_diagnostic:::DiagnosticsPlugin,
bevy_input:::InputPlugin,
#[cfg(feature = "bevy_input_focus")]
bevy_input_focus:::InputDispatchPlugin,
#[custom(cfg(not(feature = "bevy_window")))]
bevy_app:::ScheduleRunnerPlugin,
#[cfg(feature = "bevy_window")]
Expand Down Expand Up @@ -90,6 +92,9 @@ plugin_group! {
#[cfg(feature = "hotpatching")]
bevy_app::hotpatch:::HotPatchPlugin,
#[plugin_group]
#[cfg(feature = "bevy_ui_widgets")]
bevy_ui_widgets:::UiWidgetsPlugins,
#[plugin_group]
#[cfg(feature = "bevy_picking")]
bevy_picking:::DefaultPickingPlugins,
#[doc(hidden)]
Expand Down
8 changes: 6 additions & 2 deletions crates/bevy_ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub mod prelude {
}

use bevy_app::{prelude::*, AnimationSystems, HierarchyPropagatePlugin, PropagateSet};
use bevy_camera::CameraUpdateSystems;
use bevy_camera::{visibility::VisibilitySystems, CameraUpdateSystems};
use bevy_ecs::prelude::*;
use bevy_input::InputSystems;
use bevy_transform::TransformSystems;
Expand Down Expand Up @@ -112,6 +112,8 @@ pub enum UiSystems {
///
/// Runs in [`PostUpdate`].
Stack,
/// After this label, TODO
ComputeRelative,
}

/// The current scale of the UI.
Expand Down Expand Up @@ -150,6 +152,7 @@ impl Plugin for UiPlugin {
UiSystems::Content,
UiSystems::Layout,
UiSystems::PostLayout,
UiSystems::ComputeRelative.after(VisibilitySystems::VisibilityPropagate),
)
.chain(),
)
Expand Down Expand Up @@ -216,7 +219,8 @@ impl Plugin for UiPlugin {
.in_set(UiSystems::PostLayout)
.in_set(AmbiguousWithText)
.in_set(AmbiguousWithUpdateText2dLayout),
),
)
.before(UiSystems::ComputeRelative),
);

build_text_interop(app);
Expand Down
3 changes: 2 additions & 1 deletion crates/bevy_ui_widgets/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ use crate::popover::PopoverPlugin;

/// A plugin group that registers the observers for all of the widgets in this crate. If you don't want to
/// use all of the widgets, you can import the individual widget plugins instead.
#[derive(Default)]
pub struct UiWidgetsPlugins;

impl PluginGroup for UiWidgetsPlugins {
Expand All @@ -54,8 +55,8 @@ impl PluginGroup for UiWidgetsPlugins {
.add(CheckboxPlugin)
.add(MenuPlugin)
.add(RadioGroupPlugin)
.add(ScrollbarPlugin)
.add(SliderPlugin)
.add(ScrollbarPlugin)
.add(EditableTextInputPlugin)
}
}
Expand Down
5 changes: 4 additions & 1 deletion crates/bevy_ui_widgets/src/popover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ pub struct PopoverPlugin;

impl Plugin for PopoverPlugin {
fn build(&self, app: &mut App) {
app.add_systems(PostUpdate, position_popover.in_set(UiSystems::Prepare));
app.add_systems(
PostUpdate,
position_popover.in_set(UiSystems::ComputeRelative),
);
}
}

Expand Down
13 changes: 10 additions & 3 deletions crates/bevy_ui_widgets/src/scrollbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ use bevy_ecs::{
observer::On,
query::{With, Without},
reflect::ReflectComponent,
schedule::IntoScheduleConfigs,
system::{Query, Res},
};
use bevy_math::Vec2;
use bevy_picking::events::{Cancel, Drag, DragEnd, DragStart, Pointer, Press};
use bevy_reflect::{prelude::ReflectDefault, Reflect};
use bevy_ui::{
ComputedNode, ComputedUiRenderTargetInfo, Node, ScrollPosition, UiGlobalTransform, UiScale, Val,
ComputedNode, ComputedUiRenderTargetInfo, Node, ScrollPosition, UiGlobalTransform, UiScale,
UiSystems, Val,
};

/// Used to select the orientation of a scrollbar, slider, or other oriented control.
Expand Down Expand Up @@ -48,7 +50,7 @@ pub enum ControlOrientation {
/// The application is free to position the scrollbars relative to the scrolling container however
/// it wants: it can overlay them on top of the scrolling content, or use a grid layout to displace
/// the content to make room for the scrollbars.
#[derive(Component, Debug, Reflect)]
#[derive(Component, Debug, Reflect, Clone, PartialEq)]
#[reflect(Component)]
pub struct Scrollbar {
/// Entity being scrolled.
Expand Down Expand Up @@ -363,6 +365,11 @@ impl Plugin for ScrollbarPlugin {
.add_observer(scrollbar_on_drag_end)
.add_observer(scrollbar_on_drag_cancel)
.add_observer(scrollbar_on_drag)
.add_systems(PostUpdate, update_scrollbar_thumb);
.add_systems(
PostUpdate,
update_scrollbar_thumb
.in_set(UiSystems::ComputeRelative)
.ambiguous_with(UiSystems::ComputeRelative),
);
}
}
8 changes: 2 additions & 6 deletions examples/ui/navigation/directional_navigation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use bevy::{
camera::NormalizedRenderTarget,
input_focus::{
directional_navigation::{AutoNavigationConfig, DirectionalNavigationPlugin},
InputDispatchPlugin, InputFocus, InputFocusVisible,
InputFocus, InputFocusVisible,
},
math::{CompassOctant, Dir2, Rot2},
picking::{
Expand All @@ -35,11 +35,7 @@ use bevy::{
fn main() {
App::new()
// Input focus is not enabled by default, so we need to add the corresponding plugins
.add_plugins((
DefaultPlugins,
InputDispatchPlugin,
DirectionalNavigationPlugin,
))
.add_plugins((DefaultPlugins, DirectionalNavigationPlugin))
// This resource is canonically used to track whether or not to render a focus indicator
// It starts as false, but we set it to true here as we would like to see the focus indicator
.insert_resource(InputFocusVisible(true))
Expand Down
8 changes: 2 additions & 6 deletions examples/ui/navigation/directional_navigation_overrides.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use bevy::{
directional_navigation::{
AutoNavigationConfig, DirectionalNavigationMap, DirectionalNavigationPlugin,
},
InputDispatchPlugin, InputFocus, InputFocusVisible,
InputFocus, InputFocusVisible,
},
math::{CompassOctant, Dir2},
picking::{
Expand All @@ -41,11 +41,7 @@ fn main() {
App::new()
// Input focus is not enabled by default, so we need to add the corresponding plugins
// The navigation system's resources are initialized by the DirectionalNavigationPlugin.
.add_plugins((
DefaultPlugins,
InputDispatchPlugin,
DirectionalNavigationPlugin,
))
.add_plugins((DefaultPlugins, DirectionalNavigationPlugin))
// This resource is canonically used to track whether or not to render a focus indicator
// It starts as false, but we set it to true here as we would like to see the focus indicator
.insert_resource(InputFocusVisible(true))
Expand Down
16 changes: 3 additions & 13 deletions examples/ui/scroll_and_overflow/scrollbars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,15 @@

use bevy::{
ecs::{relationship::RelatedSpawner, spawn::SpawnWith},
input_focus::{
tab_navigation::{TabGroup, TabNavigationPlugin},
InputDispatchPlugin,
},
input_focus::tab_navigation::{TabGroup, TabNavigationPlugin},
picking::hover::Hovered,
prelude::*,
ui_widgets::{
ControlOrientation, CoreScrollbarDragState, CoreScrollbarThumb, Scrollbar, ScrollbarPlugin,
},
ui_widgets::{ControlOrientation, CoreScrollbarDragState, CoreScrollbarThumb, Scrollbar},
};

fn main() {
App::new()
.add_plugins((
DefaultPlugins,
ScrollbarPlugin,
InputDispatchPlugin,
TabNavigationPlugin,
))
.add_plugins((DefaultPlugins, TabNavigationPlugin))
.insert_resource(UiScale(1.25))
.add_systems(Startup, setup_view_root)
.add_systems(Update, update_scrollbar_thumb)
Expand Down
11 changes: 3 additions & 8 deletions examples/ui/widgets/standard_widgets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use bevy::{
color::palettes::basic::*,
input_focus::{
tab_navigation::{TabGroup, TabIndex, TabNavigationPlugin},
InputDispatchPlugin, InputFocus,
InputFocus,
},
picking::hover::Hovered,
prelude::*,
Expand All @@ -20,18 +20,13 @@ use bevy::{
popover::{Popover, PopoverAlign, PopoverPlacement, PopoverSide},
Activate, Button, Checkbox, CoreSliderDragState, MenuAction, MenuButton, MenuEvent,
MenuItem, MenuPopup, RadioButton, RadioGroup, Slider, SliderRange, SliderThumb,
SliderValue, TrackClick, UiWidgetsPlugins, ValueChange,
SliderValue, TrackClick, ValueChange,
},
};

fn main() {
App::new()
.add_plugins((
DefaultPlugins,
UiWidgetsPlugins,
InputDispatchPlugin,
TabNavigationPlugin,
))
.add_plugins((DefaultPlugins, TabNavigationPlugin))
.insert_resource(DemoWidgetStates {
slider_value: 50.0,
slider_click: TrackClick::Snap,
Expand Down
Loading