Skip to content

Commit ca92c22

Browse files
committed
Moves the Close session button
1 parent 8bcd19b commit ca92c22

2 files changed

Lines changed: 25 additions & 23 deletions

File tree

  • apps/webapp/app

apps/webapp/app/components/sessions/v1/CloseSessionDialog.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export function CloseSessionDialog({
3030
<DialogHeader>Close this session?</DialogHeader>
3131
<div className="flex flex-col gap-3 pt-3">
3232
<Paragraph>
33-
Closing a session is permanent. The session will no longer accept new input or trigger
34-
new runs. Any in-flight run continues until it finishes on its own.
33+
Closing a session is permanent. The session will no longer accept new input or trigger new
34+
runs. Any in-flight run continues until it finishes on its own.
3535
</Paragraph>
3636
<Form action={formAction} method="post" className="flex flex-col gap-3">
3737
<input type="hidden" name="redirectUrl" value={redirectPath} />
@@ -52,16 +52,15 @@ export function CloseSessionDialog({
5252
<Button
5353
type="submit"
5454
variant="danger/medium"
55-
LeadingIcon={isLoading ? SpinnerWhite : XCircleIcon}
5655
disabled={isLoading}
5756
shortcut={{ modifiers: ["mod"], key: "enter" }}
5857
>
59-
{isLoading ? "Closing..." : "Close session"}
58+
{isLoading ? "Closing" : "Close session"}
6059
</Button>
6160
}
6261
cancelButton={
6362
<DialogClose asChild>
64-
<Button variant={"tertiary/medium"}>Cancel</Button>
63+
<Button variant={"secondary/medium"}>Cancel</Button>
6564
</DialogClose>
6665
}
6766
/>

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.sessions.$sessionParam/route.tsx

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,6 @@ export default function Page() {
143143
>
144144
Sessions docs
145145
</LinkButton>
146-
{status === "ACTIVE" && (
147-
<Dialog key={`close-${session.friendlyId}`}>
148-
<DialogTrigger asChild>
149-
<Button variant="danger/small">Close session…</Button>
150-
</DialogTrigger>
151-
<CloseSessionDialog
152-
sessionParam={session.friendlyId}
153-
environmentId={environment.id}
154-
redirectPath={`${sessionsPath}/${session.friendlyId}`}
155-
/>
156-
</Dialog>
157-
)}
158146
</PageAccessories>
159147
</NavBar>
160148
<PageBody scrollable={false}>
@@ -665,16 +653,31 @@ function OverviewTab({ session, status }: { session: LoadedSession; status: Sess
665653
const project = useProject();
666654
const environment = useEnvironment();
667655
const isAdmin = useHasAdminAccess();
656+
const sessionsPath = v3SessionsPath(organization, project, environment);
668657

669658
return (
670659
<div className="flex flex-col gap-4">
671660
<Property.Table>
672-
<Property.Item>
673-
<Property.Label>Status</Property.Label>
674-
<Property.Value>
675-
<SessionStatusCombo status={status} />
676-
</Property.Value>
677-
</Property.Item>
661+
<div className="flex items-start justify-between gap-3">
662+
<Property.Item>
663+
<Property.Label>Status</Property.Label>
664+
<Property.Value>
665+
<SessionStatusCombo status={status} />
666+
</Property.Value>
667+
</Property.Item>
668+
{status === "ACTIVE" && (
669+
<Dialog key={`close-${session.friendlyId}`}>
670+
<DialogTrigger asChild>
671+
<Button variant="danger/small">Close session…</Button>
672+
</DialogTrigger>
673+
<CloseSessionDialog
674+
sessionParam={session.friendlyId}
675+
environmentId={environment.id}
676+
redirectPath={`${sessionsPath}/${session.friendlyId}`}
677+
/>
678+
</Dialog>
679+
)}
680+
</div>
678681
<Property.Item>
679682
<Property.Label>Friendly ID</Property.Label>
680683
<Property.Value>

0 commit comments

Comments
 (0)