Fix panic opening branch picker in commit modal (#26407)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2025-03-10 16:36:23 -06:00 committed by GitHub
parent 06cbff6714
commit 96a75e08af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 13 deletions

View file

@ -35,7 +35,7 @@ use futures::{
Future, FutureExt, StreamExt,
};
use gpui::{
action_as, actions, canvas, deferred, impl_action_as, impl_actions, point, relative, size,
action_as, actions, canvas, impl_action_as, impl_actions, point, relative, size,
transparent_black, Action, AnyView, AnyWeakView, App, AsyncApp, AsyncWindowContext, Bounds,
Context, CursorStyle, Decorations, DragMoveEvent, Entity, EntityId, EventEmitter, FocusHandle,
Focusable, Global, Hsla, KeyContext, Keystroke, ManagedView, MouseButton, PathPromptOptions,
@ -1019,10 +1019,12 @@ impl Workspace {
});
cx.emit(Event::WorkspaceCreated(weak_handle.clone()));
let modal_layer = cx.new(|_| ModalLayer::new());
let toast_layer = cx.new(|_| ToastLayer::new());
let left_dock = Dock::new(DockPosition::Left, window, cx);
let bottom_dock = Dock::new(DockPosition::Bottom, window, cx);
let right_dock = Dock::new(DockPosition::Right, window, cx);
let left_dock = Dock::new(DockPosition::Left, modal_layer.clone(), window, cx);
let bottom_dock = Dock::new(DockPosition::Bottom, modal_layer.clone(), window, cx);
let right_dock = Dock::new(DockPosition::Right, modal_layer.clone(), window, cx);
let left_dock_buttons = cx.new(|cx| PanelButtons::new(left_dock.clone(), cx));
let bottom_dock_buttons = cx.new(|cx| PanelButtons::new(bottom_dock.clone(), cx));
let right_dock_buttons = cx.new(|cx| PanelButtons::new(right_dock.clone(), cx));
@ -1034,9 +1036,6 @@ impl Workspace {
status_bar
});
let modal_layer = cx.new(|_| ModalLayer::new());
let toast_layer = cx.new(|_| ToastLayer::new());
let session_id = app_state.session.read(cx).id().to_owned();
let mut active_call = None;
@ -5542,7 +5541,7 @@ impl Render for Workspace {
.children(self.render_notifications(window, cx)),
)
.child(self.status_bar.clone())
.child(deferred(self.modal_layer.clone()))
.child(self.modal_layer.clone())
.child(self.toast_layer.clone()),
),
window,