diff --git a/crates/nip29_ui/src/lib.rs b/crates/nip29_ui/src/lib.rs index 05733a4b..ec88d341 100644 --- a/crates/nip29_ui/src/lib.rs +++ b/crates/nip29_ui/src/lib.rs @@ -33,10 +33,18 @@ mod invite; mod message; mod metadata; -/// Ask the shell to show or hide the sidebar's information for a group. +/// Ask the shell to show the sidebar's information for a group. #[derive(Action, Clone, PartialEq, Eq, Deserialize)] #[action(namespace = nip29_ui, no_json)] -pub struct ToggleGroupMeta { +pub struct ShowGroupMeta { + pub relay: RelayUrl, + pub group: String, +} + +/// Ask the shell to hide the sidebar's information for a group. +#[derive(Action, Clone, PartialEq, Eq, Deserialize)] +#[action(namespace = nip29_ui, no_json)] +pub struct HideGroupMeta { pub relay: RelayUrl, pub group: String, } @@ -870,15 +878,6 @@ impl GroupPanel { supports_text && writable }); - let meta = self.group.upgrade().map(|group| { - let group = group.read(cx); - - ( - group.key().relay().clone(), - group.key().id().as_str().to_owned(), - ) - }); - v_flex() .flex_shrink_0() .w_full() @@ -889,22 +888,6 @@ impl GroupPanel { h_flex() .gap_1() .items_end() - .child( - Button::new("info") - .icon(IconName::Group) - .tooltip("Toggle group information in the sidebar") - .ghost() - .large() - .on_click(move |_event, window, cx| { - let Some((relay, group)) = meta.clone() else { - return; - }; - window.dispatch_action( - Box::new(ToggleGroupMeta { relay, group }), - cx, - ); - }), - ) .child( Button::new("upload") .icon(IconName::Upload) @@ -1000,6 +983,27 @@ impl Panel for GroupPanel { fn toolbar_buttons(&self, _window: &Window, _cx: &App) -> Vec