yangdx commited on
Commit
832e8bf
·
1 Parent(s): b0b8d3e

Optimize scrolling login of query view

Browse files
lightrag_webui/src/features/RetrievalTesting.tsx CHANGED
@@ -198,9 +198,17 @@ export default function RetrievalTesting() {
198
  return;
199
  }
200
 
201
- // If we're receiving a response, be more conservative about disabling auto-scroll
202
- if (!isFormInteractionRef.current && !isReceivingResponseRef.current) {
203
- shouldFollowScrollRef.current = false;
 
 
 
 
 
 
 
 
204
  }
205
  }, 30);
206
 
 
198
  return;
199
  }
200
 
201
+ // Check if scrolled to bottom or very close to bottom
202
+ const container = messagesContainerRef.current;
203
+ if (container) {
204
+ const isAtBottom = container.scrollHeight - container.scrollTop - container.clientHeight < 20;
205
+
206
+ // If at bottom, enable auto-scroll, otherwise disable it
207
+ if (isAtBottom) {
208
+ shouldFollowScrollRef.current = true;
209
+ } else if (!isFormInteractionRef.current && !isReceivingResponseRef.current) {
210
+ shouldFollowScrollRef.current = false;
211
+ }
212
  }
213
  }, 30);
214