diff --git a/bin/commands/inbox/flux/select.rs b/bin/commands/inbox/flux/select.rs index 0997a657..6af6d48f 100644 --- a/bin/commands/inbox/flux/select.rs +++ b/bin/commands/inbox/flux/select.rs @@ -3,7 +3,9 @@ mod ui; use anyhow::Result; +use radicle::identity::Project; use radicle::node::notifications::NotificationId; +use radicle::storage::ReadRepository; use radicle::storage::git::Repository; use radicle::Profile; @@ -39,12 +41,16 @@ pub struct InboxState { notifications: Vec, selected: Option, mode: common::Mode, + project: Project, } impl TryFrom<&Context> for InboxState { type Error = anyhow::Error; fn try_from(context: &Context) -> Result { + let doc = context.repository.identity_doc()?; + let project = doc.project()?; + let notifications = inbox::all(&context.repository, &context.profile)?; let mut items = vec![]; @@ -72,6 +78,7 @@ impl TryFrom<&Context> for InboxState { notifications: items, selected, mode: context.mode.clone(), + project, }) } } diff --git a/bin/commands/inbox/flux/select/ui.rs b/bin/commands/inbox/flux/select/ui.rs index e3790071..7998b5f1 100644 --- a/bin/commands/inbox/flux/select/ui.rs +++ b/bin/commands/inbox/flux/select/ui.rs @@ -1,6 +1,7 @@ use std::cmp; use std::vec; +use radicle::identity::Project; use tokio::sync::mpsc::UnboundedSender; use termion::event::Key; @@ -143,12 +144,14 @@ impl Render<()> for ListPage { struct NotificationsProps { notifications: Vec, + project: Project, } impl From<&InboxState> for NotificationsProps { fn from(state: &InboxState) -> Self { Self { notifications: state.notifications.clone(), + project: state.project.clone(), } } } @@ -272,17 +275,8 @@ impl Render<()> for Notifications { frame, layout[0], HeaderProps { - cells: [ - String::from("").into(), - String::from(" ● ").into(), - String::from("ID / Name").into(), - String::from("Summary").into(), - String::from("Type").into(), - String::from("Status").into(), - String::from("Author").into(), - String::from("Updated").into(), - ], - widths, + cells: [String::from("").into(), self.props.project.name().into()], + widths: [Constraint::Length(0), Constraint::Fill(1)], focus, cutoff, cutoff_after,