ZIm/crates/workspace/src
Finn Evers 5b3e371812
gpui: Round scroll_max to two decimal places (#34832)
Follow up to #31836 

After enabling rounding in the Taffy layout engine, we frequently run
into cases where the bounds produced by Taffy and ours slightly differ
after 5 or more decimal places. This leads to cases where containers
become scrollable for less than 0.0000x Pixels. In case this happens for
e.g. hover popovers, we render a scrollbar due to the container being
technically scrollable, even though the scroll amount here will in
practice never be visible.

This change fixes this by rounding the `scroll_max` by which we clamp
the current scroll position to two decimal places. We don't benefit from
the additional floating point precision here at all and it stops such
containers from becoming scrollable altogether. Furthermore, we now
store the `scroll_max` instead of the `padded_content_size` as the
former gives a much better idea on whether the corresponding container
is scrollable or not.

| `main` | After these changes |
| -- | -- |
| <img width="610" height="316" alt="main"
src="https://github.com/user-attachments/assets/ffcc0322-6d6e-4f79-a916-bd3c57fe4211"
/> | <img width="610" height="316" alt="scroll_max_rounded"
src="https://github.com/user-attachments/assets/5fe530f5-2e21-4aaa-81f4-e5c53ab73e4f"
/> |

Release Notes:

- Fixed an issue where scrollbars would appear in containers where no
scrolling was possible.
2025-07-21 22:24:33 +02:00
..
persistence Use read-only access methods for read-only entity operations (#31479) 2025-05-26 23:04:31 -04:00
dock.rs linux: Fix buttons clicks wouldn’t work on startup until clicked on center pane (#34590) 2025-07-17 06:36:02 +05:30
history_manager.rs History manager (#26369) 2025-04-11 21:34:51 +00:00
item.rs Don't autosave unmodified buffers (#32626) 2025-06-12 22:12:14 +00:00
modal_layer.rs editor: Hide mouse context menu when modal is opened (#29127) 2025-04-21 20:13:26 +05:30
notifications.rs Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
pane.rs gpui: Round scroll_max to two decimal places (#34832) 2025-07-21 22:24:33 +02:00
pane_group.rs Improve cursor style behavior for some draggable elements (#31965) 2025-06-06 16:56:27 -04:00
persistence.rs zlog: Replace usages of env_logger in tests with zlog (#31436) 2025-05-26 11:48:50 -04:00
searchable.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
shared_screen.rs Add searchable global tab switcher (#28047) 2025-04-28 09:21:27 +00:00
status_bar.rs Refine status bar design (#34324) 2025-07-12 11:48:19 -03:00
tasks.rs debugger: Debug sessions rerun build tasks by default when restarting (#33724) 2025-07-01 15:43:58 -04:00
theme_preview.rs gpui: Store action documentation (#33809) 2025-07-02 21:14:33 -04:00
toast_layer.rs Move workspace::toast_layer::RunAction to zed_actions::toast::RunAction (#32222) 2025-06-06 06:23:09 +00:00
toolbar.rs Fix toolbar spacing regressions (#29964) 2025-05-05 22:28:35 -03:00
workspace.rs Rename "CloseInactiveItems" action to "CloseOtherItems" (#34676) 2025-07-17 21:40:02 -03:00
workspace_settings.rs workspace: Add setting to make dock resize apply to all panels (#30551) 2025-06-04 17:40:35 +00:00