Skip to content

fix(input-format): allow value field to be cleared#1658

Merged
icecrasher321 merged 4 commits intostagingfrom
fix/input-format-clear
Oct 16, 2025
Merged

fix(input-format): allow value field to be cleared#1658
icecrasher321 merged 4 commits intostagingfrom
fix/input-format-clear

Conversation

@icecrasher321
Copy link
Collaborator

Summary

  • All input format subblock test value to be cleared
  • Do not detect changes to that as changes detected

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 Oct 16, 2025

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

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Oct 16, 2025 6:10pm

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.

Greptile Overview

Summary

This PR fixes a bug where test values in inputFormat fields couldn't be cleared. The fix has two parts:

  • UI component: Removed validation that prevented empty values from being saved when the field loses focus (input-format.tsx:137-138)
  • Deployment detection: Added sanitization to exclude the value field from workflow change detection, since it's only used for manual testing and shouldn't trigger deployment alerts

The changes allow users to enter and clear test values in inputFormat fields without affecting deployment state.

Confidence Score: 4/5

  • This PR is safe to merge with minor consideration for the collapsed field
  • The logic is straightforward and solves the stated problem. Score is 4 (not 5) because the collapsed field might also need to be excluded from deployment comparison as it's UI-only state, similar to how isExpanded is handled for tools
  • apps/sim/lib/workflows/utils.ts - consider excluding collapsed field from comparison

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/starter/input-format.tsx 5/5 Removed validation that prevented clearing value field on blur (lines 137-138)
apps/sim/lib/workflows/utils.ts 4/5 Added sanitization function to exclude value field from deployment change detection

Sequence Diagram

sequenceDiagram
    participant User
    participant InputField
    participant handleValueInputBlur
    participant updateField
    participant hasWorkflowChanged
    participant sanitizeInputFormatForComparison

    User->>InputField: Edits value field (including clearing it)
    User->>InputField: Blur event (focus away)
    InputField->>handleValueInputBlur: onBlur(field)
    Note over handleValueInputBlur: Get current value<br/>(empty string allowed)
    handleValueInputBlur->>updateField: updateField(id, 'value', current)
    Note over updateField: Store value in state<br/>(empty values now saved)
    
    User->>hasWorkflowChanged: Check if workflow changed
    hasWorkflowChanged->>sanitizeInputFormatForComparison: Sanitize current inputFormat
    Note over sanitizeInputFormatForComparison: Remove 'value' field<br/>from comparison
    hasWorkflowChanged->>sanitizeInputFormatForComparison: Sanitize deployed inputFormat
    Note over sanitizeInputFormatForComparison: Remove 'value' field<br/>from comparison
    hasWorkflowChanged-->>User: Compare other fields only<br/>(value field ignored)
Loading

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@icecrasher321 icecrasher321 merged commit 82fa4e8 into staging Oct 16, 2025
3 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/input-format-clear branch October 30, 2025 06: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.

1 participant