-
-
-
+ {block.type !== 'note' && (
+
+
+
+ )}
{block.name || blockConfig.name}
diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-workflow/components/block/block.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-workflow/components/block/block.tsx
index ca0c3ed5d..a484f15ce 100644
--- a/apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-workflow/components/block/block.tsx
+++ b/apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-workflow/components/block/block.tsx
@@ -411,8 +411,9 @@ function WorkflowPreviewBlockInner({ data }: NodeProps
const IconComponent = blockConfig.icon
const isStarterOrTrigger = blockConfig.category === 'triggers' || type === 'starter' || isTrigger
+ const isNoteBlock = type === 'note'
- const shouldShowDefaultHandles = !isStarterOrTrigger
+ const shouldShowDefaultHandles = !isStarterOrTrigger && !isNoteBlock
const hasSubBlocks = visibleSubBlocks.length > 0
const hasContentBelowHeader =
type === 'condition'
@@ -574,8 +575,8 @@ function WorkflowPreviewBlockInner({ data }: NodeProps
>
)}
- {/* Source and error handles for non-condition/router blocks */}
- {type !== 'condition' && type !== 'router_v2' && type !== 'response' && (
+ {/* Source and error handles for non-condition/router/note blocks */}
+ {type !== 'condition' && type !== 'router_v2' && type !== 'response' && !isNoteBlock && (
<>
let inString = false
for (let j = 0; j < line.length; j++) {
const char = line[j]
- const prevChar = j > 0 ? line[j - 1] : ''
// Toggle string state on unescaped quotes
- if (char === '"' && prevChar !== '\\') {
- inString = !inString
+ // Must count consecutive backslashes: odd = escaped quote, even = unescaped quote
+ if (char === '"') {
+ let backslashCount = 0
+ let k = j - 1
+ while (k >= 0 && line[k] === '\\') {
+ backslashCount++
+ k--
+ }
+ // Only toggle if quote is not escaped (even number of preceding backslashes)
+ if (backslashCount % 2 === 0) {
+ inString = !inString
+ }
continue
}
diff --git a/apps/sim/stores/terminal/store.ts b/apps/sim/stores/terminal/store.ts
index faf42d25d..6d8ea91c9 100644
--- a/apps/sim/stores/terminal/store.ts
+++ b/apps/sim/stores/terminal/store.ts
@@ -69,6 +69,15 @@ export const useTerminalStore = create()(
setWrapText: (wrap) => {
set({ wrapText: wrap })
},
+ structuredView: true,
+ /**
+ * Enables or disables structured view mode in the output panel.
+ *
+ * @param structured - Whether output should be displayed as nested blocks.
+ */
+ setStructuredView: (structured) => {
+ set({ structuredView: structured })
+ },
/**
* Indicates whether the terminal store has finished client-side hydration.
*/
diff --git a/apps/sim/stores/terminal/types.ts b/apps/sim/stores/terminal/types.ts
index 8cc3fc307..a50196102 100644
--- a/apps/sim/stores/terminal/types.ts
+++ b/apps/sim/stores/terminal/types.ts
@@ -19,6 +19,8 @@ export interface TerminalState {
setOpenOnRun: (open: boolean) => void
wrapText: boolean
setWrapText: (wrap: boolean) => void
+ structuredView: boolean
+ setStructuredView: (structured: boolean) => void
/**
* Indicates whether the terminal is currently being resized via mouse drag.
*