Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • added start block to tag dropdown by default

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 10:13am

@waleedlatif1 waleedlatif1 merged commit 1bd18ee into staging Nov 12, 2025
3 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/tag-drop branch November 12, 2025 10:14
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 12, 2025

Greptile Overview

Greptile Summary

Added support for displaying the start block (start_trigger) in the tag dropdown by default, making it consistent with how generic_webhook blocks are handled. This allows users to reference the root tag of start trigger blocks in their workflows.

  • Extended tag visibility logic to show root tags for start_trigger blocks in tag dropdown
  • Updated accessible reference prefix calculation to include start_trigger blocks alongside legacy starter blocks
  • Added defensive filtering in normalizeInputFormatValue to exclude fields with empty or whitespace-only names, preventing invalid field references

The changes maintain consistency with existing patterns and improve the robustness of input format handling.

Confidence Score: 4/5

  • This PR is safe to merge with minor style improvements recommended
  • The changes are straightforward and improve functionality. String literals should be replaced with constants for maintainability, but this doesn't affect runtime behavior. The defensive filtering in block-outputs.ts is a positive improvement that prevents invalid references.
  • No files require special attention. The style suggestions are minor improvements that enhance code consistency.

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown.tsx 4/5 added start_trigger type check to show root tag for start blocks; should use constant instead of string literal
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-accessible-reference-prefixes.ts 4/5 updated to include start_trigger blocks when finding accessible reference prefixes; should use constant instead of string literal
apps/sim/lib/workflows/block-outputs.ts 5/5 added defensive filtering to exclude fields with empty names in normalizeInputFormatValue; consistent with existing patterns

Sequence Diagram

sequenceDiagram
    participant User
    participant TagDropdown
    participant BlockOutputs
    participant AccessiblePrefixes
    participant WorkflowStore

    User->>TagDropdown: Types < to trigger dropdown
    TagDropdown->>AccessiblePrefixes: Get accessible blocks
    AccessiblePrefixes->>WorkflowStore: Query blocks, edges, loops, parallels
    AccessiblePrefixes->>AccessiblePrefixes: Find starter/start_trigger block
    AccessiblePrefixes-->>TagDropdown: Return accessible block IDs
    
    TagDropdown->>BlockOutputs: Get output paths for each block
    BlockOutputs->>BlockOutputs: Filter empty field names
    BlockOutputs-->>TagDropdown: Return valid output paths
    
    TagDropdown->>TagDropdown: Check if root tag should show
    Note over TagDropdown: Shows root tag for<br/>generic_webhook OR start_trigger
    
    TagDropdown->>TagDropdown: Build tag list with block outputs
    TagDropdown-->>User: Display filtered tags in dropdown
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.

3 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +642 to +643
const shouldShowRootTag =
sourceBlock.type === TRIGGER_TYPES.GENERIC_WEBHOOK || sourceBlock.type === 'start_trigger'
Copy link
Contributor

Choose a reason for hiding this comment

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

style: use constant TRIGGER_TYPES.START instead of string literal

Suggested change
const shouldShowRootTag =
sourceBlock.type === TRIGGER_TYPES.GENERIC_WEBHOOK || sourceBlock.type === 'start_trigger'
const shouldShowRootTag =
sourceBlock.type === TRIGGER_TYPES.GENERIC_WEBHOOK || sourceBlock.type === TRIGGER_TYPES.START
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown.tsx
Line: 642:643

Comment:
**style:** use constant `TRIGGER_TYPES.START` instead of string literal

```suggestion
      const shouldShowRootTag =
        sourceBlock.type === TRIGGER_TYPES.GENERIC_WEBHOOK || sourceBlock.type === TRIGGER_TYPES.START
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +955 to +957
const shouldShowRootTag =
accessibleBlock.type === TRIGGER_TYPES.GENERIC_WEBHOOK ||
accessibleBlock.type === 'start_trigger'
Copy link
Contributor

Choose a reason for hiding this comment

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

style: use constant TRIGGER_TYPES.START instead of string literal

Suggested change
const shouldShowRootTag =
accessibleBlock.type === TRIGGER_TYPES.GENERIC_WEBHOOK ||
accessibleBlock.type === 'start_trigger'
const shouldShowRootTag =
accessibleBlock.type === TRIGGER_TYPES.GENERIC_WEBHOOK ||
accessibleBlock.type === TRIGGER_TYPES.START
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown.tsx
Line: 955:957

Comment:
**style:** use constant `TRIGGER_TYPES.START` instead of string literal

```suggestion
      const shouldShowRootTag =
        accessibleBlock.type === TRIGGER_TYPES.GENERIC_WEBHOOK ||
        accessibleBlock.type === TRIGGER_TYPES.START
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +30 to +32
const starterBlock = Object.values(blocks).find(
(block) => block.type === 'starter' || block.type === 'start_trigger'
)
Copy link
Contributor

Choose a reason for hiding this comment

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

style: use constant TRIGGER_TYPES.START instead of string literal. Import TRIGGER_TYPES from @/lib/workflows/triggers

Suggested change
const starterBlock = Object.values(blocks).find(
(block) => block.type === 'starter' || block.type === 'start_trigger'
)
const starterBlock = Object.values(blocks).find(
(block) => block.type === 'starter' || block.type === TRIGGER_TYPES.START
)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-accessible-reference-prefixes.ts
Line: 30:32

Comment:
**style:** use constant `TRIGGER_TYPES.START` instead of string literal. Import `TRIGGER_TYPES` from `@/lib/workflows/triggers`

```suggestion
    const starterBlock = Object.values(blocks).find(
      (block) => block.type === 'starter' || block.type === TRIGGER_TYPES.START
    )
```

How can I resolve this? If you propose a fix, please make it concise.

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