Skip to content

Commit 50b5cab

Browse files
committed
fix: turn off autoscroll of chat area
AdminForth/1792/agent-new-functionality
1 parent 6c4bce1 commit 50b5cab

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

custom/CustomAutoScrollContainer.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ const props = withDefaults(defineProps<{
2424
wrapperStyle?: Record<string, string>
2525
contentStyle?: Record<string, string>
2626
scrollBarAutoHide?: boolean
27+
scrollToBottomOnMount?: boolean
2728
}>(), {
2829
enabled: true,
2930
threshold: 50,
3031
behavior: 'instant',
31-
scrollBarAutoHide: true
32+
scrollBarAutoHide: true,
33+
scrollToBottomOnMount: true
3234
})
3335
3436
const containerRef = ref<HTMLDivElement | null>(null)
@@ -72,7 +74,7 @@ onMounted(() => {
7274
scrollParams.value.scrollTop = containerRef.value.scrollEl.scrollTop
7375
scrollParams.value.scrollHeight = containerRef.value.scrollEl.scrollHeight
7476
scrollParams.value.clientHeight = containerRef.value.scrollEl.clientHeight
75-
if (props.enabled && !isUserScrolledUp.value) {
77+
if (!isUserScrolledUp.value && props.scrollToBottomOnMount) {
7678
scrollToBottom()
7779
}
7880
})
@@ -102,6 +104,7 @@ function isNearBottom(customThreshold?: number): boolean {
102104
}
103105
104106
function scrollToBottom(force = false): void {
107+
console.log('scrollToBottom called with force:', force)
105108
const container = containerRef.value?.scrollEl
106109
if (!container) return
107110

custom/conversation_area/ConversationArea.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div ref="chatContainerRef" class="relative flex-1 min-h-0 overflow-hidden" @click="recalculateScroll()">
1212
<CustomAutoScrollContainer
1313
v-if="showScrollContainer"
14-
:enabled="!showScrollToBottomButton"
14+
:enabled="false"
1515
class="relative h-full flex flex-col overflow-y-auto translate-x-[-50%] left-1/2"
1616
ref="scrollContainer"
1717
:threshold="THRESHOLD_TO_SHOW_BUTTON"
@@ -251,11 +251,11 @@ function scheduleSpacerHeightUpdate() {
251251
pendingSpacerUpdate = null;
252252
253253
// Auto-scroll to bottom if response generation is in progress
254-
if (agentStore.isResponseInProgress) {
255-
nextTick(() => {
256-
scrollContainer.value?.scrollToBottom();
257-
});
258-
}
254+
// if (agentStore.isResponseInProgress) {
255+
// nextTick(() => {
256+
// scrollContainer.value?.scrollToBottom();
257+
// });
258+
// }
259259
260260
if (spacerUpdateQueued) {
261261
scheduleSpacerHeightUpdate();

0 commit comments

Comments
 (0)