mirror of
https://github.com/simstudioai/sim.git
synced 2026-08-30 17:05:18 +08:00
refactor(renderer): drop the isWorkflowRunning prop the views never read (#7040)
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.
This commit is contained in:
-1
@@ -75,7 +75,6 @@ export const SubflowNodeComponent = memo(({ data, id, selected }: NodeProps<Subf
|
||||
isLocked={isLocked}
|
||||
isFocused={isFocused}
|
||||
isRunning={isRunning}
|
||||
isWorkflowRunning={isWorkflowRunning}
|
||||
isExecutionHighlighted={isExecutionHighlighted}
|
||||
diffStatus={diffStatus}
|
||||
nestingLevel={nestingLevel}
|
||||
|
||||
-1
@@ -1240,7 +1240,6 @@ export const WorkflowBlock = memo(function WorkflowBlock({
|
||||
ringStyles={ringStyles}
|
||||
runPathStatus={runPathStatus}
|
||||
isRunning={isExecuting}
|
||||
isWorkflowRunning={isWorkflowRunning}
|
||||
isExecutionHighlighted={isExecutionHighlighted}
|
||||
Icon={config.icon}
|
||||
iconBgColor={config.bgColor}
|
||||
|
||||
@@ -65,15 +65,6 @@ export interface SubflowNodeViewProps {
|
||||
isFocused: boolean
|
||||
/** Whether execution controls are active for this subflow. */
|
||||
isRunning?: boolean
|
||||
/**
|
||||
* Whether the parent workflow is executing.
|
||||
*
|
||||
* Accepted and currently unread: `subflow-node.tsx` supplies it and nothing
|
||||
* below consults it, so the hold-open behavior this once claimed is not
|
||||
* implemented. Kept in the interface because the caller passes it — wire it up
|
||||
* or stop passing it, but do not read this as working today.
|
||||
*/
|
||||
isWorkflowRunning?: boolean
|
||||
/** Whether this subflow participates in the current execution handoff. */
|
||||
isExecutionHighlighted?: boolean
|
||||
/** Diff state when comparing workflow versions. */
|
||||
|
||||
+3
-5
@@ -25,8 +25,7 @@ function createView(
|
||||
isRunning: boolean,
|
||||
isEnabled = true,
|
||||
isLocked = false,
|
||||
isExecutionHighlighted = false,
|
||||
isWorkflowRunning = false
|
||||
isExecutionHighlighted = false
|
||||
) {
|
||||
return (
|
||||
<ReactFlowProvider>
|
||||
@@ -39,7 +38,6 @@ function createView(
|
||||
hasRing={false}
|
||||
ringStyles=''
|
||||
isRunning={isRunning}
|
||||
isWorkflowRunning={isWorkflowRunning}
|
||||
isExecutionHighlighted={isExecutionHighlighted}
|
||||
Icon={TestIcon}
|
||||
iconBgColor='var(--surface-2)'
|
||||
@@ -130,7 +128,7 @@ describe('WorkflowBlockView action menu', () => {
|
||||
mountedRoots.add(root)
|
||||
mountedHosts.add(host)
|
||||
|
||||
act(() => root.render(createView(false, true, false, false, true)))
|
||||
act(() => root.render(createView(false, true, false, false)))
|
||||
flushAnimationFrames()
|
||||
|
||||
const actionMenuRoot = host.querySelector<HTMLElement>('.group.relative')
|
||||
@@ -149,7 +147,7 @@ describe('WorkflowBlockView action menu', () => {
|
||||
mountedRoots.add(root)
|
||||
mountedHosts.add(host)
|
||||
|
||||
act(() => root.render(createView(false, true, false, true, true)))
|
||||
act(() => root.render(createView(false, true, false, true)))
|
||||
flushAnimationFrames()
|
||||
|
||||
const actionMenuRoot = host.querySelector<HTMLElement>('.group.relative')
|
||||
|
||||
@@ -393,15 +393,6 @@ export interface WorkflowBlockViewProps {
|
||||
runPathStatus?: BlockRunStatus
|
||||
/** Whether execution controls are active for this block. */
|
||||
isRunning?: boolean
|
||||
/**
|
||||
* Whether the parent workflow is executing.
|
||||
*
|
||||
* Accepted and currently unread: `workflow-block.tsx` supplies it and nothing
|
||||
* below consults it, so the hold-open behavior this once claimed is not
|
||||
* implemented. Kept in the interface because the caller passes it — wire it up
|
||||
* or stop passing it, but do not read this as working today.
|
||||
*/
|
||||
isWorkflowRunning?: boolean
|
||||
/** Whether this block participates in the current execution handoff. */
|
||||
isExecutionHighlighted?: boolean
|
||||
/** Block icon component and its background color. */
|
||||
|
||||
Reference in New Issue
Block a user