mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-17 21:40:39 -07:00
feat: Auto-scroll to bottom via Events
feat: Auto-scroll to bottom on exiting mouse mode
This commit is contained in:
@@ -23,6 +23,7 @@ import { MAX_GEMINI_MESSAGE_LINES } from '../constants.js';
|
||||
import { useConfirmingTool } from '../hooks/useConfirmingTool.js';
|
||||
import { ToolConfirmationQueue } from './ToolConfirmationQueue.js';
|
||||
import { isTopicTool } from './messages/TopicMessage.js';
|
||||
import { appEvents, AppEvent } from '../../utils/events.js';
|
||||
|
||||
const MemoizedHistoryItemDisplay = memo(HistoryItemDisplay);
|
||||
const MemoizedAppHeader = memo(AppHeader);
|
||||
@@ -53,6 +54,16 @@ export const MainContent = () => {
|
||||
}
|
||||
}, [showConfirmationQueue, confirmingToolCallId]);
|
||||
|
||||
useEffect(() => {
|
||||
const handleScroll = () => {
|
||||
scrollableListRef.current?.scrollToEnd();
|
||||
};
|
||||
appEvents.on(AppEvent.ScrollToBottom, handleScroll);
|
||||
return () => {
|
||||
appEvents.off(AppEvent.ScrollToBottom, handleScroll);
|
||||
};
|
||||
}, []);
|
||||
|
||||
const {
|
||||
pendingHistoryItems,
|
||||
mainAreaWidth,
|
||||
|
||||
Reference in New Issue
Block a user