diff --git a/src/ui/feed/note/mod.rs b/src/ui/feed/note/mod.rs index f1eb50eb..0b1b4b12 100644 --- a/src/ui/feed/note/mod.rs +++ b/src/ui/feed/note/mod.rs @@ -16,6 +16,7 @@ use nostr_types::{Event, EventDelegation, EventKind, IdHex, PublicKeyHex, Tag}; mod content; +#[derive(PartialEq)] enum RepostType { /// Damus style, kind 6 repost where the reposted note's JSON /// is included in the content @@ -166,6 +167,8 @@ pub struct NoteRenderData { pub is_main_event: bool, /// This message is a repost of another message pub has_repost: bool, + /// Is this post being mentioned within a comment + pub is_comment_mention: bool, /// This message is part of a thread pub is_thread: bool, /// Is this the first post in the display? @@ -225,6 +228,7 @@ pub(super) fn render_note( let render_data = NoteRenderData { height: *height, has_repost: note_data.repost.is_some(), + is_comment_mention: false, is_new, is_thread: threaded, is_first, @@ -775,6 +779,7 @@ pub(super) fn render_repost(app: &mut GossipUi, ui: &mut Ui, ctx: &Context, pare let render_data = NoteRenderData { height: 0.0, has_repost: repost_data.repost.is_some(), + is_comment_mention: parent_data.repost == Some(RepostType::CommentMention), is_new: false, is_main_event: false, is_thread: false, diff --git a/src/ui/theme/default.rs b/src/ui/theme/default.rs index 825acc8e..5c05cc69 100644 --- a/src/ui/theme/default.rs +++ b/src/ui/theme/default.rs @@ -510,6 +510,10 @@ impl ThemeDef for DefaultTheme { Shadow::NONE } fn repost_fill(dark_mode: bool, post: &NoteRenderData) -> Color32 { + if !post.is_comment_mention { + return Color32::TRANSPARENT + } + let mut hsva: ecolor::HsvaGamma = Self::feed_frame_fill(dark_mode, post).into(); if dark_mode { hsva.v = (hsva.v + 0.05).min(1.0); // lighten diff --git a/src/ui/theme/roundy.rs b/src/ui/theme/roundy.rs index cf5303db..50ff208b 100644 --- a/src/ui/theme/roundy.rs +++ b/src/ui/theme/roundy.rs @@ -495,6 +495,10 @@ impl ThemeDef for RoundyTheme { Shadow::NONE } fn repost_fill(dark_mode: bool, post: &NoteRenderData) -> Color32 { + if !post.is_comment_mention { + return Color32::TRANSPARENT + } + let mut hsva: ecolor::HsvaGamma = Self::feed_frame_fill(dark_mode, post).into(); if dark_mode { hsva.v = (hsva.v + 0.05).min(1.0); // lighten