From f62fa9884d2aaf02e132fd5f81be2cf85bb00b24 Mon Sep 17 00:00:00 2001 From: Ren Amamiya Date: Fri, 11 Sep 2026 21:52:56 +0700 Subject: [PATCH] update --- crates/workspace/src/views/inbox.rs | 48 ++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/crates/workspace/src/views/inbox.rs b/crates/workspace/src/views/inbox.rs index d610a86..4ce8b2b 100644 --- a/crates/workspace/src/views/inbox.rs +++ b/crates/workspace/src/views/inbox.rs @@ -17,9 +17,9 @@ use signed_core::{ COVER_NOTE_KIND, InboxItem, InboxReadState, RepoAddr, activity_subject, filters, }; use signed_state::{ - Backend, BackendEvent, RefreshGate, RefreshRequest, RepoListStore, query_inbox, + Backend, BackendEvent, ProfileStore, RefreshGate, RefreshRequest, RepoListStore, query_inbox, }; -use signed_ui::CountBadge; +use signed_ui::{CountBadge, UserAvatar}; use utils::relative_time; use super::{RepoItem, open_repo_item, open_repo_panel}; @@ -577,6 +577,11 @@ fn notification_row(prefix: &'static str, ix: usize, item: &InboxItem, cx: &App) return div().id((prefix, ix)); }; + let profile_store = ProfileStore::global(cx); + let profile = profile_store.read(cx).get(&newest.pubkey); + let author = profile.name(); + + let picture = profile.picture(); let kind = item.root_kind.unwrap_or(newest.kind); let subject = SharedString::from(activity_subject(newest)); let age = relative_time(item.latest_activity()); @@ -587,6 +592,7 @@ fn notification_row(prefix: &'static str, ix: usize, item: &InboxItem, cx: &App) .h_16() .w_full() .px_3() + .gap_1() .justify_center() .bg(cx.theme().secondary) .hover(|this| this.bg(cx.theme().secondary_hover)) @@ -621,15 +627,28 @@ fn notification_row(prefix: &'static str, ix: usize, item: &InboxItem, cx: &App) }), ) .child( - h_flex().gap_2().child(div().w_6().flex_shrink_0()).child( - h_flex() - .gap_1() - .text_xs() - .text_color(cx.theme().muted_foreground) - .child(SharedString::from(kind_label(kind))) - .child("ยท") - .child(SharedString::from(age)), - ), + h_flex() + .w_full() + .gap_2() + .child(div().w_6().flex_shrink_0()) + .child( + h_flex() + .flex_1() + .gap_1() + .items_center() + .text_xs() + .text_color(cx.theme().muted_foreground) + .child( + h_flex() + .gap_1() + .child(UserAvatar::new(author.clone()).picture(picture)) + .child(author.clone()), + ) + .child("opened") + .child(SharedString::from(kind_label(kind))) + .child(div().flex_1()) + .child(SharedString::from(age)), + ), ) } @@ -643,6 +662,7 @@ fn activity_row(ix: usize, event: &Event, cx: &App) -> AnyElement { .h_16() .w_full() .px_3() + .gap_1() .justify_center() .bg(cx.theme().secondary) .hover(|this| this.bg(cx.theme().secondary_hover)) @@ -683,16 +703,16 @@ fn kind_icon(kind: Kind) -> Icon { } match kind { - Kind::GitIssue => Icon::new(CustomIconName::GitIssueOpen), + Kind::GitIssue => Icon::new(CustomIconName::GitIssueOngoing), Kind::GitPullRequest | Kind::GitPullRequestUpdate => { Icon::new(CustomIconName::GitPullRequest) } Kind::GitPatch => Icon::new(CustomIconName::GitCommit), - Kind::Comment => Icon::new(IconName::File), + Kind::Comment => Icon::new(IconName::Star), Kind::GitStatusOpen | Kind::GitStatusApplied | Kind::GitStatusClosed - | Kind::GitStatusDraft => Icon::new(IconName::CircleCheck), + | Kind::GitStatusDraft => Icon::new(CustomIconName::GitIssueOpen), _ => Icon::new(IconName::Bell), } .small()