Skip to content

The open-source app everyone uses to manage agents at work

fix: archive project navigates to dashboard and shows toast

Dotta0fd7ed84fb41
diff --git a/ui/src/pages/ProjectDetail.tsx b/ui/src/pages/ProjectDetail.tsx
index a0f1b7d753..ebb7cec8f0 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" });
}
},
});