-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(curl-example): fixed curl example in deploy modal to reflect selected option #1573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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"
4 files reviewed, 1 comment
| 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' |
There was a problem hiding this comment.
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.
Summary
fixed curl example in deploy modal to reflect selected option
Type of Change
Testing
Tested manually.
Checklist