From c3ef98d34b014de109585053bd3623cad4f728d2 Mon Sep 17 00:00:00 2001 From: Emir Karabeg Date: Thu, 15 Jan 2026 18:29:34 -0800 Subject: [PATCH 1/3] improvement(panel): increased default width --- apps/sim/app/_styles/globals.css | 2 +- apps/sim/stores/constants.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/sim/app/_styles/globals.css b/apps/sim/app/_styles/globals.css index c260032460..d25481199e 100644 --- a/apps/sim/app/_styles/globals.css +++ b/apps/sim/app/_styles/globals.css @@ -11,7 +11,7 @@ */ :root { --sidebar-width: 232px; /* SIDEBAR_WIDTH.DEFAULT */ - --panel-width: 290px; /* PANEL_WIDTH.DEFAULT */ + --panel-width: 320px; /* PANEL_WIDTH.DEFAULT */ --toolbar-triggers-height: 300px; /* TOOLBAR_TRIGGERS_HEIGHT.DEFAULT */ --editor-connections-height: 172px; /* EDITOR_CONNECTIONS_HEIGHT.DEFAULT */ --terminal-height: 155px; /* TERMINAL_HEIGHT.DEFAULT */ diff --git a/apps/sim/stores/constants.ts b/apps/sim/stores/constants.ts index a316e85535..d2eb2bfd3b 100644 --- a/apps/sim/stores/constants.ts +++ b/apps/sim/stores/constants.ts @@ -28,7 +28,7 @@ export const SIDEBAR_WIDTH = { /** Right panel width constraints */ export const PANEL_WIDTH = { - DEFAULT: 290, + DEFAULT: 320, MIN: 290, /** Maximum is 40% of viewport, enforced dynamically */ MAX_PERCENTAGE: 0.4, From cbe63a3597e9ed2cdbf4b5e5b5be595a6da0849f Mon Sep 17 00:00:00 2001 From: Emir Karabeg Date: Thu, 15 Jan 2026 20:19:01 -0800 Subject: [PATCH 2/3] improvement: subblocks --- apps/sim/app/_styles/globals.css | 26 --- .../sub-block/components/code/code.tsx | 15 +- .../condition-input/condition-input.tsx | 46 +++++ .../document-tag-entry/document-tag-entry.tsx | 1 + .../components/eval-input/eval-input.tsx | 1 + .../input-mapping/input-mapping.tsx | 1 + .../knowledge-tag-filters.tsx | 1 + .../components/long-input/long-input.tsx | 25 ++- .../mcp-dynamic-args/mcp-dynamic-args.tsx | 18 +- .../messages-input/messages-input.tsx | 172 +++++++++++++++++- .../components/short-input/short-input.tsx | 23 ++- .../components/starter/input-format.tsx | 2 + .../components/sub-block-input-controller.tsx | 14 +- .../sub-block/components/table/table.tsx | 1 + .../components/tag-dropdown/tag-dropdown.tsx | 25 ++- .../variables-input/variables-input.tsx | 19 ++ .../sub-block/hooks/use-sub-block-input.ts | 69 +++++-- .../editor/components/sub-block/sub-block.tsx | 113 +++++------- .../panel/components/editor/editor.tsx | 2 +- apps/sim/blocks/blocks/agent.ts | 37 +++- apps/sim/blocks/blocks/response.ts | 2 +- .../components/emcn/components/code/code.tsx | 13 +- apps/sim/tailwind.config.ts | 9 - 23 files changed, 482 insertions(+), 153 deletions(-) diff --git a/apps/sim/app/_styles/globals.css b/apps/sim/app/_styles/globals.css index d25481199e..6552bdb4f8 100644 --- a/apps/sim/app/_styles/globals.css +++ b/apps/sim/app/_styles/globals.css @@ -576,32 +576,6 @@ input[type="search"]::-ms-clear { transition-duration: 300ms; } - .streaming-effect { - @apply relative overflow-hidden; - } - - .streaming-effect::after { - content: ""; - @apply pointer-events-none absolute left-0 top-0 h-full w-full; - background: linear-gradient( - 90deg, - rgba(128, 128, 128, 0) 0%, - rgba(128, 128, 128, 0.1) 50%, - rgba(128, 128, 128, 0) 100% - ); - animation: code-shimmer 1.5s infinite; - z-index: 10; - } - - .dark .streaming-effect::after { - background: linear-gradient( - 90deg, - rgba(180, 180, 180, 0) 0%, - rgba(180, 180, 180, 0.1) 50%, - rgba(180, 180, 180, 0) 100% - ); - } - .loading-placeholder::placeholder { animation: placeholder-pulse 1.5s ease-in-out infinite; } diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/code/code.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/code/code.tsx index 38d94b92bd..f778c9c4aa 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/code/code.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/code/code.tsx @@ -336,6 +336,10 @@ export function Code({ setCode('') } + handleStreamChunkRef.current = (chunk: string) => { + setCode((prev) => prev + chunk) + } + handleGeneratedContentRef.current = (generatedCode: string) => { setCode(generatedCode) if (!isPreview && !disabled) { @@ -691,11 +695,7 @@ export function Code({ /> )} - e.preventDefault()} - onDrop={handleDrop} - isStreaming={isAiStreaming} - > + e.preventDefault()} onDrop={handleDrop}>
{wandConfig?.enabled && !isAiStreaming && @@ -761,6 +761,11 @@ export function Code({ }} onFocus={() => { hasEditedSinceFocusRef.current = false + // Show tag dropdown on focus when code is empty + if (!isPreview && !disabled && !readOnly && code.trim() === '') { + setShowTags(true) + setCursorPosition(0) + } }} highlight={createHighlightFunction(effectiveLanguage, shouldHighlightReference)} {...getCodeEditorProps({ isStreaming: isAiStreaming, isPreview, disabled })} diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/condition-input/condition-input.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/condition-input/condition-input.tsx index 27232889b6..b37e6ecba1 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/condition-input/condition-input.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/condition-input/condition-input.tsx @@ -115,6 +115,7 @@ export function ConditionInput({ const accessiblePrefixes = useAccessibleReferencePrefixes(blockId) const containerRef = useRef(null) + const inputRefs = useRef>(new Map()) /** * Determines if a reference string should be highlighted in the editor. @@ -728,6 +729,20 @@ export function ConditionInput({ }) }, [conditionalBlocks.length]) + // Capture textarea refs from Editor components (condition mode) + useEffect(() => { + if (!isRouterMode && containerRef.current) { + conditionalBlocks.forEach((block) => { + const textarea = containerRef.current?.querySelector( + `[data-block-id="${block.id}"] textarea` + ) as HTMLTextAreaElement | null + if (textarea) { + inputRefs.current.set(block.id, textarea) + } + }) + } + }, [conditionalBlocks, isRouterMode]) + // Show loading or empty state if not ready or no blocks if (!isReady || conditionalBlocks.length === 0) { return ( @@ -842,6 +857,9 @@ export function ConditionInput({ onDrop={(e) => handleDrop(block.id, e)} >