notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit a6aa163e334590763653600c3221bd5f1d4eae25
parent 22c65424642dab1cab7a56c2291e4067ba8cca6f
Author: Martti Malmi <sirius@iki.fi>
Date:   Mon, 10 Nov 2025 19:45:25 +0200

fix profiles not showing up in search

Diffstat:
Mcrates/notedeck_columns/src/ui/search/mod.rs | 29++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/crates/notedeck_columns/src/ui/search/mod.rs b/crates/notedeck_columns/src/ui/search/mod.rs @@ -196,8 +196,13 @@ impl<'a, 'd> SearchView<'a, 'd> { )).clicked() || (is_selected && keyboard_resp.enter_pressed); if search_posts_clicked { + let search_type = SearchType::get_type(&self.query.string); + // If it's a profile (npub), navigate to the profile instead of searching posts + if let SearchType::Profile(pubkey) = search_type { + return Some(SearchAction::NavigateToProfile(pubkey)); + } return Some(SearchAction::NewSearch { - search_type: SearchType::get_type(&self.query.string), + search_type, new_search_text: self.query.string.clone(), }); } @@ -211,6 +216,28 @@ impl<'a, 'd> SearchView<'a, 'd> { } } + for (i, pk_bytes) in self.query.user_results.iter().enumerate() { + if let Ok(pk_array) = TryInto::<[u8; 32]>::try_into(pk_bytes.as_slice()) { + let pubkey = Pubkey::new(pk_array); + let profile = self.note_context.ndb.get_profile_by_pubkey(self.txn, &pk_array).ok(); + let is_selected = self.query.selected_index == (i + 1) as i32; + + let resp = ui.add(recent_profile_item( + profile.as_ref(), + &pubkey, + &self.query.string, + is_selected, + ui.available_width(), + self.note_context.img_cache, + self.note_context.accounts, + )); + + if resp.clicked() { + return Some(SearchAction::NavigateToProfile(pubkey)); + } + } + } + None }