Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

Reset script dialog state after close animation

Julius Marmingeed40fd3364b7
diff --git a/apps/web/src/components/ProjectScriptsControl.tsx b/apps/web/src/components/ProjectScriptsControl.tsx
index f2e192e34..71d1edad9 100644
--- a/apps/web/src/components/ProjectScriptsControl.tsx
+++ b/apps/web/src/components/ProjectScriptsControl.tsx
@@ -225,13 +225,7 @@ export default function ProjectScriptsControl({
await onAddScript(payload);
}
setDialogOpen(false);
- setEditingScriptId(null);
- setName("");
- setCommand("");
- setIcon("play");
setIconPickerOpen(false);
- setRunOnWorktreeCreate(false);
- setKeybinding("");
} catch (error) {
setValidationError(error instanceof Error ? error.message : "Failed to save action.");
}
@@ -339,7 +333,25 @@ export default function ProjectScriptsControl({
</Button>
)}
- <Dialog onOpenChange={setDialogOpen} open={dialogOpen}>
+ <Dialog
+ onOpenChange={(open) => {
+ setDialogOpen(open);
+ if (!open) {
+ setIconPickerOpen(false);
+ }
+ }}
+ onOpenChangeComplete={(open) => {
+ if (open) return;
+ setEditingScriptId(null);
+ setName("");
+ setCommand("");
+ setIcon("play");
+ setRunOnWorktreeCreate(false);
+ setKeybinding("");
+ setValidationError(null);
+ }}
+ open={dialogOpen}
+ >
<DialogPopup>
<DialogHeader>
<DialogTitle>{isEditing ? "Edit Action" : "Add Action"}</DialogTitle>
@@ -437,7 +449,6 @@ export default function ProjectScriptsControl({
variant="outline"
onClick={() => {
setDialogOpen(false);
- setEditingScriptId(null);
}}
>
Cancel