Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

add loops/parallels to accessible list of blocks in the tag dropdown when contained within a subflow

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 19, 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 19, 2025 1:24am

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 19, 2025

Greptile Summary

  • Fixed bug where loop/parallel blocks were not accessible in tag dropdown when referenced from within their own subflows
  • Removed deprecated currentIteration field throughout codebase, replaced by existing index field which serves the same purpose

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are straightforward bug fixes with good test coverage. The main fix adds loop/parallel IDs to accessible references, which is a logical enhancement. The removal of currentIteration is a clean refactor since index already provides the same functionality (both resolve to loopScope.iteration). All changes are consistent across the codebase with no breaking changes.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-accessible-reference-prefixes.ts Added loop/parallel block IDs to accessible references when block is contained within them, enabling proper tag referencing in subflows

Sequence Diagram

sequenceDiagram
    participant User
    participant TagDropdown
    participant Hook as useAccessibleReferencePrefixes
    participant Store as WorkflowStore
    participant Resolver as LoopResolver
    
    User->>TagDropdown: Open tag dropdown in subflow block
    TagDropdown->>Hook: Call hook with blockId
    Hook->>Store: Get loops, parallels, blocks, edges
    Store-->>Hook: Return workflow data
    Hook->>Hook: Find containing loop/parallel
    Hook->>Hook: Add loop.id to accessibleIds
    Hook->>Hook: Add parallel.id to accessibleIds
    Hook-->>TagDropdown: Return accessible prefixes (including loop/parallel)
    TagDropdown->>TagDropdown: Build tag list with "index" tag
    TagDropdown-->>User: Display tags (loop.index, loop.currentItem, etc.)
    User->>TagDropdown: Select "index" tag
    TagDropdown->>TagDropdown: Process tag as "loop.index"
    TagDropdown-->>User: Insert "<loop.index>" reference
    Note over Resolver: At runtime, loop.index resolves to loopScope.iteration
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
React with 👍 or 👎 to share your feedback on this new summary format

…e tag dropdown when contained withitn a subflow
@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1 waleedlatif1 merged commit 96207d8 into staging Nov 19, 2025
4 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/loops branch November 19, 2025 01:24
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.

8 files reviewed, no comments

Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format

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