From 787d3e8eb44479beaf4862f9a13e1856876fc5b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sun, 29 Nov 2026 07:42:18 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20message=20keeps=20its?= =?UTF-8?q?=20highlight=20and=20actions=20bar=20while=20its=20reaction=20p?= =?UTF-8?q?icker=20is=20open=20(Chat::engaged=20=3D=20bar=20hovered=20or?= =?UTF-8?q?=20picker=20open)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/gui/chat.rs | 10 +++++++--- crates/client/src/gui/message_actions.rs | 10 +++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/crates/client/src/gui/chat.rs b/crates/client/src/gui/chat.rs index ec20123..94cd003 100644 --- a/crates/client/src/gui/chat.rs +++ b/crates/client/src/gui/chat.rs @@ -256,6 +256,7 @@ pub struct Chat { pub(super) pending_message_delete: Option, pub(super) hover_row: Option, pub(super) hover_bar: Option, + pub(super) reacting: Option, pub(super) pending_builder_purge: Option, pub(super) transfer: Option, pub(super) voice: HashMap>, @@ -506,6 +507,7 @@ impl Chat { pending_message_delete: None, hover_row: None, hover_bar: None, + reacting: None, pending_builder_purge: None, transfer: None, builder_password, @@ -949,6 +951,10 @@ impl Chat { self.scroll.max_offset().y + self.scroll.offset().y > self.scroll.bounds().size.height } + pub(super) fn engaged(&self, message_id: Id) -> bool { + self.hover_bar == Some(message_id) || self.reacting == Some(message_id) + } + pub(super) fn jump_to_bottom(&mut self) { self.scroll.scroll_to_bottom(); self.unseen = 0; @@ -3559,9 +3565,7 @@ fn render_message( .flex_col() .min_w_0() .hover(|style| style.bg(palette.hover)) - .when(chat.hover_bar == Some(message.id), |this| { - this.bg(palette.hover) - }) + .when(chat.engaged(message.id), |this| this.bg(palette.hover)) .when(first && spaced && !selecting, |this| this.mt(px(space::LG))) .when(highlighted, |this| this.bg(palette.tokens.press())) .when(mentioned, |this| { diff --git a/crates/client/src/gui/message_actions.rs b/crates/client/src/gui/message_actions.rs index 8dc9754..5175b0f 100644 --- a/crates/client/src/gui/message_actions.rs +++ b/crates/client/src/gui/message_actions.rs @@ -90,9 +90,17 @@ pub fn react_popover( ) -> impl IntoElement { let message_id = message.id; let entity = entity.clone(); + let reacting = entity.clone(); Popover::new(format!("react_{}", message.id)) .anchor(Anchor::BottomRight) + .on_open_change(move |open, _, cx| { + reacting.update(cx, |yumush, cx| { + if track(&mut yumush.chat.reacting, message_id, *open) { + cx.notify(); + } + }); + }) .appearance(false) .trigger(trigger_icon( format!("react_trigger_{}", message.id), @@ -418,7 +426,7 @@ pub fn actions( let reportable = me.is_some_and(|me| me.id != message.user_id); let id = message.id; let armed = chat.pending_message_delete == Some(id); - let shown = armed || chat.hover_row == Some(id) || chat.hover_bar == Some(id); + let shown = armed || chat.hover_row == Some(id) || chat.engaged(id); let hover = entity.clone(); panel(palette)