From 79e922a4c3b7d09fd98dd12f6bcb7669bcdc2ebc Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 7 Aug 2026 05:51:05 +0000 Subject: [PATCH] fix(discover): open channel when tapping joined Popular chips Joined popular rows previously ignored clicks. Match Chats list behavior: open the buffer (and fetch history if empty) when already a member. Co-authored-by: nandi --- android/src/app.rs | 15 +++++++++++++++ android/src/ui/discover.rs | 12 +++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/android/src/app.rs b/android/src/app.rs index e4a9721..91cf325 100644 --- a/android/src/app.rs +++ b/android/src/app.rs @@ -2808,6 +2808,21 @@ impl eframe::App for SleekApp { match ui::discover_tab(ui, &th, &mut self.state) { DiscoverAction::None => {} DiscoverAction::Join(ch) => self.do_join(ch), + DiscoverAction::Open(name) => { + let need_history = self + .state + .channels + .get(&name) + .map(|b| !b.has_chat_messages()) + .unwrap_or(true); + self.state.open_chat(&name); + if need_history { + self.net.send(NetCmd::HistoryLatest { + target: name, + count: 100, + }); + } + } } } Tab::Settings => { diff --git a/android/src/ui/discover.rs b/android/src/ui/discover.rs index 11416f2..0fc581f 100644 --- a/android/src/ui/discover.rs +++ b/android/src/ui/discover.rs @@ -9,6 +9,8 @@ use crate::ui::widgets::{avatar_circle, card}; pub enum DiscoverAction { None, Join(String), + /// Already a member — open the channel buffer. + Open(String), } pub fn discover_tab(ui: &mut egui::Ui, th: &Theme, state: &mut AppState) -> DiscoverAction { @@ -92,10 +94,14 @@ pub fn discover_tab(ui: &mut egui::Ui, th: &Theme, state: &mut AppState) -> Disc .interact(egui::Sense::click()) .on_hover_cursor(CursorIcon::PointingHand); - if resp.clicked() && !joined { - action = DiscoverAction::Join((*name).to_string()); + if resp.clicked() { + action = if joined { + DiscoverAction::Open((*name).to_string()) + } else { + DiscoverAction::Join((*name).to_string()) + }; } - if resp.hovered() && !joined { + if resp.hovered() { ui.painter().rect_filled( resp.rect, sp.radius_md, -- 2.51.2