@@ -113,6 +113,7 @@ import { getAllMessageDomInfo, getMessageDomInfo } from '@/lib/messageRuntimeCac
113113import { useChatStore } from ' @/stores/chat'
114114import { useReferenceStore } from ' @/stores/reference'
115115import { useWorkspaceStore } from ' @/stores/workspace'
116+ import { useUiSettingsStore } from ' @/stores/uiSettingsStore'
116117import type { ParentSelection } from ' @shared/presenter'
117118
118119// === Props & Emits ===
@@ -124,6 +125,7 @@ const props = defineProps<{
124125const chatStore = useChatStore ()
125126const referenceStore = useReferenceStore ()
126127const workspaceStore = useWorkspaceStore ()
128+ const uiSettingsStore = useUiSettingsStore ()
127129
128130// === Local State (需要先声明,因为 useMessageScroll 需要引用) ===
129131const dynamicScrollerRef = ref <InstanceType <typeof DynamicScroller > | null >(null )
@@ -142,6 +144,7 @@ const pendingHeightUpdate = ref(false)
142144const scroll = useMessageScroll ({
143145 dynamicScrollerRef ,
144146 shouldAutoFollow ,
147+ autoScrollEnabled: computed (() => uiSettingsStore .autoScrollEnabled ),
145148 scrollAnchor
146149})
147150const {
@@ -717,8 +720,12 @@ onMounted(() => {
717720 })
718721
719722 watch (
720- () => aboveThreshold .value ,
721- (isAbove ) => {
723+ () => [aboveThreshold .value , uiSettingsStore .autoScrollEnabled ] as const ,
724+ ([isAbove , autoScrollEnabled ]) => {
725+ if (! autoScrollEnabled ) {
726+ shouldAutoFollow .value = false
727+ return
728+ }
722729 shouldAutoFollow .value = ! isAbove
723730 }
724731 )
0 commit comments