The best way to control Claude Code, Codex and more from any computer or phone
Reset script dialog state after close animation
- Clear form fields only after the dialog close completes to avoid stale state during transitions - Keep icon picker closed when the dialog closes Co-authored-by: codex <codex@users.noreply.github.com>
Julius Marminge committed
Feb 17, 2026 at 23:09 UTC
ed40fd3364b7bb575f55ddf07475e7689a037a32
1 file changed
+19
-8
apps/web/src/components/ProjectScriptsControl.tsx
+19
-8
@@ -225,13 +225,7 @@ export default function ProjectScriptsControl({
225
await onAddScript(payload);
226
}
227
setDialogOpen(false);
228
- setEditingScriptId(null);
229
- setName("");
230
- setCommand("");
231
- setIcon("play");
228
setIconPickerOpen(false);
233
- setRunOnWorktreeCreate(false);
234
- setKeybinding("");
229
} catch (error) {
230
setValidationError(error instanceof Error ? error.message : "Failed to save action.");
231
}
@@ -339,7 +333,25 @@ export default function ProjectScriptsControl({
333
</Button>
334
)}
335
342
- <Dialog onOpenChange={setDialogOpen} open={dialogOpen}>
336
+ <Dialog
337
+ onOpenChange={(open) => {
338
+ setDialogOpen(open);
339
+ if (!open) {
340
+ setIconPickerOpen(false);
341
+ }
342
+ }}
343
+ onOpenChangeComplete={(open) => {
344
+ if (open) return;
345
+ setEditingScriptId(null);
346
+ setName("");
347
+ setCommand("");
348
+ setIcon("play");
349
+ setRunOnWorktreeCreate(false);
350
+ setKeybinding("");
351
+ setValidationError(null);
352
+ }}
353
+ open={dialogOpen}
354
+ >
355
<DialogPopup>
356
<DialogHeader>
357
<DialogTitle>{isEditing ? "Edit Action" : "Add Action"}</DialogTitle>
@@ -437,7 +449,6 @@ export default function ProjectScriptsControl({
449
variant="outline"
450
onClick={() => {
451
setDialogOpen(false);
440
- setEditingScriptId(null);
452
}}
453
>
454
Cancel