Radish alpha
r
Radicle terminal user interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Complete issue detail header
Erik Kundt committed 2 years ago
commit b66b44fe15aa71d7edb9df0f73992971960dcd2c
parent 77b6744480ddc2ded1056227b209880d01f42132
1 file changed +16 -3
modified src/ui/widget/issue.rs
@@ -89,13 +89,25 @@ impl IssueHeader {
        let repo = context.repository();

        let (id, issue) = issue;
-
        let item = IssueItem::from((context.profile(), repo, id, issue));
+
        let by_you = *issue.author().id() == context.profile().did();
+
        let item = IssueItem::from((context.profile(), repo, id, issue.clone()));

        let title = Property::new(
            common::label("Title").foreground(theme.colors.property_name_fg),
            common::label(item.title()).foreground(theme.colors.browser_list_title),
        );

+
        let author = Property::new(
+
            common::label("Author").foreground(theme.colors.property_name_fg),
+
            common::label(&cob::format_author(issue.author().id(), by_you))
+
                .foreground(theme.colors.browser_list_author),
+
        );
+

+
        let issue_id = Property::new(
+
            common::label("Issue").foreground(theme.colors.property_name_fg),
+
            common::label(&id.to_string()).foreground(theme.colors.browser_list_description),
+
        );
+

        let tags = Property::new(
            common::label("Tags").foreground(theme.colors.property_name_fg),
            common::label(&cob::format_tags(item.tags()))
@@ -119,11 +131,12 @@ impl IssueHeader {
            common::label(&item.state().to_string()).foreground(theme.colors.browser_list_title),
        );

-
        // let table = common::property_table(theme, vec![title, tags, assignees, state]);
        let table = common::property_table(
            theme,
            vec![
                Widget::new(title),
+
                Widget::new(issue_id),
+
                Widget::new(author),
                Widget::new(tags),
                Widget::new(assignees),
                Widget::new(state),
@@ -175,7 +188,7 @@ impl WidgetComponent for IssueDetails {
            .unwrap_flag();
        let layout = Layout::default()
            .direction(Direction::Vertical)
-
            .constraints([Constraint::Length(6), Constraint::Min(1)])
+
            .constraints([Constraint::Length(8), Constraint::Min(1)])
            .split(area);

        self.header.view(frame, layout[0]);