From 54b4587f9a21441f5e871e42057d7e02528531c5 Mon Sep 17 00:00:00 2001 From: smaster <155565310+SMASTER4@users.noreply.github.com> Date: Mon, 9 Jun 2025 12:39:53 +0200 Subject: [PATCH] Add bound checks for resizing right dock (#32246) Closes #30293 [Before](https://github.com/user-attachments/assets/0b95e317-391a-4d90-ba78-ed3d4f10871d) | [After](https://github.com/user-attachments/assets/23002a73-103c-4a4f-a7a1-70950372c9d9) Release Notes: - Fixed right panel expanding in backwards, when dragged out of its intended bounds, by adding a bounds check to ensure its size never gets to high. --- crates/workspace/src/workspace.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index adf16c0910..33d1d74d4e 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -6255,7 +6255,15 @@ fn resize_right_dock( window: &mut Window, cx: &mut App, ) { - let size = new_size.max(workspace.bounds.left() - RESIZE_HANDLE_SIZE); + let mut size = new_size.max(workspace.bounds.left() - RESIZE_HANDLE_SIZE); + workspace.left_dock.read_with(cx, |left_dock, cx| { + let left_dock_size = left_dock + .active_panel_size(window, cx) + .unwrap_or(Pixels(0.0)); + if left_dock_size + size > workspace.bounds.right() { + size = workspace.bounds.right() - left_dock_size + } + }); workspace.right_dock.update(cx, |right_dock, cx| { if WorkspaceSettings::get_global(cx) .resize_all_panels_in_dock