From be41842dae4df756749198b3ba45f7682fbc7454 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 31 Aug 2024 19:55:33 +0100 Subject: [PATCH] feat(tui): remove label from repo identity widget --- crates/cli/src/tui/components/repo/identity.rs | 6 +----- crates/cli/src/tui/components/repo/mod.rs | 5 ----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/crates/cli/src/tui/components/repo/identity.rs b/crates/cli/src/tui/components/repo/identity.rs index 2ea2998..37aa017 100644 --- a/crates/cli/src/tui/components/repo/identity.rs +++ b/crates/cli/src/tui/components/repo/identity.rs @@ -10,7 +10,6 @@ use ratatui::{ use crate::tui::actor::RepoMessage; pub struct Identity<'a> { - pub label: &'a str, pub repo_alias: &'a RepoAlias, pub alert: Option<&'a str>, pub message: &'a RepoMessage, @@ -18,14 +17,12 @@ pub struct Identity<'a> { } impl<'a> Identity<'a> { pub const fn new( - label: &'a str, repo_alias: &'a RepoAlias, alert: Option<&'a str>, message: &'a RepoMessage, repo_branches: Option<&'a RepoBranches>, ) -> Self { Self { - label, repo_alias, alert, message, @@ -35,7 +32,6 @@ impl<'a> Identity<'a> { } impl<'a> Identity<'a> { fn spans(self) -> Vec> { - let label = self.label; let repo_alias = Span::from(self.repo_alias.to_string()).style(if self.alert.is_some() { Style::default().fg(Color::Black).bg(Color::Red) } else { @@ -62,7 +58,7 @@ impl<'a> Identity<'a> { vec![ " ".into(), repo_alias, - format!(" ({label}) ").into(), + " ".into(), alert, format!("({main}/{next}/{dev}) [").into(), message.into(), diff --git a/crates/cli/src/tui/components/repo/mod.rs b/crates/cli/src/tui/components/repo/mod.rs index 830e2a6..f45b178 100644 --- a/crates/cli/src/tui/components/repo/mod.rs +++ b/crates/cli/src/tui/components/repo/mod.rs @@ -39,7 +39,6 @@ impl<'a> RepoWidget<'a> { message, alert, } => InnerRepoWidget { - label: "identified", repo_alias, message, alert: alert.as_ref().map(String::as_str), @@ -54,7 +53,6 @@ impl<'a> RepoWidget<'a> { branches, log, } => InnerRepoWidget { - label: "configured", repo_alias, message, alert: alert.as_ref().map(String::as_str), @@ -74,7 +72,6 @@ impl<'a> RepoWidget<'a> { // dev, .. } => InnerRepoWidget { - label: "ready", repo_alias, message, alert: alert.as_ref().map(String::as_str), @@ -98,7 +95,6 @@ impl<'a> Widget for RepoWidget<'a> { } struct InnerRepoWidget<'a> { - pub label: &'a str, pub repo_alias: &'a RepoAlias, pub message: &'a RepoMessage, pub alert: Option<&'a str>, @@ -123,7 +119,6 @@ impl<'a> Widget for InnerRepoWidget<'a> { { let block = Block::default() .title(Identity::new( - self.label, self.repo_alias, self.alert, self.message,