Cleanup task follow up section loading (vibe-kanban) (#1430)

Solve component completely unmounting when navigating between task attempts
This commit is contained in:
Louis Knight-Webb
2025-12-04 14:56:27 +00:00
committed by GitHub
parent b6a4f76e43
commit fa4a8f9e22
4 changed files with 6 additions and 13 deletions

View File

@@ -25,12 +25,10 @@ const TaskAttemptPanel = ({
} }
return ( return (
<EntriesProvider key={attempt.id}> <EntriesProvider>
<RetryUiProvider attemptId={attempt.id}> <RetryUiProvider attemptId={attempt.id}>
{children({ {children({
logs: ( logs: <VirtualizedList attempt={attempt} task={task} />,
<VirtualizedList key={attempt.id} attempt={attempt} task={task} />
),
followUp: ( followUp: (
<TaskFollowUpSection task={task} selectedAttemptId={attempt.id} /> <TaskFollowUpSection task={task} selectedAttemptId={attempt.id} />
), ),

View File

@@ -563,14 +563,8 @@ export function TaskFollowUpSection({
refetchAttemptBranch, refetchAttemptBranch,
]); ]);
if (!selectedAttemptId) return null; if (!selectedAttemptId) {
return null;
if (isScratchLoading) {
return (
<div className="flex items-center justify-center h-full">
<Loader2 className="animate-spin h-6 w-6" />
</div>
);
} }
return ( return (

View File

@@ -6,5 +6,6 @@ export function useTaskAttempt(attemptId?: string) {
queryKey: ['taskAttempt', attemptId], queryKey: ['taskAttempt', attemptId],
queryFn: () => attemptsApi.get(attemptId!), queryFn: () => attemptsApi.get(attemptId!),
enabled: !!attemptId, enabled: !!attemptId,
placeholderData: (previousData) => previousData,
}); });
} }

View File

@@ -287,7 +287,7 @@ export function ProjectTasks() {
}, [projectId, taskId, isLoading, selectedTask, navigate]); }, [projectId, taskId, isLoading, selectedTask, navigate]);
const effectiveAttemptId = attemptId === 'latest' ? undefined : attemptId; const effectiveAttemptId = attemptId === 'latest' ? undefined : attemptId;
const isTaskView = !!taskId && !effectiveAttemptId; const isTaskView = !!taskId && !effectiveAttemptId && attemptId !== 'latest';
const { data: attempt } = useTaskAttempt(effectiveAttemptId); const { data: attempt } = useTaskAttempt(effectiveAttemptId);
const { data: branchStatus } = useBranchStatus(attempt?.id); const { data: branchStatus } = useBranchStatus(attempt?.id);