1
+ import { DialogClose } from "@radix-ui/react-dialog" ;
1
2
import { Form , useNavigation , useSubmit } from "@remix-run/react" ;
2
3
import { useCallback , useEffect , useRef } from "react" ;
3
4
import { UseDataFunctionReturn , useTypedFetcher } from "remix-typedjson" ;
@@ -8,6 +9,7 @@ import { DialogContent, DialogHeader } from "~/components/primitives/Dialog";
8
9
import { Header3 } from "~/components/primitives/Headers" ;
9
10
import { InputGroup } from "~/components/primitives/InputGroup" ;
10
11
import { Label } from "~/components/primitives/Label" ;
12
+ import { Paragraph } from "~/components/primitives/Paragraph" ;
11
13
import { Select , SelectItem } from "~/components/primitives/Select" ;
12
14
import { ButtonSpinner , Spinner } from "~/components/primitives/Spinner" ;
13
15
import { type loader } from "~/routes/resources.taskruns.$runParam.replay" ;
@@ -19,7 +21,7 @@ type ReplayRunDialogProps = {
19
21
20
22
export function ReplayRunDialog ( { runFriendlyId, failedRedirect } : ReplayRunDialogProps ) {
21
23
return (
22
- < DialogContent key = { `replay` } className = "md:max-w-3xl " >
24
+ < DialogContent key = { `replay` } className = "md:max-w-xl " >
23
25
< ReplayContent runFriendlyId = { runFriendlyId } failedRedirect = { failedRedirect } />
24
26
</ DialogContent >
25
27
) ;
@@ -95,8 +97,12 @@ function ReplayForm({
95
97
< Form action = { formAction } method = "post" onSubmit = { ( e ) => submitForm ( e ) } className = "pt-2" >
96
98
{ editablePayload ? (
97
99
< >
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 >
98
104
< 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" >
100
106
< JSONEditor
101
107
autoFocus
102
108
defaultValue = { currentJson . current }
@@ -123,8 +129,8 @@ function ReplayForm({
123
129
defaultValue = { environment . id }
124
130
items = { environments }
125
131
dropdownIcon
126
- variant = "tertiary/medium "
127
- className = "w-fit pl-2 "
132
+ variant = "tertiary/small "
133
+ className = "w-fit pl-1 "
128
134
text = { ( value ) => {
129
135
const env = environments . find ( ( env ) => env . id === value ) ! ;
130
136
return (
@@ -144,16 +150,20 @@ function ReplayForm({
144
150
</ Select >
145
151
</ InputGroup >
146
152
< 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 >
157
167
</ Form >
158
168
) ;
159
169
}
0 commit comments