From 320325e419e5c5dadb13af6f3417415e92850e7f Mon Sep 17 00:00:00 2001 From: Hunter Bown Date: Sun, 26 Apr 2026 13:37:29 -0500 Subject: [PATCH] fix(tui): bump SLASH_MENU_LIMIT to 128 so the scroll viewport works MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The composer's render path already paginates with center-tracking, but the source list was hard-capped at 6 entries — so pressing Down arrow past index 5 had no entries to land on. Repro: with ~37 slash commands, hitting Down repeatedly stuck at the last visible row. Bumping the source cap to 128 lets the existing viewport scroll logic exercise the full filtered command list. No render-path change needed. Fixes #64 --- crates/tui/src/tui/ui.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/tui/src/tui/ui.rs b/crates/tui/src/tui/ui.rs index 80204c23..52b9a5ea 100644 --- a/crates/tui/src/tui/ui.rs +++ b/crates/tui/src/tui/ui.rs @@ -88,7 +88,13 @@ use super::widgets::{ // === Constants === -const SLASH_MENU_LIMIT: usize = 6; +/// Upper bound on slash-menu entries returned to the renderer. The composer's +/// render path already paginates with center-tracking (see +/// `widgets::ComposerWidget::render`), so this only needs to be high enough to +/// encompass the full filtered command list — never the visible-row budget. +/// Bumped from 6 to 128 to fix #64 (selection couldn't reach commands beyond +/// the visible window because the source list itself was capped). +const SLASH_MENU_LIMIT: usize = 128; const MENTION_MENU_LIMIT: usize = 6; const MIN_CHAT_HEIGHT: u16 = 3; const MIN_COMPOSER_HEIGHT: u16 = 2; @@ -1152,7 +1158,7 @@ async fn run_event_loop( continue; } - let slash_menu_entries = visible_slash_menu_entries(app, 6); + let slash_menu_entries = visible_slash_menu_entries(app, SLASH_MENU_LIMIT); let slash_menu_open = !slash_menu_entries.is_empty(); if slash_menu_open && app.slash_menu_selected >= slash_menu_entries.len() { app.slash_menu_selected = slash_menu_entries.len().saturating_sub(1);