From b66fec50750182a76263fc4fd580dea0c116897c Mon Sep 17 00:00:00 2001 From: tigerenwork Date: Thu, 5 Feb 2026 18:14:52 +0800 Subject: [PATCH] fix: stay on 'verify' tab after mark a verify step as done --- src/app/releases/[id]/page.tsx | 21 +++++++++++++------ .../releases/release-matrix-client.tsx | 5 +++-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/app/releases/[id]/page.tsx b/src/app/releases/[id]/page.tsx index e4a851f..d42a84d 100644 --- a/src/app/releases/[id]/page.tsx +++ b/src/app/releases/[id]/page.tsx @@ -16,6 +16,9 @@ interface ReleaseDetailPageProps { params: Promise<{ id: string; }>; + searchParams: Promise<{ + tab?: string; + }>; } const typeColors: Record = { @@ -40,10 +43,12 @@ function getStatusColor(status: string) { export const dynamic = 'force-dynamic'; -export default async function ReleaseDetailPage({ params }: ReleaseDetailPageProps) { +export default async function ReleaseDetailPage({ params, searchParams }: ReleaseDetailPageProps) { const { id } = await params; + const { tab } = await searchParams; const releaseId = parseInt(id); const release = await getReleaseById(releaseId); + const activeTab = tab === 'verify' ? 'verify' : 'deploy'; if (!release) { notFound(); @@ -186,13 +191,17 @@ export default async function ReleaseDetailPage({ params }: ReleaseDetailPagePro {/* Matrix View (for active) */} {release.status === 'active' && ( - + - - Deploy ({stats.done + stats.skipped}/{stats.total}) + + + Deploy ({stats.done + stats.skipped}/{stats.total}) + - - Verify + + + Verify + diff --git a/src/components/releases/release-matrix-client.tsx b/src/components/releases/release-matrix-client.tsx index 50adee8..f4d16cd 100644 --- a/src/components/releases/release-matrix-client.tsx +++ b/src/components/releases/release-matrix-client.tsx @@ -45,8 +45,9 @@ export function ReleaseMatrixClient({ stepsByCluster, category, releaseId }: Rel const handleActionComplete = () => { setRefreshKey(prev => prev + 1); setIsPanelOpen(false); - // Refresh the page to get updated data - window.location.reload(); + // Refresh the page to get updated data, preserving the current tab + const currentUrl = new URL(window.location.href); + window.location.href = currentUrl.toString(); }; // Server actions wrapped in async functions