Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Hide the chat message editor when there is no active chat (#7441)

Marshall Bowers56f7f1803303
diff --git a/crates/collab_ui/src/chat_panel.rs b/crates/collab_ui/src/chat_panel.rs
index 88ee461dee5..804bd3acf88 100644
--- a/crates/collab_ui/src/chat_panel.rs
+++ b/crates/collab_ui/src/chat_panel.rs
@@ -589,25 +589,28 @@ impl Render for ChatPanel {
)
}
}))
- .child(
- h_flex()
- .when(!self.is_scrolled_to_bottom, |el| {
- el.border_t_1().border_color(cx.theme().colors().border)
- })
- .p_2()
- .map(|el| {
- if self.active_chat.is_some() {
- el.child(self.message_editor.clone())
- } else {
- el.child(
- div()
- .rounded_md()
- .h_6()
- .w_full()
- .bg(cx.theme().colors().editor_background),
- )
- }
- }),
+ .children(
+ Some(
+ h_flex()
+ .when(!self.is_scrolled_to_bottom, |el| {
+ el.border_t_1().border_color(cx.theme().colors().border)
+ })
+ .p_2()
+ .map(|el| {
+ if self.active_chat.is_some() {
+ el.child(self.message_editor.clone())
+ } else {
+ el.child(
+ div()
+ .rounded_md()
+ .h_6()
+ .w_full()
+ .bg(cx.theme().colors().editor_background),
+ )
+ }
+ }),
+ )
+ .filter(|_| self.active_chat.is_some()),
)
.into_any()
}