Skip to content

Commit 3953e8b

Browse files
committed
Added a description to the replay run modal and improved the styling slightly
1 parent be23df4 commit 3953e8b

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

apps/webapp/app/components/runs/v3/ReplayRunDialog.tsx

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { DialogClose } from "@radix-ui/react-dialog";
12
import { Form, useNavigation, useSubmit } from "@remix-run/react";
23
import { useCallback, useEffect, useRef } from "react";
34
import { UseDataFunctionReturn, useTypedFetcher } from "remix-typedjson";
@@ -8,6 +9,7 @@ import { DialogContent, DialogHeader } from "~/components/primitives/Dialog";
89
import { Header3 } from "~/components/primitives/Headers";
910
import { InputGroup } from "~/components/primitives/InputGroup";
1011
import { Label } from "~/components/primitives/Label";
12+
import { Paragraph } from "~/components/primitives/Paragraph";
1113
import { Select, SelectItem } from "~/components/primitives/Select";
1214
import { ButtonSpinner, Spinner } from "~/components/primitives/Spinner";
1315
import { type loader } from "~/routes/resources.taskruns.$runParam.replay";
@@ -19,7 +21,7 @@ type ReplayRunDialogProps = {
1921

2022
export 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
}

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export default function Page() {
197197
LeadingIcon={ArrowUturnLeftIcon}
198198
shortcut={{ key: "R" }}
199199
>
200-
Replay run
200+
Replay run
201201
</Button>
202202
</DialogTrigger>
203203
<ReplayRunDialog

0 commit comments

Comments
 (0)