Skip to content

Commit 332b1c7

Browse files
feat: Resizable Panels (#873)
1 parent 38daff2 commit 332b1c7

File tree

38 files changed

+240
-145
lines changed

38 files changed

+240
-145
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"react-hook-form": "^7.55.0",
5353
"react-joyride": "^2.9.3",
5454
"react-markdown": "^9.0.3",
55+
"react-resizable-panels": "^3.0.6",
5556
"react-router-dom": "^6.27.0",
5657
"reactflow": "^11.11.4",
5758
"remark-gfm": "^4.0.1",

pnpm-lock.yaml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/deployments/[deploymentId]/_layout/header/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DeploymentDetailTabs } from "./tabs";
33

44
export function DeploymentDetailHeader({ deploymentId }: { deploymentId: string }) {
55
return (
6-
<section className="overflow-x-hidden border-b border-theme-border-moderate bg-theme-surface-primary">
6+
<section className="shrink-0 overflow-x-hidden border-b border-theme-border-moderate bg-theme-surface-primary">
77
<div className="space-y-1 px-5 pt-5 lg:px-[80px]">
88
<DeploymentDetailHeaderInfo deploymentId={deploymentId} />
99
<DeploymentDetailTabs />

src/app/deployments/[deploymentId]/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { DeploymentDetailHeader } from "./_layout/header";
44
export default function DeploymentDetailLayout() {
55
const { deploymentId } = useParams() as { deploymentId: string };
66
return (
7-
<div className="flex h-full flex-1 flex-col">
7+
<div className="flex h-full flex-col">
88
<DeploymentDetailHeader deploymentId={deploymentId} />
9-
<section className="flex-1">
9+
<section className="flex-1 overflow-y-auto">
1010
<Outlet />
1111
</section>
1212
</div>

src/app/deployments/[deploymentId]/playground/_components/inputs/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function PlaygroundInputs({ snapshot, submitDeployment, isInvoking, deplo
1919
return (
2020
<form
2121
onSubmit={form.handleSubmit(handleSubmit)}
22-
className="flex h-full w-full flex-col divide-y divide-theme-border-moderate pl-5 pr-5 xl:w-1/2 xl:pl-[80px] xl:pr-0"
22+
className="flex h-full w-full flex-col divide-y divide-theme-border-moderate pl-5 pr-5 xl:pl-[80px] xl:pr-0"
2323
>
2424
<div className="flex h-full flex-col gap-5 overflow-auto py-5 xl:pr-5">
2525
<p className="text-text-lg font-semibold">Input</p>

src/app/deployments/[deploymentId]/playground/_components/outputs/content.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function PlaygroundOutputsContent({ outputs, clearOutputs }: Props) {
1919

2020
return (
2121
<div className="flex h-full w-full flex-col divide-y divide-theme-border-moderate">
22-
<div className="flex h-full flex-col gap-5 overflow-auto py-5 pl-5 pr-5 xl:pr-0">
22+
<div className="flex h-full flex-col gap-5 overflow-y-auto py-5 pl-5 pr-5 xl:pr-0">
2323
<PlaygroundOutputsHeader activeView={activeView} setActiveView={setActiveView} />
2424
<div>
2525
<PlaygroundRunCard
@@ -44,7 +44,7 @@ export function PlaygroundOutputsContent({ outputs, clearOutputs }: Props) {
4444
wordWrap: "on",
4545
wordWrapColumn: 80
4646
}}
47-
className="h-full border border-theme-border-moderate"
47+
className="h-full min-h-[200px] border border-theme-border-moderate md:min-h-[auto]"
4848
/>
4949
)
5050
) : (

src/app/deployments/[deploymentId]/playground/_components/outputs/run-card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ export function PlaygroundRunCard({ runId, runName, duration, success }: Props)
1818
return (
1919
<Box className="space-y-3 p-3">
2020
<div className="flex flex-wrap items-start justify-between gap-1">
21-
<div>
21+
<div className="max-w-full">
2222
<p className="text-text-xs text-theme-text-tertiary">Run</p>
2323
<div className="flex items-center gap-1">
24-
<p className="font-semibold">{runName}</p>
24+
<p className="truncate font-semibold">{runName}</p>
2525
<ExecutionStatusIcon
2626
className="size-3 shrink-0"
2727
status={success ? "completed" : "failed"}

src/app/deployments/[deploymentId]/playground/page.content.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { PlaygroundInputs } from "./_components/inputs";
44
import { useInvokeDeployment } from "@/data/deployment-invocations/invoke";
55
import { PlaygroundOutputs } from "./_components/outputs";
66
import { useToast } from "@zenml-io/react-component-library";
7+
import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels";
78

89
type Props = {
910
snapshot: PipelineSnapshot;
@@ -53,20 +54,23 @@ export function PlaygroundPageContent({ snapshot, deployment }: Props) {
5354
}
5455

5556
return (
56-
<div className="flex h-full w-full flex-1 flex-col divide-y divide-theme-border-moderate xl:flex-row xl:divide-x xl:divide-y-0">
57-
<PlaygroundInputs
58-
deploymentId={deployment.id}
59-
isInvoking={invokeDeployment.isPending}
60-
submitDeployment={submitDeployment}
61-
snapshot={snapshot}
62-
/>
63-
<div className="h-full w-full bg-theme-surface-primary xl:w-1/2 xl:pr-[80px]">
57+
<PanelGroup direction="horizontal" className="h-full !flex-col md:!flex-row">
58+
<Panel minSize={33} defaultSize={50}>
59+
<PlaygroundInputs
60+
deploymentId={deployment.id}
61+
isInvoking={invokeDeployment.isPending}
62+
submitDeployment={submitDeployment}
63+
snapshot={snapshot}
64+
/>
65+
</Panel>
66+
<PanelResizeHandle className="hidden w-[1px] bg-theme-border-moderate transition-colors duration-200 data-[resize-handle-state=drag]:bg-theme-border-bold data-[resize-handle-state=hover]:bg-theme-border-bold md:block" />
67+
<Panel minSize={33} defaultSize={50} className="h-full bg-theme-surface-primary xl:pr-[80px]">
6468
<PlaygroundOutputs
6569
clearOutputs={() => invokeDeployment.reset()}
6670
isInvoking={invokeDeployment.isPending}
6771
outputs={invokeDeployment.data}
6872
/>
69-
</div>
70-
</div>
73+
</Panel>
74+
</PanelGroup>
7175
);
7276
}

src/app/overview/pipelines-grid/pipeline-sheet.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Codesnippet } from "@/components/CodeSnippet";
66
import { HelpBox } from "@/components/fallback-pages/Helpbox";
77
import { FallbackIcon } from "@/components/fallback/icon";
88
import { SheetHeader } from "@/components/sheet/SheetHeader";
9+
import { ResizableSheetContent } from "@/components/sheet/resizable-sheet";
910
import { Tick } from "@/components/Tick";
1011
import { useGithubPipelineSummary } from "@/data/github/pipeline-summary";
1112
import { useCopy } from "@/lib/copy";
@@ -15,7 +16,6 @@ import {
1516
DialogTitle,
1617
ProgressOutstanding,
1718
Sheet,
18-
SheetContent,
1919
SheetTrigger,
2020
Skeleton
2121
} from "@zenml-io/react-component-library";
@@ -43,7 +43,7 @@ export function GithubPipelineSheet({
4343
return (
4444
<Sheet open={open} onOpenChange={onOpenChange}>
4545
<SheetTrigger className="w-full">{children}</SheetTrigger>
46-
<SheetContent aria-describedby={undefined} className="w-[1000px] overflow-y-auto">
46+
<ResizableSheetContent className="overflow-y-auto">
4747
<SheetHeader />
4848
<SecondaryHeader
4949
displayName={displayName}
@@ -75,7 +75,7 @@ export function GithubPipelineSheet({
7575
<NoPipelineContentFallback />
7676
)}
7777
</div>
78-
</SheetContent>
78+
</ResizableSheetContent>
7979
</Sheet>
8080
);
8181
}

src/app/pipelines/[pipelineId]/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default function PipelineDetailLayout() {
55
return (
66
<div>
77
<PipelineDetailHeader />
8-
<section className="px-5 pt-5 lg:px-[80px]">
8+
<section className="p-5 lg:px-[80px]">
99
<Outlet />
1010
</section>
1111
</div>

0 commit comments

Comments
 (0)