patch/list: Show state counters only wo/ state filter

This commit is contained in:
Erik Kundt
2026-01-09 00:14:20 +01:00
parent afe000c323
commit 563b6820fd
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -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);
+10
View File
@@ -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 {