Skip to content
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

Improve run workflow form #1032

Merged
merged 1 commit into from
Oct 23, 2024
Merged

Conversation

wintonzheng
Copy link
Contributor

@wintonzheng wintonzheng commented Oct 23, 2024

Important

Enhance workflow parameter forms with improved UI, error handling, and default value management.

  • UI Improvements:
    • Replace table layout with form layout in RunWorkflowForm.tsx.
    • Add FormLabel for parameter descriptions in RunWorkflowForm.tsx.
    • Use Skeleton for loading state in WorkflowRunParameters.tsx.
  • Functionality:
    • Handle JSON parsing errors in parseValuesForWorkflowRun() in RunWorkflowForm.tsx.
    • Set default values to null if not provided in WorkflowRunParameters.tsx.
    • Adjust WorkflowParameterInput.tsx to handle null values for integer and float types.
  • Parameter Handling:
    • Remove defaultValue() function and handle defaults inline in WorkflowRunParameters.tsx.
    • Update WorkflowParameterAddPanel.tsx and WorkflowParameterEditPanel.tsx to handle default values more robustly.

This description was created by Ellipsis for 1801f2c. It will automatically update as commits are pushed.

…src/'

<!-- ELLIPSIS_HIDDEN -->

> [!IMPORTANT]
> Improve workflow parameter forms by enhancing UI, handling default values, and improving JSON parsing.
>
>   - **UI Improvements**:
>     - Replace table layout with form layout in `RunWorkflowForm.tsx`.
>     - Add `FormLabel` for better parameter description display in `RunWorkflowForm.tsx`.
>     - Use `Skeleton` component for loading state in `WorkflowRunParameters.tsx`.
>   - **Functionality**:
>     - Handle JSON parsing errors in `parseValuesForWorkflowRun()` in `RunWorkflowForm.tsx`.
>     - Set default values to `null` if not provided in `WorkflowRunParameters.tsx`.
>     - Adjust `WorkflowParameterInput.tsx` to handle `null` values for `integer` and `float` types.
>   - **Parameter Handling**:
>     - Remove `defaultValue()` function and handle defaults inline in `WorkflowRunParameters.tsx`.
>     - Update `WorkflowParameterAddPanel.tsx` and `WorkflowParameterEditPanel.tsx` to handle default values more robustly.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=Skyvern-AI%2Fskyvern-cloud&utm_source=github&utm_medium=referral)<sup> for e121af06611b9072d32a7d6edb6b4d2e13addcc5. It will automatically update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 1801f2c in 33 seconds

More details
  • Looked at 423 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. skyvern-frontend/src/routes/workflows/WorkflowParameterInput.tsx:44
  • Draft comment:
    Consider adding a check for NaN after parsing the input to handle invalid number inputs gracefully.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The code in WorkflowParameterInput.tsx handles different input types, including JSON, string, integer, float, boolean, and file_url. However, the integer and float types use parseInt and parseFloat without checking for NaN, which could lead to unexpected behavior if the input is not a valid number.
2. skyvern-frontend/src/routes/workflows/editor/panels/WorkflowParameterEditPanel.tsx:259
  • Draft comment:
    Ensure consistency by setting defaultValue: value.s3uri for file_url type, similar to WorkflowParameterAddPanel.tsx.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_YfhXpZLBe1rtUZEQ


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 1801f2c in 1 minute and 3 seconds

More details
  • Looked at 423 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. skyvern-frontend/src/routes/workflows/WorkflowParameterInput.tsx:44
  • Draft comment:
    Consider adding validation to ensure the input is a valid number before calling parseInt or parseFloat. This will prevent NaN from being set as the value.
  • Reason this comment was not posted:
    Comment was on unchanged code.
2. skyvern-frontend/src/routes/workflows/editor/panels/WorkflowParameterEditPanel.tsx:254
  • Draft comment:
    Consider refactoring the JSON defaultValue logic into a utility function to reduce code duplication and potential errors. This logic is also present in the WorkflowParameterAddPanel.tsx.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    In WorkflowParameterEditPanel.tsx, the defaultValue logic for JSON parameters is repeated in both the Add and Edit panels. This could be refactored into a utility function to reduce code duplication and potential errors.

Workflow ID: wflow_LOK2DZqEx8sB8YZ7


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@msalihaltun msalihaltun merged commit 426acbc into main Oct 23, 2024
2 checks passed
@msalihaltun msalihaltun deleted the salih/run-workflow-form-improvement branch October 23, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants