Skip to content

Commit 793e483

Browse files
committed
refactor(renderer): drop the isWorkflowRunning prop the views never read
Removing only the unused binding and keeping the prop was half a fix. The views declared it, the app passed it, and nothing read it — so the prop was dead, and dead code does not become live by being documented. Its TSDoc claimed it "holds every block's action swell open". That behavior does not exist in either view. Keeping the prop on the chance someone wants it later is the speculative-generality smell: if the toolbar should pin open during a run, that gets implemented deliberately and the prop comes back with logic behind it. Removed from both view interfaces and from both call sites. The store subscription stays — `workflow-block.tsx` and `subflow-node.tsx` each passed the same value twice, once to the dead view prop and once to `ActionBar`, which has 28 real reads and is what the surrounding TSDoc is actually describing when it says the flag "only swaps Run for Stop and disables mutations". `workflow-edge-view` uses it too and is untouched. The renderer test that passed it loses the argument. Worth noting it set the flag to stage a workflow run, and since the view ignored it those two cases were never exercising the run state they name.
1 parent 04380b7 commit 793e483

5 files changed

Lines changed: 3 additions & 25 deletions

File tree

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/subflows/subflow-node.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ export const SubflowNodeComponent = memo(({ data, id, selected }: NodeProps<Subf
7575
isLocked={isLocked}
7676
isFocused={isFocused}
7777
isRunning={isRunning}
78-
isWorkflowRunning={isWorkflowRunning}
7978
isExecutionHighlighted={isExecutionHighlighted}
8079
diffStatus={diffStatus}
8180
nestingLevel={nestingLevel}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,6 @@ export const WorkflowBlock = memo(function WorkflowBlock({
12401240
ringStyles={ringStyles}
12411241
runPathStatus={runPathStatus}
12421242
isRunning={isExecuting}
1243-
isWorkflowRunning={isWorkflowRunning}
12441243
isExecutionHighlighted={isExecutionHighlighted}
12451244
Icon={config.icon}
12461245
iconBgColor={config.bgColor}

packages/workflow-renderer/src/subflow/subflow-node-view.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,6 @@ export interface SubflowNodeViewProps {
6565
isFocused: boolean
6666
/** Whether execution controls are active for this subflow. */
6767
isRunning?: boolean
68-
/**
69-
* Whether the parent workflow is executing.
70-
*
71-
* Accepted and currently unread: `subflow-node.tsx` supplies it and nothing
72-
* below consults it, so the hold-open behavior this once claimed is not
73-
* implemented. Kept in the interface because the caller passes it — wire it up
74-
* or stop passing it, but do not read this as working today.
75-
*/
76-
isWorkflowRunning?: boolean
7768
/** Whether this subflow participates in the current execution handoff. */
7869
isExecutionHighlighted?: boolean
7970
/** Diff state when comparing workflow versions. */

packages/workflow-renderer/src/workflow-block/workflow-block-view-interaction.test.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ function createView(
2525
isRunning: boolean,
2626
isEnabled = true,
2727
isLocked = false,
28-
isExecutionHighlighted = false,
29-
isWorkflowRunning = false
28+
isExecutionHighlighted = false
3029
) {
3130
return (
3231
<ReactFlowProvider>
@@ -39,7 +38,6 @@ function createView(
3938
hasRing={false}
4039
ringStyles=''
4140
isRunning={isRunning}
42-
isWorkflowRunning={isWorkflowRunning}
4341
isExecutionHighlighted={isExecutionHighlighted}
4442
Icon={TestIcon}
4543
iconBgColor='var(--surface-2)'
@@ -130,7 +128,7 @@ describe('WorkflowBlockView action menu', () => {
130128
mountedRoots.add(root)
131129
mountedHosts.add(host)
132130

133-
act(() => root.render(createView(false, true, false, false, true)))
131+
act(() => root.render(createView(false, true, false, false)))
134132
flushAnimationFrames()
135133

136134
const actionMenuRoot = host.querySelector<HTMLElement>('.group.relative')
@@ -149,7 +147,7 @@ describe('WorkflowBlockView action menu', () => {
149147
mountedRoots.add(root)
150148
mountedHosts.add(host)
151149

152-
act(() => root.render(createView(false, true, false, true, true)))
150+
act(() => root.render(createView(false, true, false, true)))
153151
flushAnimationFrames()
154152

155153
const actionMenuRoot = host.querySelector<HTMLElement>('.group.relative')

packages/workflow-renderer/src/workflow-block/workflow-block-view.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -393,15 +393,6 @@ export interface WorkflowBlockViewProps {
393393
runPathStatus?: BlockRunStatus
394394
/** Whether execution controls are active for this block. */
395395
isRunning?: boolean
396-
/**
397-
* Whether the parent workflow is executing.
398-
*
399-
* Accepted and currently unread: `workflow-block.tsx` supplies it and nothing
400-
* below consults it, so the hold-open behavior this once claimed is not
401-
* implemented. Kept in the interface because the caller passes it — wire it up
402-
* or stop passing it, but do not read this as working today.
403-
*/
404-
isWorkflowRunning?: boolean
405396
/** Whether this block participates in the current execution handoff. */
406397
isExecutionHighlighted?: boolean
407398
/** Block icon component and its background color. */

0 commit comments

Comments
 (0)