// src/ui/handlers/rat_state.rs use crossterm::event::{KeyCode, KeyModifiers}; use crate::config::binds::config::Config; use crate::state::state::UiState; pub struct UiStateHandler; impl UiStateHandler { pub fn toggle_sidebar( ui_state: &mut UiState, config: &Config, key: KeyCode, modifiers: KeyModifiers, ) -> bool { if let Some(action) = config.get_action_for_key_in_mode(&config.keybindings.common, key, modifiers) { if action == "toggle_sidebar" { ui_state.show_sidebar = !ui_state.show_sidebar; return true; } } false } }