Skip to content

Commit e6658f8

Browse files
authored
fix(tui): prevent End hint showing when already at bottom (#118)
The scroll_chat method was unconditionally setting chat_scroll_pinned_bottom to false, which caused the '↓ End' hint to incorrectly appear when: - Scrolling down while already at the bottom - Pressing End key while at the bottom Now we check if chat_scroll is 0 (at bottom) after the scroll operation and keep pinned_bottom=true in that case.
1 parent 9a49c1b commit e6658f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cortex-tui/src/app/state.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,9 @@ impl AppState {
518518
} else {
519519
self.chat_scroll = self.chat_scroll.saturating_add(delta as usize);
520520
}
521-
self.chat_scroll_pinned_bottom = false;
521+
// Only unpin from bottom if we actually scrolled away from it
522+
// When chat_scroll is 0, we're at the bottom, so keep pinned
523+
self.chat_scroll_pinned_bottom = self.chat_scroll == 0;
522524
self.show_scrollbar();
523525
}
524526

0 commit comments

Comments
 (0)