diff --git a/.beans/claudbg-xokw--filter-accept-msgsmessages-as-aliases-for-message.md b/.beans/claudbg-xokw--filter-accept-msgsmessages-as-aliases-for-message.md index afb1c35..adc7ace 100644 --- a/.beans/claudbg-xokw--filter-accept-msgsmessages-as-aliases-for-message.md +++ b/.beans/claudbg-xokw--filter-accept-msgsmessages-as-aliases-for-message.md @@ -1,10 +1,13 @@ --- # claudbg-xokw title: 'Filter: accept ''msgs''/''messages'' as aliases for message count filter' -status: todo +status: completed type: bug +priority: normal created_at: 2026-04-01T16:47:06Z -updated_at: 2026-04-01T16:47:06Z +updated_at: 2026-04-01T16:51:12Z --- For filtering, both 'msgs' and 'messages' should be accepted as field names when filtering on message count, since the UI displays the column as 'msgs'. + +## Summary of Changes\n\nAdded 'messages' as alias for 'msgs' in filter field matching so both forms work for filtering by message count. diff --git a/src/filter.rs b/src/filter.rs index af6025a..09e3b2e 100644 --- a/src/filter.rs +++ b/src/filter.rs @@ -138,7 +138,7 @@ impl Key { "project" => Some(Key::Project), "id" => Some(Key::Id), "agents" => Some(Key::Agents), - "messages" => Some(Key::Messages), + "messages" | "msgs" => Some(Key::Messages), "in" => Some(Key::In), "out" => Some(Key::Out), "tokens" => Some(Key::Tokens), @@ -230,7 +230,7 @@ fn parse_atom(atom: &str) -> Result { let key = Key::parse(key_str).ok_or_else(|| { AppError::Parse(format!( - "unknown filter key '{key_str}' — valid keys: model, project, id, agents, messages, in, out, tokens, date" + "unknown filter key '{key_str}' — valid keys: model, project, id, agents, messages, msgs, in, out, tokens, date" )) })?; @@ -509,7 +509,11 @@ mod tests { } /// Build a row with the given token counts; all other fields use fixed defaults. - fn make_row_with_tokens(full_id: &str, input_tokens: u64, output_tokens: u64) -> SessionListItem { + fn make_row_with_tokens( + full_id: &str, + input_tokens: u64, + output_tokens: u64, + ) -> SessionListItem { SessionListItem { short_id: full_id.get(..8).unwrap_or(full_id).to_string(), full_id: full_id.to_string(), @@ -1071,7 +1075,8 @@ mod tests { fn in_and_out_combined() { // Large input AND small output — very "reading-heavy" sessions. let f = Filter::parse("in>10000 AND out<500").unwrap(); - let reading_heavy = make_row_with_tokens("aaaaaaaa-0000-0000-0000-000000000000", 50000, 200); + let reading_heavy = + make_row_with_tokens("aaaaaaaa-0000-0000-0000-000000000000", 50000, 200); let balanced = make_row_with_tokens("bbbbbbbb-0000-0000-0000-000000000000", 50000, 2000); assert!(f.matches(&reading_heavy)); assert!(!f.matches(&balanced)); diff --git a/src/tui/modals/help_modal.rs b/src/tui/modals/help_modal.rs index d512b76..a592e9a 100644 --- a/src/tui/modals/help_modal.rs +++ b/src/tui/modals/help_modal.rs @@ -56,7 +56,7 @@ const HELP_TEXT: &str = "\ project:foo substring\n\ id:abc substring\n\ agents>0 numeric\n\ - messages<50 numeric\n\ + messages<50 numeric (alias: msgs)\n\ in>5000 input tokens\n\ out<1000 output tokens\n\ tokens>50000 total tokens\n\