Skip to content

Automate browser based workflows with AI

feat(SKY-11481): collapsible & persistent studio settings panel (#6889)

Celal Zamanoğluc24b39279632
diff --git a/skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx b/skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx
index 32ebe70c0..9027bfe13 100644
--- a/skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx
@@ -15,6 +15,7 @@ import { useShouldNotifyWhenClosingTab } from "@/hooks/useShouldNotifyWhenClosin
import { BlockActionContext } from "@/store/BlockActionContext";
import { useDebugStore } from "@/store/useDebugStore";
import { useRecordedBlocksStore } from "@/store/RecordedBlocksStore";
+import { useStudioShellStore } from "@/store/StudioShellStore";
import {
useWorkflowHasChangesStore,
useWorkflowSave,
@@ -447,6 +448,9 @@ function FlowRenderer({
const selectedBlockId = useWorkflowPanelStore(
(state) => state.selectedBlockId,
);
+ const setSettingsCollapsed = useStudioShellStore(
+ (state) => state.setSettingsCollapsed,
+ );
// Escape clears the canvas selection. The listener is mounted
// on the FlowRenderer because that scopes the global keydown to the
@@ -460,13 +464,19 @@ function FlowRenderer({
if (event.key !== "Escape") {
return;
}
+ // In the studio shell the settings panel is persistent, so Escape
+ // collapses it to the rail rather than deselecting (which would hide it).
+ if (embedded) {
+ setSettingsCollapsed(true);
+ return;
+ }
setSelectedBlockId(null);
};
window.addEventListener("keydown", handleKeyDown);
return () => {
window.removeEventListener("keydown", handleKeyDown);
};
- }, [setSelectedBlockId, readOnly]);
+ }, [setSelectedBlockId, setSettingsCollapsed, embedded, readOnly]);
// Programmatic viewport changes (e.g. `fitView`) animate via `setViewport`,
// which fires `onMove`. Without this gate, `constrainPan` would clamp every
@@ -1981,12 +1991,21 @@ function FlowRenderer({
return;
}
setSelectedBlockId(node.id);
+ // Studio: a deliberate block click expands the persistent
+ // settings panel (it starts collapsed on open).
+ if (embedded) {
+ setSettingsCollapsed(false);
+ }
}}
onPaneClick={() => {
if (readOnly) {
return;
}
- setSelectedBlockId(null);
+ // Studio: keep the persistent settings panel mounted on a
+ // canvas click instead of deselecting (which would hide it).
+ if (!embedded) {
+ setSelectedBlockId(null);
+ }
}}
nodeTypes={nodeTypes}
edgeTypes={edgeTypes}
diff --git a/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx b/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx
index ba002ded3..2afaf6f99 100644
--- a/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx
@@ -326,6 +326,9 @@ function Workspace({
(s) => s.setCopilotCollapsed,
);
const studioSetTab = useStudioShellStore((s) => s.setTab);
+ const studioSetSettingsCollapsed = useStudioShellStore(
+ (s) => s.setSettingsCollapsed,
+ );
// The studio canvas sits right of the Copilot column; offset the fit by the
// column width so the chain centers on the whole page, not just the pane.
const studioCanvasCenterOffset = embedded
@@ -844,6 +847,11 @@ function Workspace({
? (initialNodes.find((node) => node.type === "start")?.id ?? null)
: null;
useWorkflowPanelStore.getState().setSelectedBlockId(startNodeId);
+ // The collapse flag is a module-level store, so it survives an in-session
+ // A→B workflow nav; re-collapse here so every workflow opens to the rail.
+ if (embedded) {
+ studioSetSettingsCollapsed(true);
+ }
useShowAllCodeStore.getState().reset();
useSidebarSaveStateStore.getState().reset();
cacheKeyInitWpidRef.current = null;
@@ -1384,6 +1392,11 @@ function Workspace({
});
doLayout(newNodesAfter, [...editedEdges, ...newEdges]);
useWorkflowPanelStore.getState().setSelectedBlockId(id);
+ // Adding a block is a deliberate action: expand the studio settings panel
+ // to the new block (the library flow doesn't go through onNodeClick).
+ if (embedded) {
+ studioSetSettingsCollapsed(false);
+ }
}
const orderedBlockLabels = getOrderedBlockLabels(workflow);
diff --git a/skyvern-frontend/src/routes/workflows/editor/panels/BlockConfigSidebar.test.tsx b/skyvern-frontend/src/routes/workflows/editor/panels/BlockConfigSidebar.test.tsx
index 4432adb0e..5a24aff67 100644
--- a/skyvern-frontend/src/routes/workflows/editor/panels/BlockConfigSidebar.test.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/panels/BlockConfigSidebar.test.tsx
@@ -81,6 +81,7 @@ import {
BLOCK_SIDEBAR_WIDTH_MAX,
useBlockSidebarWidthStore,
} from "@/store/BlockSidebarWidthStore";
+import { useStudioShellStore } from "@/store/StudioShellStore";
import { useWorkflowPanelStore } from "@/store/WorkflowPanelStore";
import { BLOCK_FORMS, type WorkflowBlockNodeType } from "./BlockConfigForm";
@@ -122,6 +123,7 @@ beforeEach(() => {
content: "parameters",
});
useBlockSidebarWidthStore.getState().reset();
+ useStudioShellStore.getState().reset();
for (const key of BLOCK_FORM_KEYS) {
BLOCK_FORMS[key] = StubFormForBlockType(key);
}
@@ -321,9 +323,9 @@ describe("BlockConfigSidebar block library layout (contained drawer)", () => {
</MemoryRouter>,
);
- const sidebarRoot = screen.getByTestId(
- "block-config-sidebar",
- ).parentElement;
+ // aside → shell wrapper → Resizable root (the element carrying the width).
+ const sidebarRoot = screen.getByTestId("block-config-sidebar")
+ .parentElement?.parentElement;
expect(getContainedBlockSidebarWidth(BLOCK_SIDEBAR_WIDTH_MAX, 500)).toBe(
452,
@@ -446,3 +448,131 @@ describe("BlockConfigSidebar block title editing (SKY-10255)", () => {
expect(mockLabelChangeHandler).not.toHaveBeenCalled();
});
});
+
+describe("BlockConfigSidebar settings collapse (SKY-11481)", () => {
+ test("embedded studio renders the settings panel collapsed to a rail by default", () => {
+ act(() => {
+ useWorkflowPanelStore.getState().setSelectedBlockId("start-block");
+ });
+ render(
+ <MemoryRouter initialEntries={["/workflows/wpid_abc/edit"]}>
+ <BlockConfigSidebar embedded />
+ </MemoryRouter>,
+ );
+
+ expect(screen.getByTestId("settings-rail")).toBeDefined();
+ expect(useStudioShellStore.getState().settingsCollapsed).toBe(true);
+ // The body stays mounted (so the width animation can clip it) but inert.
+ expect(screen.getByTestId("block-config-sidebar").className).toContain(
+ "pointer-events-none",
+ );
+ });
+
+ test("the rail is collapsible for any block, not just Agent Settings", () => {
+ act(() => {
+ useWorkflowPanelStore.getState().setSelectedBlockId("block-a");
+ });
+ render(
+ <MemoryRouter initialEntries={["/workflows/wpid_abc/edit"]}>
+ <BlockConfigSidebar embedded />
+ </MemoryRouter>,
+ );
+
+ const rail = screen.getByTestId("settings-rail");
+ expect(rail.textContent).toContain("Alpha");
+ expect(screen.getByTestId("block-config-sidebar").className).toContain(
+ "pointer-events-none",
+ );
+ });
+
+ test("clicking the rail expands to the full settings panel", () => {
+ act(() => {
+ useWorkflowPanelStore.getState().setSelectedBlockId("start-block");
+ });
+ render(
+ <MemoryRouter initialEntries={["/workflows/wpid_abc/edit"]}>
+ <BlockConfigSidebar embedded />
+ </MemoryRouter>,
+ );
+
+ fireEvent.click(screen.getByRole("button", { name: "Show settings" }));
+
+ expect(screen.queryByTestId("settings-rail")).toBeNull();
+ expect(screen.getByText("Agent Settings")).toBeDefined();
+ // Expanded body is interactive again.
+ expect(screen.getByTestId("block-config-sidebar").className).not.toContain(
+ "pointer-events-none",
+ );
+ });
+
+ test("the header chevron collapses the panel back to the rail", () => {
+ act(() => {
+ useStudioShellStore.getState().setSettingsCollapsed(false);
+ useWorkflowPanelStore.getState().setSelectedBlockId("block-a");
+ });
+ render(
+ <MemoryRouter initialEntries={["/workflows/wpid_abc/edit"]}>
+ <BlockConfigSidebar embedded />
+ </MemoryRouter>,
+ );
+
+ expect(screen.queryByTestId("settings-rail")).toBeNull();
+ expect(
+ screen.queryByRole("button", { name: "Close block configuration" }),
+ ).toBeNull();
+
+ fireEvent.click(screen.getByRole("button", { name: "Collapse settings" }));
+
+ expect(screen.getByTestId("settings-rail")).toBeDefined();
+ expect(useStudioShellStore.getState().settingsCollapsed).toBe(true);
+ // Body stays mounted (clipped under the rail) but inert.
+ expect(screen.getByTestId("block-config-sidebar").className).toContain(
+ "pointer-events-none",
+ );
+ });
+
+ test("the embedded shell uses the 0.75rem right inset mirroring the Copilot column", () => {
+ // The 0.75rem inset now lives on the animated shell (Resizable root), not
+ // the rail; collapsed and expanded both anchor there.
+ act(() => {
+ useWorkflowPanelStore.getState().setSelectedBlockId("start-block");
+ });
+ const { rerender } = render(
+ <MemoryRouter initialEntries={["/workflows/wpid_abc/edit"]}>
+ <BlockConfigSidebar embedded />
+ </MemoryRouter>,
+ );
+ const railShell =
+ screen.getByTestId("settings-rail").parentElement?.parentElement;
+ expect(railShell?.style.right).toBe("0.75rem");
+
+ act(() => {
+ useStudioShellStore.getState().setSettingsCollapsed(false);
+ });
+ rerender(
+ <MemoryRouter initialEntries={["/workflows/wpid_abc/edit"]}>
+ <BlockConfigSidebar embedded />
+ </MemoryRouter>,
+ );
+ const panelShell = screen.getByTestId("block-config-sidebar").parentElement
+ ?.parentElement;
+ expect(panelShell?.style.right).toBe("0.75rem");
+ });
+
+ test("legacy (non-embedded) editor does not collapse and keeps the close button", () => {
+ act(() => {
+ useWorkflowPanelStore.getState().setSelectedBlockId("block-a");
+ });
+ render(
+ <MemoryRouter initialEntries={["/workflows/wpid_abc/edit"]}>
+ <BlockConfigSidebar />
+ </MemoryRouter>,
+ );
+
+ expect(screen.queryByTestId("settings-rail")).toBeNull();
+ expect(screen.getByTestId("block-config-sidebar")).toBeDefined();
+ expect(
+ screen.getByRole("button", { name: "Close block configuration" }),
+ ).toBeDefined();
+ });
+});
diff --git a/skyvern-frontend/src/routes/workflows/editor/panels/BlockConfigSidebar.tsx b/skyvern-frontend/src/routes/workflows/editor/panels/BlockConfigSidebar.tsx
index c53dfd636..33b10f232 100644
--- a/skyvern-frontend/src/routes/workflows/editor/panels/BlockConfigSidebar.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/panels/BlockConfigSidebar.tsx
@@ -1,4 +1,10 @@
-import { Cross2Icon, GearIcon, PlusIcon } from "@radix-ui/react-icons";
+import {
+ ChevronLeftIcon,
+ ChevronRightIcon,
+ Cross2Icon,
+ GearIcon,
+ PlusIcon,
+} from "@radix-ui/react-icons";
import { useNodesData, useReactFlow } from "@xyflow/react";
import { Resizable } from "re-resizable";
import { useEffect, useLayoutEffect, useRef, useState } from "react";
@@ -10,6 +16,7 @@ import {
} from "@/store/BlockSidebarWidthStore";
import { usePendingCommitsStore } from "@/store/PendingCommitsStore";
import { useSidebarSaveStateStore } from "@/store/SidebarSaveStateStore";
+import { useStudioShellStore } from "@/store/StudioShellStore";
import { useWorkflowPanelStore } from "@/store/WorkflowPanelStore";
import { cn } from "@/util/utils";
@@ -29,6 +36,12 @@ import {
import { BlockConfigForm } from "./BlockConfigForm";
import { useHasInteractedThisSession } from "./useHasInteractedThisSession";
import { WorkflowNodeLibraryPanel } from "./WorkflowNodeLibraryPanel";
+import {
+ STUDIO_COPILOT_COLLAPSE_EASE,
+ STUDIO_COPILOT_RAIL_WIDTH,
+ STUDIO_COPILOT_TRANSITION_EASE,
+ STUDIO_COPILOT_TRANSITION_MS,
+} from "../../studio/constants";
import type { AddNodeProps } from "../Workspace";
// React Flow node type → backend WorkflowBlockType. The two diverge in
@@ -81,6 +94,83 @@ function getBlockTypeFromNode(node: AppNode): WorkflowBlockType | null {
const FOOTER_TICK_INTERVAL_MS = 10_000;
+// Reuse the Copilot rail width so the two studio rails can't drift apart.
+const SETTINGS_RAIL_WIDTH = STUDIO_COPILOT_RAIL_WIDTH;
+
+type SidebarIdentity = {
+ label: string;
+ isStart: boolean;
+ blockType: WorkflowBlockType | null;
+};
+
+function getSidebarIdentity(node: AppNode | null): SidebarIdentity {
+ const isStart = node ? isStartNode(node) : false;
+ const blockType = node ? getBlockTypeFromNode(node) : null;
+ const label = isStart
+ ? "Agent Settings"
+ : typeof node?.data?.label === "string" && node.data.label.length > 0
+ ? node.data.label
+ : blockType
+ ? workflowBlockTitle[blockType]
+ : "";
+ return { label, isStart, blockType };
+}
+
+function SidebarIdentityIcon({
+ identity,
+}: Readonly<{ identity: SidebarIdentity }>) {
+ // The gear doubles as the generic "settings" glyph: it covers both the start
+ // node and the unknown-block fallback (a detached/untyped node has no icon).
+ return (
+ <div className="flex h-8 w-8 shrink-0 items-center justify-center rounded border border-slate-600">
+ {!identity.isStart && identity.blockType ? (
+ <WorkflowBlockIcon
+ workflowBlockType={identity.blockType}
+ className="size-4"
+ />
+ ) : (
+ <GearIcon className="size-4" />
+ )}
+ </div>
+ );
+}
+
+// Collapsed settings rail content (slim right-edge controls), mirroring the
+// Copilot rail; the shared shell wrapper owns the card chrome + width animation.
+function SettingsRail({
+ identity,
+ onExpand,
+}: Readonly<{ identity: SidebarIdentity; onExpand: () => void }>) {
+ // Opaque background covers the clipped panel underneath immediately (no
+ // show-through "open-flicker"); only the controls fade in, like Copilot.
+ return (
+ <div
+ data-testid="settings-rail"
+ style={{ width: SETTINGS_RAIL_WIDTH }}
+ className="absolute right-0 top-0 h-full bg-slate-elevation2"
+ >
+ <div className="flex h-full flex-col items-center gap-3 py-3 duration-300 animate-in fade-in">
+ <button
+ type="button"
+ onClick={onExpand}
+ title="Show settings"
+ aria-label="Show settings"
+ className="rounded p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
+ >
+ <ChevronLeftIcon className="h-4 w-4" />
+ </button>
+ <SidebarIdentityIcon identity={identity} />
+ <span
+ className="mt-1 max-h-[60%] overflow-hidden text-ellipsis text-xs font-medium tracking-wide text-muted-foreground"
+ style={{ writingMode: "vertical-rl" }}
+ >
+ {identity.label}
+ </span>
+ </div>
+ </div>
+ );
+}
+
function measureElementWidth(element: HTMLElement): number | null {
const boundingWidth = element.getBoundingClientRect().width;
if (boundingWidth > 0) {
@@ -193,60 +283,59 @@ function EditableBlockTitle({
function BlockConfigSidebarBody({
selectedBlockId,
+ identity,
onClose,
-}: Readonly<{ selectedBlockId: string; onClose: () => void }>) {
- const reactFlowInstance = useReactFlow<AppNode>();
- const node = reactFlowInstance.getNode(selectedBlockId);
-
- const isStart = node ? isStartNode(node) : false;
- const blockType = node ? getBlockTypeFromNode(node) : null;
- const label = isStart
- ? "Agent Settings"
- : typeof node?.data?.label === "string" && node.data.label.length > 0
- ? node.data.label
- : blockType
- ? workflowBlockTitle[blockType]
- : "";
-
+ onCollapse,
+}: Readonly<{
+ selectedBlockId: string;
+ identity: SidebarIdentity;
+ onClose: () => void;
+ // When set (studio shell), the header's close affordance collapses the panel
+ // to a rail instead of deselecting the block.
+ onCollapse?: () => void;
+}>) {
return (
<>
<header className="flex h-20 items-center justify-between gap-3 border-b border-border px-6">
<div className="flex min-w-0 items-center gap-3">
- {isStart ? (
- <div className="flex h-8 w-8 shrink-0 items-center justify-center rounded border border-slate-600">
- <GearIcon className="size-4" />
- </div>
- ) : blockType ? (
- <div className="flex h-8 w-8 shrink-0 items-center justify-center rounded border border-slate-600">
- <WorkflowBlockIcon
- workflowBlockType={blockType}
- className="size-4"
- />
- </div>
+ {identity.isStart || identity.blockType ? (
+ <SidebarIdentityIcon identity={identity} />
) : null}
<div className="min-w-0">
- {isStart ? (
+ {identity.isStart ? (
<h2 className="truncate text-sm font-medium text-slate-100">
- {label}
+ {identity.label}
</h2>
) : (
<EditableBlockTitle
key={selectedBlockId}
blockId={selectedBlockId}
- fallbackLabel={label}
+ fallbackLabel={identity.label}
/>
)}
<SubLabel />
</div>
</div>
- <button
- type="button"
- onClick={onClose}
- aria-label="Close block configuration"
- className="rounded p-1 text-slate-400 transition-colors hover:bg-slate-700 hover:text-slate-100"
- >
- <Cross2Icon className="h-4 w-4" />
- </button>
+ {onCollapse ? (
+ <button
+ type="button"
+ onClick={onCollapse}
+ aria-label="Collapse settings"
+ title="Collapse settings"
+ className="rounded p-1 text-slate-400 transition-colors hover:bg-slate-700 hover:text-slate-100"
+ >
+ <ChevronRightIcon className="h-4 w-4" />
+ </button>
+ ) : (
+ <button
+ type="button"
+ onClick={onClose}
+ aria-label="Close block configuration"
+ className="rounded p-1 text-slate-400 transition-colors hover:bg-slate-700 hover:text-slate-100"
+ >
+ <Cross2Icon className="h-4 w-4" />
+ </button>
+ )}
</header>
<div className="flex-1 overflow-y-auto px-5 py-4">
<BlockConfigForm blockId={selectedBlockId} />
@@ -307,6 +396,7 @@ function BlockConfigSidebar({
embedded = false,
}: BlockConfigSidebarProps) {
const resizableRef = useRef<Resizable | null>(null);
+ const reactFlowInstance = useReactFlow<AppNode>();
const [editorShellMetrics, setEditorShellMetrics] = useState(() => ({
gutterPx: getBlockSidebarGutterPx(null),
width: null as number | null,
@@ -328,6 +418,12 @@ function BlockConfigSidebar({
(state) => state.closeWorkflowPanel,
);
const flushPendingCommit = usePendingCommitsStore((state) => state.flush);
+ const studioSettingsCollapsed = useStudioShellStore(
+ (state) => state.settingsCollapsed,
+ );
+ const setStudioSettingsCollapsed = useStudioShellStore(
+ (state) => state.setSettingsCollapsed,
+ );
const containedWidth = getContainedBlockSidebarWidth(
width,
editorShellMetrics.width,
@@ -363,6 +459,21 @@ function BlockConfigSidebar({
const sidebarVisible =
showLibrary || (mode !== "build" && selectedBlockId !== null);
+ // In the studio shell every settings panel (agent settings + each block) is
+ // collapsible to a rail; the block-library drawer is not.
+ const selectedNode =
+ !showLibrary && selectedBlockId !== null
+ ? (reactFlowInstance.getNode(selectedBlockId) ?? null)
+ : null;
+ const isCollapsibleSettings = embedded && selectedNode !== null;
+ const settingsCollapsed = isCollapsibleSettings && studioSettingsCollapsed;
+ const selectedIdentity = getSidebarIdentity(selectedNode);
+
+ // Transition stays on so the toggle always animates (like Copilot); dropped
+ // mid-drag, where the live width is tracked so the body follows the handle.
+ const [isResizing, setIsResizing] = useState(false);
+ const [resizingWidth, setResizingWidth] = useState<number | null>(null);
+
useLayoutEffect(() => {
if (!sidebarVisible) {
setEditorShellMetrics({
@@ -407,15 +518,17 @@ function BlockConfigSidebar({
return () => {
resizeObserver.disconnect();
};
- }, [sidebarVisible]);
+ // Re-measure on collapse toggle: the shell width changes, so the contained
+ // width bounds need refreshing.
+ }, [sidebarVisible, settingsCollapsed]);
useLayoutEffect(() => {
if (!sidebarVisible) {
return;
}
- setRenderedWidth(containedWidth);
- }, [containedWidth, setRenderedWidth, sidebarVisible]);
+ setRenderedWidth(settingsCollapsed ? SETTINGS_RAIL_WIDTH : containedWidth);
+ }, [settingsCollapsed, containedWidth, setRenderedWidth, sidebarVisible]);
// In build mode the block-config form is unavailable, but the node library
// must still render so users can insert blocks from the canvas.
@@ -427,15 +540,30 @@ function BlockConfigSidebar({
return null;
}
+ // Fixed body width tracks the live handle while resizing, the stored width
+ // otherwise — never the rail width, so the clipping shell never reflows it.
+ const bodyWidth =
+ isResizing && resizingWidth !== null ? resizingWidth : containedWidth;
+
return (
<Resizable
ref={resizableRef}
- size={{ width: containedWidth, height: "auto" }}
- minWidth={containedMinWidth}
+ size={{
+ width:
+ embedded && settingsCollapsed ? SETTINGS_RAIL_WIDTH : containedWidth,
+ height: "auto",
+ }}
+ minWidth={
+ embedded && settingsCollapsed ? SETTINGS_RAIL_WIDTH : containedMinWidth
+ }
maxWidth={containedMaxWidth}
- enable={{ left: true }}
+ enable={{ left: !(embedded && settingsCollapsed) }}
+ onResizeStart={() => setIsResizing(true)}
+ onResize={(_e, _dir, ref) => setResizingWidth(ref.offsetWidth)}
onResizeStop={(_e, _dir, ref) => {
setWidth(ref.offsetWidth);
+ setIsResizing(false);
+ setResizingWidth(null);
}}
handleClasses={{ left: "block-sidebar-resize-handle" }}
handleStyles={{
@@ -448,33 +576,74 @@ function BlockConfigSidebar({
style={{
position: "absolute",
top: embedded ? "0.75rem" : mode === "build" ? "7rem" : "2rem",
- right: "1.5rem",
+ // Embedded mirrors the Copilot column's uniform py-3/pl-3 (0.75rem)
+ // inset; legacy keeps its wider 1.5rem gutter.
+ right: embedded ? "0.75rem" : "1.5rem",
bottom: embedded ? "0.75rem" : "1.5rem",
+ // Copilot's open/collapse curve, always on so the toggle animates with
+ // no snap; dropped mid-drag so a resize tracks the handle 1:1.
+ transition:
+ embedded && !isResizing
+ ? `width ${STUDIO_COPILOT_TRANSITION_MS}ms ${
+ settingsCollapsed
+ ? STUDIO_COPILOT_COLLAPSE_EASE
+ : STUDIO_COPILOT_TRANSITION_EASE
+ }`
+ : undefined,
}}
- className={cn(
- "z-30 flex flex-col",
- "rounded-xl border border-border bg-slate-elevation2 shadow-xl",
- )}
+ className="z-30"
>
- <aside
- data-testid="block-config-sidebar"
+ <div
className={cn(
- "flex h-full w-full flex-col",
- "duration-200 ease-out animate-in slide-in-from-right-5",
+ "relative h-full w-full overflow-hidden",
+ "rounded-xl border border-border bg-slate-elevation2 shadow-xl",
)}
>
- {showLibrary ? (
- <BlockLibrarySidebarBody
- onAddNode={(props) => onAddNode?.(props)}
- onClose={closeWorkflowPanel}
- />
- ) : selectedBlockId !== null ? (
- <BlockConfigSidebarBody
- selectedBlockId={selectedBlockId}
- onClose={() => setSelectedBlockId(null)}
+ <aside
+ data-testid="block-config-sidebar"
+ style={
+ embedded
+ ? {
+ position: "absolute",
+ inset: 0,
+ left: "auto",
+ width: bodyWidth,
+ }
+ : undefined
+ }
+ className={cn(
+ "flex h-full flex-col",
+ // Collapsed: the rail covers it; disable the clipped strip.
+ embedded && settingsCollapsed && "pointer-events-none",
+ !embedded &&
+ "w-full duration-200 ease-out animate-in slide-in-from-right-5",
+ )}
+ >
+ {showLibrary ? (
+ <BlockLibrarySidebarBody
+ onAddNode={(props) => onAddNode?.(props)}
+ onClose={closeWorkflowPanel}
+ />
+ ) : selectedBlockId !== null ? (
+ <BlockConfigSidebarBody
+ selectedBlockId={selectedBlockId}
+ identity={selectedIdentity}
+ onClose={() => setSelectedBlockId(null)}
+ onCollapse={
+ isCollapsibleSettings
+ ? () => setStudioSettingsCollapsed(true)
+ : undefined
+ }
+ />
+ ) : null}
+ </aside>
+ {embedded && settingsCollapsed ? (
+ <SettingsRail
+ identity={selectedIdentity}
+ onExpand={() => setStudioSettingsCollapsed(false)}
/>
) : null}
- </aside>
+ </div>
</Resizable>
);
}
diff --git a/skyvern-frontend/src/store/StudioShellStore.ts b/skyvern-frontend/src/store/StudioShellStore.ts
index bf846dd1e..d78a522cc 100644
--- a/skyvern-frontend/src/store/StudioShellStore.ts
+++ b/skyvern-frontend/src/store/StudioShellStore.ts
@@ -6,10 +6,12 @@ export type StudioTab = "editor" | "browser" | "run";
type StudioShellState = {
tab: StudioTab;
copilotCollapsed: boolean;
+ settingsCollapsed: boolean;
pipMinimized: boolean;
setTab: (tab: StudioTab) => void;
setCopilotCollapsed: (collapsed: boolean) => void;
toggleCopilot: () => void;
+ setSettingsCollapsed: (collapsed: boolean) => void;
setPipMinimized: (minimized: boolean) => void;
togglePip: () => void;
reset: () => void;
@@ -18,6 +20,7 @@ type StudioShellState = {
const DEFAULTS = {
tab: "editor" as StudioTab,
copilotCollapsed: false,
+ settingsCollapsed: true,
pipMinimized: false,
};
@@ -31,6 +34,7 @@ export const useStudioShellStore = create<StudioShellState>()(
setCopilotCollapsed: (copilotCollapsed) => set({ copilotCollapsed }),
toggleCopilot: () =>
set((state) => ({ copilotCollapsed: !state.copilotCollapsed })),
+ setSettingsCollapsed: (settingsCollapsed) => set({ settingsCollapsed }),
setPipMinimized: (pipMinimized) => set({ pipMinimized }),
togglePip: () => set((state) => ({ pipMinimized: !state.pipMinimized })),
reset: () => set(DEFAULTS),
@@ -39,7 +43,9 @@ export const useStudioShellStore = create<StudioShellState>()(
name: STUDIO_SHELL_STORAGE_KEY,
storage: createJSONStorage(() => localStorage),
// `tab` is intentionally not persisted: the Run tab is gated on hasRun,
- // so each session starts on the editor.
+ // so each session starts on the editor. `settingsCollapsed` is also not
+ // persisted: the settings panel must start collapsed on every open, and
+ // clicking a block auto-expands it within the session.
partialize: (state) => ({
copilotCollapsed: state.copilotCollapsed,
pipMinimized: state.pipMinimized,