refactor: remove redundant workLogCount stick-to-bottom effect
timelineEntries is derived from workLogEntries; the timelineEntries effect already runs when work log changes. Dropped duplicate effect and unused workLogCount variable. Made-with: Cursor
This commit is contained in:
1 parent
8294392062
commit
61a8ca2c31
1 file changed
-6
@@ -1284,7 +1284,6 @@ export default function ChatView({ threadId }: ChatViewProps) {
|
||||
|
||||
// Auto-scroll on new messages
|
||||
const messageCount = timelineMessages.length;
|
||||
const workLogCount = workLogEntries.length;
|
||||
const scrollMessagesToBottom = useCallback((behavior: ScrollBehavior = "auto") => {
|
||||
const scrollContainer = messagesScrollRef.current;
|
||||
if (!scrollContainer) return;
|
||||
@@ -1354,11 +1353,6 @@ export default function ChatView({ threadId }: ChatViewProps) {
|
||||
if (!shouldAutoScrollRef.current) return;
|
||||
scheduleStickToBottom();
|
||||
}, [messageCount, scheduleStickToBottom]);
|
||||
useEffect(() => {
|
||||
if (phase !== "running") return;
|
||||
if (!shouldAutoScrollRef.current) return;
|
||||
scheduleStickToBottom();
|
||||
}, [phase, scheduleStickToBottom, workLogCount]);
|
||||
useEffect(() => {
|
||||
if (phase !== "running") return;
|
||||
if (!shouldAutoScrollRef.current) return;
|
||||
|
||||
Reference in new issue
Block a user