Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
fix(workflow-studio): bind Block Library search panel to drawer width (SKY-11494) (#6855)
Aaron Perez8ef76850e667
diff --git a/skyvern-frontend/src/routes/workflows/WorkflowsTree.tsx b/skyvern-frontend/src/routes/workflows/WorkflowsTree.tsxindex 80dbb5d45..fd335f6cb 100644--- a/skyvern-frontend/src/routes/workflows/WorkflowsTree.tsx+++ b/skyvern-frontend/src/routes/workflows/WorkflowsTree.tsx@@ -90,6 +90,8 @@ import { useParameterExpansion } from "./hooks/useParameterExpansion";import { Folder } from "./types/folderTypes";import { getUniqueSlugForFolder } from "@/util/folderSlug";import { defaultWorkflowRequest } from "./defaultWorkflowRequest";+import { useFeatureFlag } from "@/hooks/useFeatureFlag";+import { WORKFLOW_TAGGING_FLAG } from "@/util/featureFlags";const FOLDERS_PAGE_SIZE = 25;const AGENTS_PAGE_SIZE = 20;@@ -122,7 +124,12 @@ function WorkflowsTree() {() => parseTagFilter(tagFilterParam),[tagFilterParam],);- const serializedTagFilter = serializeTagFilter(tagFilters);+ // undefined (OSS / pre-load) shows tagging; only an explicit cloud `false` hides it.+ const taggingEnabled = useFeatureFlag(WORKFLOW_TAGGING_FLAG) !== false;+ // While tagging is hidden, ignore stale `?tags=` so the backend list isn't tag-filtered.+ const serializedTagFilter = taggingEnabled+ ? serializeTagFilter(tagFilters)+ : "";const setTagFilters = useCallback((terms: TagFilterTerm[]) => {@@ -363,7 +370,7 @@ function WorkflowsTree() {const onboarding = useOnboardingStateOptional();// Tag-key registry: supplies chip-hover descriptions and the filter's key list.- const { data: tagKeys = [] } = useTagKeysQuery();+ const { data: tagKeys = [] } = useTagKeysQuery({ enabled: taggingEnabled });const tagDescriptions = useMemo(() =>new Map(@@ -374,7 +381,7 @@ function WorkflowsTree() {),[tagKeys],);- const { data: tagColors } = useTagValuesQuery();+ const { data: tagColors } = useTagValuesQuery({ enabled: taggingEnabled });// One batch fetch of current tags for every workflow on screen (no N+1) -// the main page list plus the contents of every expanded folder.@@ -390,7 +397,12 @@ function WorkflowsTree() {}return Array.from(ids);}, [workflows, folderContents]);- const { data: workflowTagsMap = {} } = useWorkflowTagsBatchQuery(workflowIds);+ const { data: workflowTagsMap = {} } = useWorkflowTagsBatchQuery(+ workflowIds,+ {+ enabled: taggingEnabled,+ },+ );// Tags observed on the page for editor/filter suggestions: grouped values per// key plus standalone labels. Maps avoid prototype-key collisions.@@ -920,14 +932,16 @@ function WorkflowsTree() {placeholder="Search by title or input..."className="w-48 lg:w-72"/>- <WorkflowTagFilter- tagKeys={tagKeys}- value={tagFilters}- onChange={setTagFilters}- labelSuggestions={labelSuggestions}- valueSuggestionsByKey={valueSuggestionsByKey}- colors={tagColors}- />+ {taggingEnabled ? (+ <WorkflowTagFilter+ tagKeys={tagKeys}+ value={tagFilters}+ onChange={setTagFilters}+ labelSuggestions={labelSuggestions}+ valueSuggestionsByKey={valueSuggestionsByKey}+ colors={tagColors}+ />+ ) : null}</div><div className="flex items-center gap-4"><Link@@ -1031,6 +1045,7 @@ function WorkflowsTree() {tagKeys={tagKeys}labelSuggestions={labelSuggestions}valueSuggestionsByKey={valueSuggestionsByKey}+ taggingEnabled={taggingEnabled}/>)}diff --git a/skyvern-frontend/src/routes/workflows/components/tree/WorkflowRow.tagging.test.tsx b/skyvern-frontend/src/routes/workflows/components/tree/WorkflowRow.tagging.test.tsxnew file mode 100644index 000000000..2f70e7b56--- /dev/null+++ b/skyvern-frontend/src/routes/workflows/components/tree/WorkflowRow.tagging.test.tsx@@ -0,0 +1,97 @@+// @vitest-environment jsdom++import { cleanup, render, screen } from "@testing-library/react";+import { afterEach, describe, expect, it, vi } from "vitest";++import { FeatureFlagContext } from "@/hooks/useFeatureFlag";+import type { WorkflowApiResponse } from "../../types/workflowTypes";+import { WorkflowRow } from "./WorkflowRow";+import {+ WorkflowsListContext,+ type WorkflowsListContextValue,+} from "./WorkflowsListContext";++// Isolate WorkflowRow's gating: stub the tagging children (and the unrelated+// row actions) so the assertions only reflect whether the row chose to render+// tagging UI, not the children's own internals.+vi.mock("../tagging/TagChipList", () => ({+ TagChipList: () => <span data-testid="tag-chip-list" />,+}));+vi.mock("../tagging/WorkflowTagEditor", () => ({+ WorkflowTagEditor: () => <span data-testid="workflow-tag-editor" />,+}));+vi.mock("../WorkflowFolderSelector", () => ({+ WorkflowFolderSelector: () => <span data-testid="folder-selector" />,+}));+vi.mock("../../WorkflowActions", () => ({+ WorkflowActions: () => <span data-testid="workflow-actions" />,+}));+vi.mock("@/hooks/useWorkflowStudioEnabled", () => ({+ useWorkflowStudioEnabled: () => false,+}));++function buildWorkflow(): WorkflowApiResponse {+ return {+ workflow_permanent_id: "wpid_1",+ title: "Scrape leads",+ created_at: "2026-01-01T00:00:00Z",+ workflow_definition: { parameters: [] },+ } as unknown as WorkflowApiResponse;+}++const contextValue: WorkflowsListContextValue = {+ showCheckbox: false,+ columnCount: 5,+ debouncedSearch: "",+ isBulkOperating: false,+ selectedCount: 0,+ foldersMap: new Map(),+ workflowTagsMap: { wpid_1: [{ key: "env", value: "prod" }] },+ tagDescriptions: new Map(),+ tagColors: new Map(),+ tagKeys: [],+ labelSuggestions: [],+ valueSuggestionsByKey: new Map(),+ isSelected: () => false,+ indexById: new Map(),+ handleSelect: () => {},+ expandedRows: new Set(),+ toggleParametersExpanded: () => {},+ matchesParameter: () => false,+ handleRowClick: () => {},+ handleIconClick: () => {},+};++function renderRow(flagValue: boolean | undefined) {+ return render(+ <FeatureFlagContext.Provider value={() => flagValue}>+ <WorkflowsListContext.Provider value={contextValue}>+ <table>+ <tbody>+ <WorkflowRow workflow={buildWorkflow()} />+ </tbody>+ </table>+ </WorkflowsListContext.Provider>+ </FeatureFlagContext.Provider>,+ );+}++describe("WorkflowRow tagging gate", () => {+ afterEach(() => {+ cleanup();+ });++ it("hides tag chips and the tag editor when WORKFLOW_TAGGING is off", () => {+ renderRow(false);++ expect(screen.queryByTestId("tag-chip-list")).toBeNull();+ expect(screen.queryByTestId("workflow-tag-editor")).toBeNull();+ });++ it("shows tag chips and the tag editor when the flag is unresolved (default on)", () => {+ renderRow(undefined);++ expect(screen.getByTestId("tag-chip-list")).toBeTruthy();+ expect(screen.getByTestId("workflow-tag-editor")).toBeTruthy();+ });+});diff --git a/skyvern-frontend/src/routes/workflows/components/tree/WorkflowRow.tsx b/skyvern-frontend/src/routes/workflows/components/tree/WorkflowRow.tsxindex f9cd4ded5..8247169f3 100644--- a/skyvern-frontend/src/routes/workflows/components/tree/WorkflowRow.tsx+++ b/skyvern-frontend/src/routes/workflows/components/tree/WorkflowRow.tsx@@ -20,6 +20,8 @@ import { basicTimeFormat, compactLocalDateTime } from "@/util/timeFormat";import { WorkflowApiResponse } from "../../types/workflowTypes";import { WorkflowActions } from "../../WorkflowActions";import { useWorkflowStudioEnabled } from "@/hooks/useWorkflowStudioEnabled";+import { useFeatureFlag } from "@/hooks/useFeatureFlag";+import { WORKFLOW_TAGGING_FLAG } from "@/util/featureFlags";import { workflowEditorPath } from "../../studioNavigation";import { HighlightText } from "../HighlightText";import { ParameterDisplayInline } from "../ParameterDisplayInline";@@ -72,6 +74,8 @@ function WorkflowRow({ workflow, depth = 0 }: WorkflowRowProps) {handleIconClick,} = useWorkflowsListContext();const studioEnabled = useWorkflowStudioEnabled();+ // undefined (OSS / pre-load) shows tagging; only an explicit cloud `false` hides it.+ const taggingEnabled = useFeatureFlag(WORKFLOW_TAGGING_FLAG) !== false;const parameterItems = (workflow.workflow_definition?.parameters ?? []).filter((p) => p.parameter_type !== "output")@@ -186,7 +190,7 @@ function WorkflowRow({ workflow, depth = 0 }: WorkflowRowProps) {</TooltipProvider>)}</div>- {workflowTags && workflowTags.length > 0 ? (+ {taggingEnabled && workflowTags && workflowTags.length > 0 ? (<TagChipListtags={workflowTags}descriptions={tagDescriptions}@@ -251,14 +255,16 @@ function WorkflowRow({ workflow, depth = 0 }: WorkflowRowProps) {<TooltipContent>Assign to Folder</TooltipContent></Tooltip></TooltipProvider>- <WorkflowTagEditor- workflowPermanentId={workflow.workflow_permanent_id}- tags={workflowTags ?? []}- tagKeys={tagKeys}- labelSuggestions={labelSuggestions}- valueSuggestionsByKey={valueSuggestionsByKey}- colorMap={tagColors}- />+ {taggingEnabled ? (+ <WorkflowTagEditor+ workflowPermanentId={workflow.workflow_permanent_id}+ tags={workflowTags ?? []}+ tagKeys={tagKeys}+ labelSuggestions={labelSuggestions}+ valueSuggestionsByKey={valueSuggestionsByKey}+ colorMap={tagColors}+ />+ ) : null}</>)}<TooltipProvider>diff --git a/skyvern-frontend/src/routes/workflows/editor/panels/BlockConfigSidebar.test.tsx b/skyvern-frontend/src/routes/workflows/editor/panels/BlockConfigSidebar.test.tsxindex afd464050..4432adb0e 100644--- a/skyvern-frontend/src/routes/workflows/editor/panels/BlockConfigSidebar.test.tsx+++ b/skyvern-frontend/src/routes/workflows/editor/panels/BlockConfigSidebar.test.tsx@@ -359,6 +359,32 @@ describe("BlockConfigSidebar block library layout (contained drawer)", () => {expect(title.parentElement?.className).toContain("min-w-0");expect(title.className).toContain("min-w-0");});++ test("binds the search panel width to the drawer so it does not shrink to its content (SKY-11494)", () => {+ // The search input + results column live in a flex *row* parent, so without+ // w-full the panel sizes to its widest child — it shrinks as the query+ // narrows (e.g. "No results found") and leaves dead space when the drawer+ // widens. w-full ties it to the panel width instead.+ act(() => {+ useWorkflowPanelStore.getState().setWorkflowPanelState({+ active: true,+ content: "nodeLibrary",+ });+ });++ render(+ <MemoryRouter initialEntries={["/workflows/wpid_abc/edit"]}>+ <BlockConfigSidebar />+ </MemoryRouter>,+ );++ const panel = screen+ .getByPlaceholderText("Search blocks...")+ .closest(".flex-col");++ expect(panel).not.toBeNull();+ expect(panel?.className).toContain("w-full");+ });});describe("BlockConfigSidebar block title editing (SKY-10255)", () => {diff --git a/skyvern-frontend/src/routes/workflows/editor/panels/WorkflowNodeLibraryPanel.tsx b/skyvern-frontend/src/routes/workflows/editor/panels/WorkflowNodeLibraryPanel.tsxindex 0a5303eba..53b49680a 100644--- a/skyvern-frontend/src/routes/workflows/editor/panels/WorkflowNodeLibraryPanel.tsx+++ b/skyvern-frontend/src/routes/workflows/editor/panels/WorkflowNodeLibraryPanel.tsx@@ -373,7 +373,7 @@ function WorkflowNodeLibraryPanel({ onNodeClick }: Props) {});return (- <div className="flex h-full min-h-0 min-w-0 flex-col gap-4">+ <div className="flex h-full min-h-0 w-full min-w-0 flex-col gap-4"><div className="relative"><div className="absolute left-0 top-0 flex size-9 items-center justify-center"><MagnifyingGlassIcon className="size-5" />