From 0bfd292bd8df3af4f99fbed3df2fd0e4d5eb48dc Mon Sep 17 00:00:00 2001 From: Adam Bowker Date: Mon, 6 Apr 2026 10:02:13 -0700 Subject: [PATCH] fix(code): do not re-sort on task click --- .../sessions/hooks/useSessionCallbacks.ts | 2 +- .../sessions/hooks/useSessionConnection.ts | 15 +-------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/apps/code/src/renderer/features/sessions/hooks/useSessionCallbacks.ts b/apps/code/src/renderer/features/sessions/hooks/useSessionCallbacks.ts index a3e591e76..ab82416ef 100644 --- a/apps/code/src/renderer/features/sessions/hooks/useSessionCallbacks.ts +++ b/apps/code/src/renderer/features/sessions/hooks/useSessionCallbacks.ts @@ -52,9 +52,9 @@ export function useSessionCallbacks({ try { markAsViewed(taskId); + markActivity(taskId); const result = await getSessionService().sendPrompt(taskId, text); log.info("Prompt completed", { stopReason: result.stopReason }); - markActivity(taskId); const view = useNavigationStore.getState().view; const isViewingTask = diff --git a/apps/code/src/renderer/features/sessions/hooks/useSessionConnection.ts b/apps/code/src/renderer/features/sessions/hooks/useSessionConnection.ts index cb7e20789..8fd117c77 100644 --- a/apps/code/src/renderer/features/sessions/hooks/useSessionConnection.ts +++ b/apps/code/src/renderer/features/sessions/hooks/useSessionConnection.ts @@ -1,4 +1,3 @@ -import { useTaskViewed } from "@features/sidebar/hooks/useTaskViewed"; import { useConnectivity } from "@hooks/useConnectivity"; import { trpcClient } from "@renderer/trpc/client"; import type { Task } from "@shared/types"; @@ -31,7 +30,6 @@ export function useSessionConnection({ isSuspended, }: UseSessionConnectionOptions) { const queryClient = useQueryClient(); - const { markActivity } = useTaskViewed(); const { isOnline } = useConnectivity(); useChatTitleGenerator(taskId); @@ -98,8 +96,6 @@ export function useSessionConnection({ sessionStatus: session?.status ?? "none", }); - markActivity(task.id); - getSessionService() .connectToTask({ task, @@ -112,16 +108,7 @@ export function useSessionConnection({ return () => { connectingTasks.delete(taskId); }; - }, [ - task, - taskId, - repoPath, - session, - markActivity, - isOnline, - isCloud, - isSuspended, - ]); + }, [task, taskId, repoPath, session, isOnline, isCloud, isSuspended]); const cannotConnect = !repoPath && !isCloud; useEffect(() => {