authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-17 23:09:09-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-02-18 00:59:06-08:00
loged40fd3364b7bb575f55ddf07475e7689a037a32
tree116bc0f720f4549653e2f749408f2db36a60c7a6
parent88f31d2f65b1db7a557320d99f70b8c707cfdf4f

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>

1 files changed, 19 insertions(+), 8 deletions(-)

apps/web/src/components/ProjectScriptsControl.tsx+19-8
......@@ -225,13 +225,7 @@ export default function ProjectScriptsControl({
225225 await onAddScript(payload);
226226 }
227227 setDialogOpen(false);
228 setEditingScriptId(null);
229 setName("");
230 setCommand("");
231 setIcon("play");
232228 setIconPickerOpen(false);
233 setRunOnWorktreeCreate(false);
234 setKeybinding("");
235229 } catch (error) {
236230 setValidationError(error instanceof Error ? error.message : "Failed to save action.");
237231 }
......@@ -339,7 +333,25 @@ export default function ProjectScriptsControl({
339333 </Button>
340334 )}
341335
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 >
343355 <DialogPopup>
344356 <DialogHeader>
345357 <DialogTitle>{isEditing ? "Edit Action" : "Add Action"}</DialogTitle>
......@@ -437,7 +449,6 @@ export default function ProjectScriptsControl({
437449 variant="outline"
438450 onClick={() => {
439451 setDialogOpen(false);
440 setEditingScriptId(null);
441452 }}
442453 >
443454 Cancel