From fa4a8f9e22fb65581717ff66dde4436ff5ef7d38 Mon Sep 17 00:00:00 2001 From: Louis Knight-Webb Date: Thu, 4 Dec 2025 14:56:27 +0000 Subject: [PATCH] Cleanup task follow up section loading (vibe-kanban) (#1430) Solve component completely unmounting when navigating between task attempts --- frontend/src/components/panels/TaskAttemptPanel.tsx | 6 ++---- frontend/src/components/tasks/TaskFollowUpSection.tsx | 10 ++-------- frontend/src/hooks/useTaskAttempt.ts | 1 + frontend/src/pages/ProjectTasks.tsx | 2 +- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/panels/TaskAttemptPanel.tsx b/frontend/src/components/panels/TaskAttemptPanel.tsx index 125928bc..00d327a8 100644 --- a/frontend/src/components/panels/TaskAttemptPanel.tsx +++ b/frontend/src/components/panels/TaskAttemptPanel.tsx @@ -25,12 +25,10 @@ const TaskAttemptPanel = ({ } return ( - + {children({ - logs: ( - - ), + logs: , followUp: ( ), diff --git a/frontend/src/components/tasks/TaskFollowUpSection.tsx b/frontend/src/components/tasks/TaskFollowUpSection.tsx index a8deac8c..5ea50471 100644 --- a/frontend/src/components/tasks/TaskFollowUpSection.tsx +++ b/frontend/src/components/tasks/TaskFollowUpSection.tsx @@ -563,14 +563,8 @@ export function TaskFollowUpSection({ refetchAttemptBranch, ]); - if (!selectedAttemptId) return null; - - if (isScratchLoading) { - return ( -
- -
- ); + if (!selectedAttemptId) { + return null; } return ( diff --git a/frontend/src/hooks/useTaskAttempt.ts b/frontend/src/hooks/useTaskAttempt.ts index 43dcd789..0a465226 100644 --- a/frontend/src/hooks/useTaskAttempt.ts +++ b/frontend/src/hooks/useTaskAttempt.ts @@ -6,5 +6,6 @@ export function useTaskAttempt(attemptId?: string) { queryKey: ['taskAttempt', attemptId], queryFn: () => attemptsApi.get(attemptId!), enabled: !!attemptId, + placeholderData: (previousData) => previousData, }); } diff --git a/frontend/src/pages/ProjectTasks.tsx b/frontend/src/pages/ProjectTasks.tsx index aa237411..86898dc3 100644 --- a/frontend/src/pages/ProjectTasks.tsx +++ b/frontend/src/pages/ProjectTasks.tsx @@ -287,7 +287,7 @@ export function ProjectTasks() { }, [projectId, taskId, isLoading, selectedTask, navigate]); const effectiveAttemptId = attemptId === 'latest' ? undefined : attemptId; - const isTaskView = !!taskId && !effectiveAttemptId; + const isTaskView = !!taskId && !effectiveAttemptId && attemptId !== 'latest'; const { data: attempt } = useTaskAttempt(effectiveAttemptId); const { data: branchStatus } = useBranchStatus(attempt?.id);