From 4ed3c133cffa278c3ff01cb6b1b9c5ad5b83f55b Mon Sep 17 00:00:00 2001 From: Aaron Feickert <66188213+AaronFeickert@users.noreply.github.com> Date: Fri, 17 Jan 2025 02:01:50 -0600 Subject: [PATCH] Remember active panel after closing dock (#23207) A recent change in #22730 (to reduce workspace serialization) means that a dock "forgets" its active panel whenever it is closed. When opened again, the change in #22346 (which establishes a panel activation order) takes effect, always opening the highest-priority panel for that dock instead of the panel the user previously manually activated. The result is that if you have, say, the outline panel active on the right dock, and toggle the dock closed and then back open again, the assistant panel will always appear instead. This PR reverts part of the change in #22730 to ensure a dock remembers its active panel when it is closed. Closes #22923. Release Notes: - Fixed an issue where docks did not remember the active panel. --- crates/workspace/src/dock.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/crates/workspace/src/dock.rs b/crates/workspace/src/dock.rs index 35b7a379b0dfdd596df98276f53385a62902bad9..d3114fcf55c936c7d9c7356fafb34a543b07c954 100644 --- a/crates/workspace/src/dock.rs +++ b/crates/workspace/src/dock.rs @@ -339,9 +339,6 @@ impl Dock { self.is_open = open; if let Some(active_panel) = self.active_panel_entry() { active_panel.panel.set_active(open, cx); - if !open { - self.active_panel_index = None; - } } cx.notify();