Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

@icecrasher321 icecrasher321 commented Jan 21, 2026

Summary

  • Ring should clear on duplicate and copy/paste for source
  • Rename start block helper to be more accurate + fix duplicate not showing up for API block

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Jan 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 21, 2026 10:38am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 21, 2026

Greptile Summary

Fixed bug where the editor panel's ring selection (currentBlockId) was not being cleared when duplicating or pasting multiple blocks, causing the ring to remain on the original source block.

Changes

  • Added logic to clear currentBlockId when multiple blocks are selected after duplicate/paste operations (line 2087-2089)
  • Added same logic to the onNodesChange handler for consistency (line 2195-2197)
  • Both changes ensure the editor panel ring is cleared when selecting multiple blocks, since only one block can be edited at a time

Impact

This fix ensures consistent behavior across all selection scenarios - the ring selection now properly clears when multiple blocks are selected, regardless of whether the selection came from a duplicate/paste operation or direct user interaction.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix adds a simple conditional check that mirrors existing logic elsewhere in the codebase, ensuring consistent behavior. The change is narrowly scoped, addresses a specific UI bug, and follows the same pattern already used in the onNodesChange handler.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx Added logic to clear editor panel ring selection when multiple blocks are selected after duplicate/paste operations

Sequence Diagram

sequenceDiagram
    participant User
    participant ContextMenu
    participant WorkflowContent
    participant ExecutePaste
    participant Effect
    participant PanelEditor as usePanelEditorStore
    participant Canvas

    User->>ContextMenu: Click Duplicate
    ContextMenu->>WorkflowContent: handleContextDuplicate()
    WorkflowContent->>WorkflowContent: copyBlocks()
    WorkflowContent->>ExecutePaste: executePasteOperation('duplicate')
    ExecutePaste->>WorkflowContent: setPendingSelection(pastedBlockIds)
    ExecutePaste->>WorkflowContent: collaborativeBatchAddBlocks()
    
    Note over Effect: Effect detects pendingSelection
    Effect->>Effect: Apply selection to nodes
    Effect->>Effect: resolveParentChildSelectionConflicts()
    Effect->>Effect: Calculate selectedIds
    
    alt Single block selected
        Effect->>PanelEditor: setCurrentBlockId(selectedIds[0])
        PanelEditor->>Canvas: Show ring around selected block
    else Multiple blocks selected (NEW FIX)
        Effect->>PanelEditor: clearCurrentBlock()
        PanelEditor->>Canvas: Clear ring selection
    else No blocks selected
        Effect->>PanelEditor: clearCurrentBlock()
        PanelEditor->>Canvas: Clear ring selection
    end
Loading

@icecrasher321 icecrasher321 merged commit 5988d0e into staging Jan 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants