Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Fixed advanced fields toggle not working when blocks have default values
  • Toggle now works directly for editable users, matching canvas block behavior
  • Read-only users still auto-expand to see all values

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 30, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jan 30, 2026 11:10pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 30, 2026

Greptile Overview

Greptile Summary

Fixed advanced fields toggle behavior to properly respect user edit permissions. For users with edit access, the toggle now works directly based on advancedMode state, matching the canvas block behavior. Read-only users still auto-expand advanced fields when default values are present.

Key changes:

  • Modified displayAdvancedOptions logic to check userPermissions.canEdit
  • Editable users: toggle controlled solely by advancedMode state
  • Read-only users: auto-expand when advancedMode || advancedValuesPresent
  • Aligns editor behavior with workflow-block.tsx pattern (line 777-779)

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a simple, well-tested logic fix that aligns editor behavior with the existing workflow-block pattern. It correctly handles the conditional logic for different user permissions and has been manually tested
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx Fixed advanced fields toggle to respect user edit permissions by conditionally checking for default values

Sequence Diagram

sequenceDiagram
    participant User
    participant Editor
    participant Permissions
    participant VisibilityLib
    
    User->>Editor: Open block in editor
    Editor->>Permissions: Check userPermissions.canEdit
    
    alt User can edit
        Editor->>Editor: displayAdvancedOptions = advancedMode
        Note over Editor: Toggle works directly<br/>based on advancedMode state
    else User is read-only
        Editor->>VisibilityLib: hasAdvancedValues(subBlocks, values, canonicalIndex)
        VisibilityLib-->>Editor: advancedValuesPresent
        Editor->>Editor: displayAdvancedOptions = advancedMode || advancedValuesPresent
        Note over Editor: Auto-expand if advanced<br/>values with defaults exist
    end
    
    Editor->>Editor: Filter and render subBlocks based on displayAdvancedOptions
    Editor->>User: Display editor with appropriate fields
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.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 92403e0 into staging Jan 30, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/advanced branch January 30, 2026 23:22
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