From 7c2f015f31810d1810336560634379b107ef4a9d Mon Sep 17 00:00:00 2001 From: Dotta Date: Mon, 16 Mar 2026 08:16:24 -0500 Subject: [PATCH] fix: replace window.confirm with inline confirmation for archive project Swap the browser alert dialog for an in-page confirm/cancel button pair. Shows a loading spinner while the archive request is in flight, then the redirect and toast (from prior commit) handle the rest. Co-Authored-By: Paperclip Co-Authored-By: Claude Opus 4.6 --- ui/src/components/ProjectProperties.tsx | 98 ++++++++++++++++++------- 1 file changed, 70 insertions(+), 28 deletions(-) diff --git a/ui/src/components/ProjectProperties.tsx b/ui/src/components/ProjectProperties.tsx index 3f6f6e40..f829265a 100644 --- a/ui/src/components/ProjectProperties.tsx +++ b/ui/src/components/ProjectProperties.tsx @@ -154,6 +154,71 @@ function ProjectStatusPicker({ status, onChange }: { status: string; onChange: ( ); } +function ArchiveDangerZone({ + project, + onArchive, + archivePending, +}: { + project: Project; + onArchive: (archived: boolean) => void; + archivePending?: boolean; +}) { + const [confirming, setConfirming] = useState(false); + const isArchive = !project.archivedAt; + const action = isArchive ? "Archive" : "Unarchive"; + + return ( +
+

+ {isArchive + ? "Archive this project to hide it from the sidebar and project selectors." + : "Unarchive this project to restore it in the sidebar and project selectors."} +

+ {archivePending ? ( + + ) : confirming ? ( +
+ + {action} “{project.name}”? + + + +
+ ) : ( + + )} +
+ ); +} + export function ProjectProperties({ project, onUpdate, onFieldUpdate, getFieldSaveState, onArchive, archivePending }: ProjectPropertiesProps) { const { selectedCompanyId } = useCompany(); const queryClient = useQueryClient(); @@ -962,34 +1027,11 @@ export function ProjectProperties({ project, onUpdate, onFieldUpdate, getFieldSa
Danger Zone
-
-

- {project.archivedAt - ? "Unarchive this project to restore it in the sidebar and project selectors." - : "Archive this project to hide it from the sidebar and project selectors."} -

- -
+ )}