From 4ed30b279c950cd85400c27161f6d998d168658f Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Thu, 26 Mar 2026 19:43:01 -0700 Subject: [PATCH] refactor: streamline Conversations component by removing unused thread handling functions - Eliminated several functions related to thread selection, creation, deletion, and purging to simplify the Conversations component. - Introduced a new variable to manage the selected thread's tool timeline, enhancing the component's state management. - Improved code readability by reducing complexity and focusing on essential functionality. --- src/pages/Conversations.tsx | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/src/pages/Conversations.tsx b/src/pages/Conversations.tsx index a6fc798d0..2446ba868 100644 --- a/src/pages/Conversations.tsx +++ b/src/pages/Conversations.tsx @@ -314,39 +314,6 @@ const Conversations = () => { // eslint-disable-next-line react-hooks/exhaustive-deps }, [rustChat]); - const handleSelectThread = (threadId: string) => { - if (threadId === selectedThreadId) return; - navigate(`/conversations/${threadId}`, { replace: true }); - }; - - const handleNewThread = () => { - const threadId = crypto.randomUUID(); - dispatch( - createThreadLocal({ - id: threadId, - title: 'New Conversation', - createdAt: new Date().toISOString(), - }) - ); - navigate(`/conversations/${threadId}`, { replace: true }); - }; - - const handleDeleteThread = (threadId: string) => { - dispatch(deleteThreadLocal(threadId)); - setConfirmDeleteId(null); - if (threadId === selectedThreadId) { - navigate('/conversations', { replace: true }); - } - }; - - const handlePurge = async () => { - const result = await dispatch(purgeThreads()); - if (purgeThreads.fulfilled.match(result)) { - setShowPurgeConfirm(false); - navigate('/conversations', { replace: true }); - } - }; - const handleSendMessage = async (text?: string) => { const normalized = text ?? inputValue; const trimmed = normalized.trim(); @@ -452,6 +419,9 @@ const Conversations = () => { }; const selectedThread = threads.find(t => t.id === selectedThreadId); + const selectedThreadToolTimeline = selectedThreadId + ? (toolTimelineByThread[selectedThreadId] ?? []) + : []; return (