Open deploy progress immediately and improve delete row glass overlay.

Track in-progress deploys in the client store so the progress modal opens on click without waiting for the applications list refetch. Show deleting state as a blurred glass overlay on table rows and service cards instead of replacing row content.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
keyhan
2026-05-25 23:34:24 +03:30
parent dc9830383b
commit 1ade52825c
11 changed files with 266 additions and 59 deletions
@@ -0,0 +1,29 @@
'use client';
import { useQueryClient } from '@tanstack/react-query';
import api from '@/lib/api';
import type { BuildProgress } from '@/components/build-progress-modal';
import { useDeployProgressStore } from '@/lib/deploy-progress-store';
/** Open deploy progress UI immediately and warm build-progress cache. */
export function useDeployProgressActions() {
const queryClient = useQueryClient();
const startDeploy = useDeployProgressStore((s) => s.startDeploy);
const notifyDeployStarted = (appId: string, appName?: string) => {
startDeploy(appId, appName);
void queryClient.invalidateQueries({ queryKey: ['applications'] });
void queryClient.invalidateQueries({ queryKey: ['application', appId] });
void queryClient.invalidateQueries({ queryKey: ['deployments', appId] });
void queryClient.prefetchQuery({
queryKey: ['build-progress', appId],
queryFn: () =>
api
.get<{ progress: BuildProgress | null }>(`/deployments/applications/${appId}/build-progress`)
.then((r) => r.data.progress),
staleTime: 0,
});
};
return { notifyDeployStarted };
}