Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function ConversationView({
compact = false,
}: ConversationViewProps) {
const listRef = useRef<VirtualizedListHandle>(null);
const isAtBottomRef = useRef(true);
const [showScrollButton, setShowScrollButton] = useState(false);
const debugLogsCloudRuns = useSettingsStore((s) => s.debugLogsCloudRuns);
const showDebugLogs = debugLogsCloudRuns;
Expand Down Expand Up @@ -129,6 +130,7 @@ export function ConversationView({
}, [items]);

const handleScrollStateChange = useCallback((isAtBottom: boolean) => {
isAtBottomRef.current = isAtBottom;
setShowScrollButton(!isAtBottom);
}, []);

Expand All @@ -139,7 +141,7 @@ export function ConversationView({

useEffect(() => {
const handleVisibilityChange = () => {
if (!document.hidden) {
if (!document.hidden && isAtBottomRef.current) {
listRef.current?.scrollToBottom();
setShowScrollButton(false);
}
Expand Down
Loading