Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

@waleedlatif1 waleedlatif1 commented Nov 12, 2025

Summary

  • Fixed floating variables, restored collaborative features and ensured it works
  • Added autcomplete off to prevent suggested values in subblocks

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 Nov 12, 2025

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

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Nov 12, 2025 1:52am

@waleedlatif1 waleedlatif1 marked this pull request as ready for review November 12, 2025 01:47
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 12, 2025

Greptile Overview

Greptile Summary

This PR restores the floating variables modal feature with full collaborative support. The main changes include:

  • Re-enabled variables modal: Uncommented imports, state management (useVariablesStore), and UI elements in panel-new.tsx to restore the variables menu option and floating modal
  • Integrated collaborative workflow: Updated variables.tsx to use collaborative hooks (collaborativeAddVariable, collaborativeUpdateVariable, collaborativeDeleteVariable) instead of direct store operations, enabling real-time multi-user synchronization
  • Icon standardization: Replaced all Trash2 and conflicting Trash icons from lucide-react with the custom Trash icon from the emcn design system across 13 files for consistency

The variables modal now properly syncs changes across all collaborators in real-time through the socket-based collaborative workflow system.

Confidence Score: 4/5

  • This PR is safe to merge with low risk
  • The changes are well-structured and focused on restoring a previously commented-out feature. The integration with collaborative workflow hooks follows established patterns in the codebase. The icon standardization is straightforward and low-risk. Minor uncertainty around edge cases in real-time collaboration justifies a score of 4 rather than 5.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/variables/variables.tsx 4/5 Restored variables modal with collaborative features; switched from local store to collaborative hooks (collaborativeUpdateVariable, collaborativeAddVariable, collaborativeDeleteVariable) and proper variable store integration
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/panel-new.tsx 5/5 Re-enabled variables modal by uncommenting imports, state, and UI elements; restored variables menu item in popover

Sequence Diagram

sequenceDiagram
    participant User
    participant PanelNew as Panel Component
    participant VariablesStore as Variables Store
    participant CollaborativeHook as useCollaborativeWorkflow
    participant VariablesModal as Variables Modal
    participant Socket as Socket/Backend

    User->>PanelNew: Click Variables menu item
    PanelNew->>VariablesStore: setIsOpen(true)
    VariablesStore-->>VariablesModal: isOpen=true (render modal)
    
    VariablesModal->>CollaborativeHook: Get collaborative functions
    CollaborativeHook-->>VariablesModal: Return collaborative CRUD functions
    
    User->>VariablesModal: Add new variable
    VariablesModal->>CollaborativeHook: collaborativeAddVariable(data)
    CollaborativeHook->>VariablesStore: addVariable(data, id)
    CollaborativeHook->>Socket: Emit add variable operation
    Socket-->>CollaborativeHook: Confirm operation
    
    User->>VariablesModal: Update variable field
    VariablesModal->>CollaborativeHook: collaborativeUpdateVariable(id, field, value)
    CollaborativeHook->>VariablesStore: updateVariable(id, updates)
    CollaborativeHook->>Socket: Emit update operation
    Socket-->>CollaborativeHook: Confirm operation
    
    User->>VariablesModal: Delete variable
    VariablesModal->>CollaborativeHook: collaborativeDeleteVariable(id)
    CollaborativeHook->>VariablesStore: deleteVariable(id)
    CollaborativeHook->>Socket: Emit delete operation
    Socket-->>CollaborativeHook: Confirm operation
    
    Note over VariablesModal,Socket: All changes sync in real-time<br/>to other collaborators
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

16 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 changed the title fix(variables): fixed floating variables fix(variables): fixed floating variables, added autcomplete off to prevent suggested values Nov 12, 2025
@waleedlatif1 waleedlatif1 merged commit 96f134b into staging Nov 12, 2025
4 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/variables-only branch November 12, 2025 01:52
waleedlatif1 added a commit that referenced this pull request Nov 12, 2025
…event suggested values (#1908)

* fixed variables

* add autocomplete=off to prevent suggestions for subblock values
waleedlatif1 added a commit that referenced this pull request Nov 12, 2025
…event suggested values (#1908)

* fixed variables

* add autocomplete=off to prevent suggestions for subblock values
@waleedlatif1 waleedlatif1 mentioned this pull request Nov 12, 2025
10 tasks
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