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

Context parameters in UI #902

Merged
merged 1 commit into from
Oct 3, 2024
Merged

Conversation

ykeremy
Copy link
Contributor

@ykeremy ykeremy commented Oct 3, 2024

Important

Add support for context parameters in the workflow editor UI, including new components and refactoring for improved parameter and node label handling.

  • Behavior:
    • Add SourceParameterKeySelector component for selecting context and output parameter keys.
    • Support context parameters in WorkflowParameterAddPanel and WorkflowParameterEditPanel.
    • Update FlowRenderer to handle context parameters in convertToParametersYAML().
  • Node Handling:
    • Refactor node label change handling using useNodeLabelChangeHandler hook.
    • Update nodes like CodeBlockNode, DownloadNode, FileParserNode, etc., to use the new label change handler.
  • Parameter Management:
    • Add context parameter type to ParametersState in FlowRenderer.
    • Update WorkflowParametersPanel to manage context parameters.
  • Utilities:
    • Add getUpdatedParametersAfterLabelUpdateForSourceParameterKey() in workflowEditorUtils.
    • Refactor HorizontallyResizingInput to use ComponentPropsWithoutRef.

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

…src/'

<!-- ELLIPSIS_HIDDEN -->

> [!IMPORTANT]
> Add support for context parameters in the workflow editor UI, including new components and refactoring for improved parameter and node label handling.
>
>   - **Behavior**:
>     - Add `SourceParameterKeySelector` component for selecting context and output parameter keys.
>     - Support context parameters in `WorkflowParameterAddPanel` and `WorkflowParameterEditPanel`.
>     - Update `FlowRenderer` to handle context parameters in `convertToParametersYAML()`.
>   - **Node Handling**:
>     - Refactor node label change handling using `useNodeLabelChangeHandler` hook.
>     - Update nodes like `CodeBlockNode`, `DownloadNode`, `FileParserNode`, etc., to use the new label change handler.
>   - **Parameter Management**:
>     - Add context parameter type to `ParametersState` in `FlowRenderer`.
>     - Update `WorkflowParametersPanel` to manage context parameters.
>   - **Utilities**:
>     - Add `getUpdatedParametersAfterLabelUpdateForSourceParameterKey()` in `workflowEditorUtils`.
>     - Refactor `HorizontallyResizingInput` to use `ComponentPropsWithoutRef`.
>
> <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 b83dcfc423379b99c008c4121cbc594ea0c0ed27. It will automatically update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
@ykeremy ykeremy added the sync label Oct 3, 2024
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 6d31312 in 29 seconds

More details
  • Looked at 1129 lines of code in 18 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts:724
  • Draft comment:
    The return statement should use newOutputParameterKey instead of oldOutputParameterKey to correctly update the parameter with the new label.
            : parameter.sourceParameterKey,
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_j7HC9t2k9bOT4jrV


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! Incremental review on 6d31312 in 47 seconds

More details
  • Looked at 1129 lines of code in 18 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts:725
  • Draft comment:
    The return statement should use newOutputParameterKey instead of oldOutputParameterKey when the sourceParameterKey matches oldOutputParameterKey.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts:650
  • Draft comment:
    The convertEchoParameters function should handle ContextParameter to ensure context parameters are echoed back correctly.
  • Reason this comment was not posted:
    Marked as duplicate.
3. skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx:70
  • Draft comment:
    Use parameter.sourceParameterKey instead of parameter.source.key to access the source parameter key.
  • Reason this comment was not posted:
    Marked as duplicate.
4. skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx:89
  • Draft comment:
    Ensure source_parameter_key is set from parameter.sourceParameterKey for ContextParameter.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_VGAbvq3N02felLPS


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

@msalihaltun msalihaltun merged commit 83d0879 into main Oct 3, 2024
2 checks passed
@msalihaltun msalihaltun deleted the salih/context-parameters-in-ui branch October 3, 2024 19:19
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