Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

@waleedlatif1 waleedlatif1 commented Dec 31, 2025

aadamgough and others added 5 commits December 31, 2025 00:08
* renamed operaiton

* revert icons file
…cks (#2649)

* feat(copy-paste): allow cross workflow selection, paste, move for blocks

* fix drag options

* add keyboard and mouse controls into docs

* refactor sockets and undo/redo for batch additions and removals

* fix tests

* cleanup more code

* fix perms issue

* fix subflow copy/paste

* remove log file

* fit paste in viewport bounds

* fix deselection
@vercel
Copy link

vercel bot commented Dec 31, 2025

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

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 1, 2026 1:59am

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 31, 2025

Greptile Summary

This release combines three main improvements:

Copy-Paste Workflow Blocks - Implemented comprehensive copy-paste functionality using Cmd+C/Cmd+V keyboard shortcuts. Blocks are copied to a clipboard store with their edges, subflow containers (loops/parallels), and subblock values. When pasting, blocks are positioned at viewport center with regenerated IDs and unique names. Properly validates trigger blocks to prevent duplicate single-instance triggers.

Multi-Select & Batch Operations - Added Shift+drag selection mode for selecting multiple blocks simultaneously, with proper state management to prevent conflicts with panning. Refactored operations to use batch APIs (batch-add-blocks, batch-remove-blocks, batch-update-positions) reducing socket traffic and improving collaborative editing performance. Delete key now removes all selected blocks at once.

Bug Fixes - Fixed MCP tool execution by excluding serverUrl from tool call parameters (was being incorrectly passed to MCP servers). Renamed JSM operation from add_organization_to_service_desk to add_organization for consistency. Fixed trigger notification to only show for single-instance triggers, not scheduled workflows.

Documentation - Added comprehensive keyboard shortcuts documentation across all supported languages (EN, DE, ES, FR, JA, ZH).

The implementation properly handles nested blocks in subflows, maintains undo/redo history, validates permissions, and synchronizes state across collaborative users through socket operations.

Confidence Score: 4/5

  • Safe to merge with minor observations noted
  • Well-tested feature implementation with proper validation, permissions, and collaborative state management. The refactoring to batch operations is architecturally sound. Minor score reduction due to the large surface area of changes and complex interaction patterns that benefit from additional integration testing.
  • No files require special attention - the implementation follows established patterns

Important Files Changed

Filename Overview
apps/sim/tools/index.ts Added serverUrl to MCP_SYSTEM_PARAMETERS to exclude it from tool call params - clean fix
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx Implemented copy-paste, multi-select with Shift+drag, batch operations - comprehensive refactor with proper validation
apps/sim/hooks/use-collaborative-workflow.ts Refactored to use batch operations for add/remove/update - reduces individual socket operations
apps/sim/stores/workflows/utils.ts Added helper functions for block state preparation and ID regeneration - well-structured utilities
apps/sim/stores/workflows/registry/store.ts Added clipboard functionality for copy-paste - proper state management
apps/sim/socket/handlers/operations.ts Added handlers for batch operations - follows existing patterns for persistence and broadcast

Sequence Diagram

sequenceDiagram
    participant User
    participant Workflow as workflow.tsx
    participant Registry as registry/store.ts
    participant Collab as use-collaborative-workflow
    participant Socket as socket/handlers
    participant Utils as workflows/utils.ts
    
    Note over User,Utils: Copy-Paste Feature
    User->>Workflow: Cmd+C (select blocks)
    Workflow->>Registry: copyBlocks(blockIds)
    Registry->>Registry: Store blocks, edges, loops in clipboard
    
    User->>Workflow: Cmd+V
    Workflow->>Registry: preparePasteData(offset)
    Registry->>Utils: regenerateBlockIds()
    Utils-->>Registry: New blocks with unique IDs/names
    Registry-->>Workflow: Paste data ready
    Workflow->>Collab: collaborativeBatchAddBlocks()
    Collab->>Socket: emit batch-add-blocks
    Socket->>Socket: Persist & broadcast
    Socket-->>Collab: operation-confirmed
    
    Note over User,Utils: Multi-Select & Batch Operations
    User->>Workflow: Shift+Drag selection
    Workflow->>Workflow: Track isShiftPressed state
    User->>Workflow: Drag multiple blocks
    Workflow->>Workflow: onSelectionDragStop
    Workflow->>Collab: collaborativeBatchUpdatePositions()
    Collab->>Socket: emit batch-update-positions
    Socket->>Socket: Persist & broadcast
    
    User->>Workflow: Delete multiple blocks
    Workflow->>Collab: collaborativeBatchRemoveBlocks()
    Collab->>Socket: emit batch-remove-blocks
    Socket->>Socket: Persist & broadcast
    
    Note over User,Utils: MCP Tool Fix
    Workflow->>Collab: Execute MCP tool
    Collab->>Utils: Filter system params
    Utils->>Utils: Exclude serverUrl from params
    Utils-->>Collab: Clean tool arguments
Loading

…election on canvas (#2656)

* feat(workflow): added context menu for block, pane, and multi-block selection on canvas

* added more

* ack PR comments
@waleedlatif1 waleedlatif1 merged commit eb5d1f3 into main Jan 1, 2026
13 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.

4 participants