use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
use crate::tui::app::state::App;
use crate::tui::models::ViewMode;
pub(super) fn handle_alt_scroll(app: &mut App, key: KeyEvent) -> Option<anyhow::Result<bool>> {
if app.state.view_mode != ViewMode::Chat {
return None;
}
let alt = key.modifiers.contains(KeyModifiers::ALT);
let ctrl = key.modifiers.contains(KeyModifiers::CONTROL);
match key.code {
KeyCode::Char('j') if alt => app.state.scroll_down(1),
KeyCode::Char('k') if alt => app.state.scroll_up(1),
KeyCode::Char('d') if alt => app.state.scroll_down(5),
KeyCode::Char('u') if alt => app.state.scroll_up(5),
KeyCode::Char('g') if ctrl => app.state.scroll_to_top(),
KeyCode::Char('G') if ctrl => app.state.scroll_to_bottom(),
_ => return None,
}
Some(Ok(false))
}