use crate::tui::app::state::App;
use crate::tui::app::symbols::symbol_search_active;
use crate::tui::models::ViewMode;
pub(super) fn scroll_overlay_up(app: &mut App, amount: usize) -> bool {
if symbol_search_active(app) {
for _ in 0..amount {
app.state.symbol_search.select_prev();
}
return true;
}
if app.state.view_mode == ViewMode::Sessions {
for _ in 0..amount {
app.state.sessions_select_prev();
}
return true;
}
if app.state.view_mode == ViewMode::Model {
for _ in 0..amount {
app.state.model_select_prev();
}
return true;
}
if app.state.slash_suggestions_visible() {
for _ in 0..amount {
app.state.select_prev_slash_suggestion();
}
return true;
}
false
}
pub(super) fn scroll_overlay_down(app: &mut App, amount: usize) -> bool {
if symbol_search_active(app) {
for _ in 0..amount {
app.state.symbol_search.select_next();
}
return true;
}
if app.state.view_mode == ViewMode::Sessions {
for _ in 0..amount {
app.state.sessions_select_next();
}
return true;
}
if app.state.view_mode == ViewMode::Model {
for _ in 0..amount {
app.state.model_select_next();
}
return true;
}
if app.state.slash_suggestions_visible() {
for _ in 0..amount {
app.state.select_next_slash_suggestion();
}
return true;
}
false
}