a15566ddce
Previous attempt wrapped the form's submit button in <DialogClose asChild> so the dialog closed on click. That race-condition'd with Remix's <Form>: Radix's Slot-attached onClick triggered onOpenChange(false), the Dialog and its child Form unmounted mid-cycle, and the button's name=value pair (carrying `redirectUrl`) was dropped from the submitted FormData. The action then read `submission.value.redirectUrl` as undefined and the resulting redirect landed on `/env/dev` instead of the run-detail page. Switch to a ControlledCancelRunDialog at the call site that owns the Radix `open` state. The inner CancelRunDialog watches the navigation state transitions and signals the parent to close the dialog once the submission has captured its submitter cleanly. Submit-button name=value is preserved; redirect resolves to the run-detail page; modal still dismisses after submit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>