bevy/release-content/release-notes
ickshonpe d195116426
Improved UI scrolling support and bug fixes (#20093)
# Objective

#### Goals
* Stop layout updates from overwriting `ScrollPosition`.
* Make `ScrollPosition` respect scale factor.
* Automatically allocate space for a scrollbar on an axis when
`OverflowAxis::Scroll` is set.
 
#### Non-Goals
* Overflow-auto support (I was certain Taffy had this already, but
apparently I was hallucinating).
* Implement any sort of scrollbar widgets.
* Stability (not needed because no overflow-auto support).
* Maybe in the future we could make a `ScrollbarWidth` enum to more
closely match the CSS API with its auto/narrow/none options. For now
`scrollbar_width` is just an `f32` which matches Taffy's API.

## Solution

* Layout updates no longer overwrite `ScrollPosition`'s value.
* Added the field `scrollbar_width: f32` to `Node`. This is sent to
`Taffy` which will automatically allocate space for scrollbars with this
width in the layout as needed.
* Added the fields `scrollbar_width: f32` and `scroll_position: Vec2` to
`ComputedNode`. These are updated automatically during layout.
* `ScrollPosition` now respects scale factor.
* `ScrollPosition` is no longer automatically added to every UI node
entity by `ui_layout_system`. If every node needs it, it should just be
required by (or be a field on) `Node`. Not sure if that's necessary or
not.

## Testing
For testing you can look at:
* The `scrollbars` example, which should work as before.
* The new example `drag_to_scroll`.
* The `scroll` example which automatically allocates space for
scrollbars on the left hand scrolling list. Did not implement actual
scrollbars so you'll just see a gap atm.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2025-07-15 17:33:04 +00:00
..
.gitkeep
automatic_scrollbar_space_allocation.md Improved UI scrolling support and bug fixes (#20093) 2025-07-15 17:33:04 +00:00
bevy_solari.md Fix visibility (re)use in Solari DI (#20113) 2025-07-13 19:33:09 +00:00
bevy_ui_render_crate.md bevy_ui_render crate (#18703) 2025-07-03 23:36:35 +00:00
entity-spawn-ticks.md Fix EntityMeta.spawned_or_despawned unsoundness (#19350) 2025-05-27 22:45:07 +00:00
event_split.md Remove the need to derive Event when deriving EntityEvent (#20104) 2025-07-15 16:45:38 +00:00
faster-zstd-option.md Add zstd release note (#20053) 2025-07-14 20:53:26 +00:00
feathers.md Feathers toggle switches. (#19928) 2025-07-03 01:09:31 +00:00
frame_time_graph.md Add frame_time graph to fps_overlay v2 (#19277) 2025-07-09 16:59:21 +00:00
headless-widgets.md Changing the notification protocol for core_widgets. (#20086) 2025-07-13 17:25:11 +00:00
hot_patching.md Hot patching systems with subsecond (#19309) 2025-06-03 21:12:38 +00:00
key_buttoninput.md Add support for ButtonInput<Key> (#19684) 2025-06-18 20:15:03 +00:00
light-textures.md Add release note for light textures (#20023) 2025-07-14 20:47:45 +00:00
log-diagnostics-state-public.md Expose LogDiagnosticsState (#19323) 2025-05-23 20:56:36 +00:00
observer_overhaul.md Observer trigger refactor (#19935) 2025-07-04 16:27:21 +00:00
render_startup.md Add release notes and a migration guide for RenderStartup. (#20024) 2025-07-09 23:40:42 +00:00
scene-type-crates.md Add a release note for scene types refactor (#20051) 2025-07-11 07:34:06 +00:00
specialized_ui_transform.md Specialized UI transform (#16615) 2025-06-09 19:05:49 +00:00
system_set_naming_convention.md Adopt consistent FooSystems naming convention for system sets (#18900) 2025-05-06 15:18:03 +00:00
text-background-colors.md
tilemap-chunk-rendering.md Add TilemapChunk rendering (#18866) 2025-06-23 23:55:10 +00:00
ui_gradients.md HSL and HSV interpolation for UI gradients (#19992) 2025-07-07 20:08:51 +00:00
viewport-node.md Add a viewport UI widget (#17253) 2025-05-05 22:57:37 +00:00