Radish alpha
r
rad:z39mP9rQAaGmERfUMPULfPUi473tY
Radicle terminal user interface
Radicle
Git
patch/list: Show state counters only wo/ state filter
Erik Kundt committed 3 months ago
commit 563b6820fd6ef6757397575a62bc43c66500e730
parent afe000c
2 files changed +11 -1
modified bin/commands/patch/list.rs
@@ -449,7 +449,7 @@ impl App {
                        } => (counts.0, counts.1, counts.2, counts.3 + 1),
                    });

-
            if self.state.filter.is_default() {
+
            if !self.state.filter.has_state() {
                let draft = format!(" {} ", state_counts.0);
                let open = format!(" {} ", state_counts.1);
                let archived = format!(" {} ", state_counts.2);
modified bin/ui/items/patch.rs
@@ -170,6 +170,16 @@ pub mod filter {
        pub fn is_default(&self) -> bool {
            *self == PatchFilter::default()
        }
+

+
        pub fn has_state(&self) -> bool {
+
            match self {
+
                PatchFilter::State(_) => true,
+
                PatchFilter::And(filters) => {
+
                    filters.iter().any(|f| matches!(f, PatchFilter::State(_)))
+
                }
+
                _ => false,
+
            }
+
        }
    }

    impl fmt::Display for PatchFilter {