From 0fd7ed84fb416d00425928e2996fb7741c150c99 Mon Sep 17 00:00:00 2001 From: Dotta Date: Mon, 16 Mar 2026 07:59:19 -0500 Subject: [PATCH] fix: archive project navigates to dashboard and shows toast Previously archiving a project silently navigated to /projects with no feedback. Now it navigates to /dashboard and shows a success toast for both archive and unarchive actions. Closes PAP-521 Co-Authored-By: Paperclip Co-Authored-By: Claude Opus 4.6 --- ui/src/pages/ProjectDetail.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/src/pages/ProjectDetail.tsx b/ui/src/pages/ProjectDetail.tsx index a0f1b7d7..ebb7cec8 100644 --- a/ui/src/pages/ProjectDetail.tsx +++ b/ui/src/pages/ProjectDetail.tsx @@ -10,6 +10,7 @@ import { heartbeatsApi } from "../api/heartbeats"; import { assetsApi } from "../api/assets"; import { usePanel } from "../context/PanelContext"; import { useCompany } from "../context/CompanyContext"; +import { useToast } from "../context/ToastContext"; import { useBreadcrumbs } from "../context/BreadcrumbContext"; import { queryKeys } from "../lib/queryKeys"; import { ProjectProperties, type ProjectConfigFieldKey, type ProjectFieldSaveState } from "../components/ProjectProperties"; @@ -210,6 +211,7 @@ export function ProjectDetail() { const { companies, selectedCompanyId, setSelectedCompanyId } = useCompany(); const { closePanel } = usePanel(); const { setBreadcrumbs } = useBreadcrumbs(); + const { pushToast } = useToast(); const queryClient = useQueryClient(); const navigate = useNavigate(); const location = useLocation(); @@ -284,10 +286,14 @@ export function ProjectDetail() { { archivedAt: archived ? new Date().toISOString() : null }, resolvedCompanyId ?? lookupCompanyId, ), - onSuccess: (_, archived) => { + onSuccess: (updatedProject, archived) => { invalidateProject(); + const name = updatedProject?.name ?? project?.name ?? "Project"; if (archived) { - navigate("/projects"); + pushToast({ title: `"${name}" has been archived`, tone: "success" }); + navigate("/dashboard"); + } else { + pushToast({ title: `"${name}" has been unarchived`, tone: "success" }); } }, });