Fix AI panel unexpectedly closing in zoom mode during scrolling (#33430)

Modified zoom handling logic in workspace.rs to be more conservative:
- Only dismiss zoomed panels when the focused pane is itself zoomed
- Remove zoom dismissal when revealing docks

This prevents the AI panel from closing during scroll operations when
focus temporarily shifts between components.
This commit is contained in:
Rafał Krzyważnia 2025-07-01 22:34:02 +02:00
parent 32906bfa7c
commit 4c3420f3f6
No known key found for this signature in database
GPG key ID: 056C31DF20A2DF32

View file

@ -2743,10 +2743,6 @@ impl Workspace {
}
});
if reveal_dock {
self.dismiss_zoomed_items_to_reveal(Some(dock_side), window, cx);
}
if focus_center {
self.active_pane
.update(cx, |pane, cx| window.focus(&pane.focus_handle(cx)))
@ -3650,14 +3646,19 @@ impl Workspace {
self.last_active_center_pane = Some(pane.downgrade());
}
self.dismiss_zoomed_items_to_reveal(None, window, cx);
// Handle zoom state changes
if pane.read(cx).is_zoomed() {
// This pane is zoomed, dismiss other zoomed items
self.dismiss_zoomed_items_to_reveal(None, window, cx);
self.zoomed = Some(pane.downgrade().into());
} else {
self.zoomed_position = None;
cx.emit(Event::ZoomChanged);
} else {
// No zoomed items
self.zoomed = None;
self.zoomed_position = None;
}
self.zoomed_position = None;
cx.emit(Event::ZoomChanged);
self.update_active_view_for_followers(window, cx);
pane.update(cx, |pane, _| {
pane.track_alternate_file_items();