stabilize ids and harden release pipeline
This commit is contained in:
@@ -9,7 +9,7 @@ use gpui::{
|
||||
};
|
||||
use gpui_kit::base::StyledExt as _;
|
||||
use gpui_kit::component::dialog::DialogButtonProps;
|
||||
use gpui_kit::component::dock::{ClosePanel, DockArea, DockPlacement, PanelHandle};
|
||||
use gpui_kit::component::dock::{DockArea, DockPlacement, PanelHandle};
|
||||
use gpui_kit::component::menu::{ContextMenuExt as _, PopupMenuItem};
|
||||
use gpui_kit::component::{ActiveTheme, Icon, Selectable, Sizable, WindowExt, h_flex};
|
||||
use nip29::Group;
|
||||
@@ -30,9 +30,12 @@ pub(crate) fn open_room(
|
||||
window: &mut Window,
|
||||
cx: &mut App,
|
||||
) {
|
||||
let panel = chat_ui::init(room.downgrade(), window, cx);
|
||||
let room_id = panel.read(cx).room_id().clone();
|
||||
|
||||
crate::dock::add_panel_to(
|
||||
dock,
|
||||
PanelHandle::new(chat_ui::init(room.downgrade(), window, cx)),
|
||||
PanelHandle::new(panel),
|
||||
DockPlacement::Center,
|
||||
window,
|
||||
cx,
|
||||
@@ -41,8 +44,11 @@ pub(crate) fn open_room(
|
||||
if room.read(cx).kind != RoomKind::Ongoing && AppSettings::get_screening(cx) {
|
||||
let peer = room.read(cx).display_member(cx).public_key();
|
||||
let view = screening::init(peer, window, cx);
|
||||
let dock = dock.clone();
|
||||
|
||||
window.open_alert_dialog(cx, move |alert, _window, _cx| {
|
||||
let dock = dock.clone();
|
||||
let room_id = room_id.clone();
|
||||
alert
|
||||
.confirm()
|
||||
.child(view.clone())
|
||||
@@ -52,7 +58,11 @@ pub(crate) fn open_room(
|
||||
.ok_text("Response"),
|
||||
)
|
||||
.on_cancel(move |_event, window, cx| {
|
||||
window.dispatch_action(Box::new(ClosePanel), cx);
|
||||
if let Err(error) = dock.update(cx, |area, cx| {
|
||||
crate::dock::close_room_panel(area, &room_id, window, cx);
|
||||
}) {
|
||||
log::warn!("Failed to close the request room's tab: {error}");
|
||||
}
|
||||
true
|
||||
})
|
||||
});
|
||||
@@ -318,8 +328,11 @@ impl Sidebar {
|
||||
)
|
||||
})
|
||||
.on_click(move |_event, window, cx| {
|
||||
crate::dock::add_panel_to(
|
||||
let group_key = group.read(cx).key().clone();
|
||||
|
||||
crate::dock::add_group_panel_to(
|
||||
&dock,
|
||||
group_key,
|
||||
PanelHandle::new(nip29_ui::init(group.clone(), window, cx)),
|
||||
DockPlacement::Center,
|
||||
window,
|
||||
|
||||
Reference in New Issue
Block a user