Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

fixed curl example in deploy modal to reflect selected option

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 8, 2025

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

Project Deployment Preview Comments Updated (UTC)
sim Building Building Preview Comment Oct 8, 2025 1:45am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Oct 8, 2025 1:45am

@waleedlatif1 waleedlatif1 merged commit 7bdf0e9 into staging Oct 8, 2025
4 of 5 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/curl-example branch October 8, 2025 01:46
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 in the deploy modal where the generated cURL example for streaming mode wasn't dynamically reflecting the user's selected streaming outputs. The main fix involves creating a new `addStreamingParams` function that properly injects streaming parameters and selected outputs into the cURL command's JSON payload.

The core change is in the example-command.tsx file, where the streaming mode cURL generation now parses existing JSON payloads and augments them with the user's selected streaming outputs. Additionally, the OutputSelect component was enhanced with a new valueMode prop that allows it to return either output IDs or labels, enabling the deploy modal to show human-readable output names in the generated cURL commands.

Supporting changes include styling fixes for button components across various modals to ensure consistent appearance in light and dark themes. These styling changes primarily target outline variant buttons and add comprehensive CSS classes for proper theme handling.

Important Files Changed

Changed Files
Filename Score Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/components/deploy-modal/components/deployment-info/components/example-command/example-command.tsx 4/5 Core fix: Added addStreamingParams function to properly inject streaming parameters and selected outputs into cURL command JSON payload
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/chat/components/output-select/output-select.tsx 4/5 Enhanced OutputSelect component with valueMode prop to support returning either output IDs or labels for different use cases
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/components/deploy-modal/components/deploy-form/deploy-form.tsx 4/5 Styling fixes: Added comprehensive light/dark theme CSS classes for outline variant buttons in API key creation dialog
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/api-keys/api-keys.tsx 4/5 Styling fixes: Added extensive custom styling for button components in API keys modal with proper theme handling

Confidence score: 4/5

  • This PR addresses a legitimate bug where cURL examples weren't reflecting user selections, with a well-implemented solution
  • Score reflects solid implementation with proper JSON parsing, error handling, and backward compatibility maintained
  • The styling changes appear disconnected from the main fix but don't introduce functional risks

Sequence Diagram

sequenceDiagram
    participant User
    participant DeployForm
    participant ExampleCommand
    participant ReactHookForm
    participant APIKeyStore
    
    User->>DeployForm: "Selects different API key from dropdown"
    DeployForm->>ReactHookForm: "onValueChange(selectedKeyId)"
    ReactHookForm->>DeployForm: "Updates form state with new apiKey value"
    DeployForm->>ExampleCommand: "Passes selectedApiKey prop"
    ExampleCommand->>APIKeyStore: "Finds API key by ID"
    APIKeyStore->>ExampleCommand: "Returns API key object with key value"
    ExampleCommand->>ExampleCommand: "formatCurlCommand(command, selectedApiKey)"
    ExampleCommand->>ExampleCommand: "Replace actual key with $SIM_API_KEY placeholder"
    ExampleCommand->>User: "Displays updated curl command with correct API key reference"
Loading

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

if (createError) setCreateError(null)
}}
className='h-8'
className='h-8 data-[variant=outline]:border-border data-[variant=outline]:bg-background data-[variant=outline]:text-foreground data-[variant=outline]:hover:bg-muted dark:data-[variant=outline]:border-border dark:data-[variant=outline]:bg-background dark:data-[variant=outline]:text-foreground dark:data-[variant=outline]:hover:bg-muted/80'
Copy link
Contributor

Choose a reason for hiding this comment

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

style: This extensive inline styling could be extracted to a reusable CSS class or component variant for better maintainability

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/api-keys/api-keys.tsx
Line: 513:513

Comment:
**style:** This extensive inline styling could be extracted to a reusable CSS class or component variant for better maintainability

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