1+ import { DialogClose } from "@radix-ui/react-dialog" ;
12import { Form , useNavigation , useSubmit } from "@remix-run/react" ;
23import { useCallback , useEffect , useRef } from "react" ;
34import { UseDataFunctionReturn , useTypedFetcher } from "remix-typedjson" ;
@@ -8,6 +9,7 @@ import { DialogContent, DialogHeader } from "~/components/primitives/Dialog";
89import { Header3 } from "~/components/primitives/Headers" ;
910import { InputGroup } from "~/components/primitives/InputGroup" ;
1011import { Label } from "~/components/primitives/Label" ;
12+ import { Paragraph } from "~/components/primitives/Paragraph" ;
1113import { Select , SelectItem } from "~/components/primitives/Select" ;
1214import { ButtonSpinner , Spinner } from "~/components/primitives/Spinner" ;
1315import { type loader } from "~/routes/resources.taskruns.$runParam.replay" ;
@@ -19,7 +21,7 @@ type ReplayRunDialogProps = {
1921
2022export function ReplayRunDialog ( { runFriendlyId, failedRedirect } : ReplayRunDialogProps ) {
2123 return (
22- < DialogContent key = { `replay` } className = "md:max-w-3xl " >
24+ < DialogContent key = { `replay` } className = "md:max-w-xl " >
2325 < ReplayContent runFriendlyId = { runFriendlyId } failedRedirect = { failedRedirect } />
2426 </ DialogContent >
2527 ) ;
@@ -95,8 +97,12 @@ function ReplayForm({
9597 < Form action = { formAction } method = "post" onSubmit = { ( e ) => submitForm ( e ) } className = "pt-2" >
9698 { editablePayload ? (
9799 < >
100+ < Paragraph className = "mb-3" >
101+ Replaying will create a new run using the same or modified payload, executing against
102+ the latest version in your selected environment.
103+ </ Paragraph >
98104 < Header3 spacing > Payload</ Header3 >
99- < div className = "mb-3 max-h-[70vh] overflow-y-auto rounded-sm border border-grid-dimmed bg-charcoal-900 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-charcoal-600" >
105+ < div className = "mb-3 max-h-[70vh] min-h-40 overflow-y-auto rounded-sm border border-grid-dimmed bg-charcoal-900 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-charcoal-600" >
100106 < JSONEditor
101107 autoFocus
102108 defaultValue = { currentJson . current }
@@ -123,8 +129,8 @@ function ReplayForm({
123129 defaultValue = { environment . id }
124130 items = { environments }
125131 dropdownIcon
126- variant = "tertiary/medium "
127- className = "w-fit pl-2 "
132+ variant = "tertiary/small "
133+ className = "w-fit pl-1 "
128134 text = { ( value ) => {
129135 const env = environments . find ( ( env ) => env . id === value ) ! ;
130136 return (
@@ -144,16 +150,20 @@ function ReplayForm({
144150 </ Select >
145151 </ InputGroup >
146152 < input type = "hidden" name = "failedRedirect" value = { failedRedirect } />
147- < Button
148- type = "submit"
149- variant = "primary/medium"
150- LeadingIcon = { isSubmitting ? ButtonSpinner : undefined }
151- disabled = { isSubmitting }
152- shortcut = { { modifiers : [ "meta" ] , key : "enter" , enabledOnInputElements : true } }
153- className = "mt-5"
154- >
155- { isSubmitting ? "Replaying..." : "Replay run" }
156- </ Button >
153+ < div className = "mt-3 flex items-center justify-between gap-2 border-t border-grid-dimmed pt-3.5" >
154+ < DialogClose asChild >
155+ < Button variant = "tertiary/small" > Cancel</ Button >
156+ </ DialogClose >
157+ < Button
158+ type = "submit"
159+ variant = "primary/small"
160+ LeadingIcon = { isSubmitting ? ButtonSpinner : undefined }
161+ disabled = { isSubmitting }
162+ shortcut = { { modifiers : [ "meta" ] , key : "enter" , enabledOnInputElements : true } }
163+ >
164+ { isSubmitting ? "Replaying..." : "Replay run" }
165+ </ Button >
166+ </ div >
157167 </ Form >
158168 ) ;
159169}
0 commit comments