feat: add context menu for quick profile viewing (#170)

* add profile context menu

* add context menu for avatar
This commit is contained in:
reya
2025-09-27 15:15:00 +07:00
committed by GitHub
parent 338a947b57
commit 0de1b20951
9 changed files with 67 additions and 34 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ use regex::Regex;
use registry::Registry;
use theme::ActiveTheme;
use crate::actions::OpenProfile;
use crate::actions::OpenPublicKey;
static URL_REGEX: Lazy<Regex> = Lazy::new(|| {
Regex::new(r"^(?:[a-zA-Z]+://)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(:\d+)?(/.*)?$").unwrap()
@@ -140,7 +140,7 @@ impl RenderedText {
log::error!("Failed to parse public key from: {clean_url}");
return;
};
window.dispatch_action(Box::new(OpenProfile(public_key)), cx);
window.dispatch_action(Box::new(OpenPublicKey(public_key)), cx);
} else if is_url(token) {
if !token.starts_with("http") {
cx.open_url(&format!("https://{token}"));