Skip to content

Commit 6f42e14

Browse files
committed
fix: auto-scroll when new transcript segments arrive
1 parent 1cd4c33 commit 6f42e14

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/renderer/features/notetaker/components/LiveTranscriptView.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ export function LiveTranscriptView({
1515
const { segments, addSegment, forceUpload, pendingCount } =
1616
useLiveTranscript(posthogRecordingId);
1717

18+
// Auto-scroll to bottom when new segments arrive
19+
useEffect(() => {
20+
if (autoScroll && scrollRef.current && segments.length > 0) {
21+
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
22+
}
23+
}, [segments.length, autoScroll]);
24+
1825
// Listen for new transcript segments from IPC
1926
useEffect(() => {
2027
console.log(
@@ -64,13 +71,6 @@ export function LiveTranscriptView({
6471
return cleanup;
6572
}, [posthogRecordingId, forceUpload]);
6673

67-
// Auto-scroll to bottom when new segments arrive
68-
useEffect(() => {
69-
if (autoScroll && scrollRef.current) {
70-
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
71-
}
72-
}, [autoScroll]);
73-
7474
// Detect manual scroll to disable auto-scroll
7575
const handleScroll = () => {
7676
if (!scrollRef.current) return;

0 commit comments

Comments
 (0)