From 9e6cc0851b895b5335d709a44802b39862c83db5 Mon Sep 17 00:00:00 2001 From: Dotta Date: Mon, 16 Mar 2026 18:46:26 -0500 Subject: [PATCH] Fix archive project appearing to do nothing The archive mutation lacked user feedback: - No toast notification on success/failure - Navigated to /projects instead of /dashboard after archiving - No error handling if the API call failed Added success/error toasts using the existing ToastContext, navigate to /dashboard after archiving (matching user expectations), and error toast on failure. Co-Authored-By: Paperclip Co-Authored-By: Claude Opus 4.6 --- ui/src/pages/ProjectDetail.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ui/src/pages/ProjectDetail.tsx b/ui/src/pages/ProjectDetail.tsx index 4de40782..daa791c7 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"; @@ -213,6 +214,7 @@ export function ProjectDetail() { const queryClient = useQueryClient(); const navigate = useNavigate(); const location = useLocation(); + const { pushToast } = useToast(); const [fieldSaveStates, setFieldSaveStates] = useState>>({}); const fieldSaveRequestIds = useRef>>({}); const fieldSaveTimers = useRef>>>({}); @@ -287,9 +289,18 @@ export function ProjectDetail() { onSuccess: (_, archived) => { invalidateProject(); if (archived) { - navigate("/projects"); + pushToast({ title: "Project archived", tone: "success" }); + navigate("/dashboard"); + } else { + pushToast({ title: "Project unarchived", tone: "success" }); } }, + onError: (_, archived) => { + pushToast({ + title: archived ? "Failed to archive project" : "Failed to unarchive project", + tone: "error", + }); + }, }); const uploadImage = useMutation({