use crate::tui::app::state::App;
pub fn handle_bus_g(app: &mut App) {
let len = app.state.bus_log.visible_count();
if len > 0 {
app.state.bus_log.selected_index = len - 1;
app.state.bus_log.auto_scroll = true;
}
}
pub fn handle_bus_c(app: &mut App) {
app.state.bus_log.clear_filter();
app.state.status = "Protocol filter cleared".to_string();
}
pub fn handle_bus_slash(app: &mut App) {
app.state.bus_log.enter_filter_mode();
app.state.status = "Protocol filter mode".to_string();
}
pub(super) fn handle_enter_bus_filter(app: &mut App) {
app.state.bus_log.exit_filter_mode();
app.state.status = if app.state.bus_log.filter.is_empty() {
"Protocol filter cleared".to_string()
} else {
format!("Protocol filter applied: {}", app.state.bus_log.filter)
};
}