SIGN IN SIGN UP
langflow-ai / langflow UNCLAIMED

Langflow is a powerful tool for building and deploying AI-powered agents and workflows.

0 0 1 Python

feat: add new freeze function to component (#2624)

* feat: Add new API endpoint for retrieving vertex order

This commit adds a new API endpoint, , which allows for retrieving the order of vertices in a graph. It includes the necessary functions and types to make the API request and process the response. This feature enhances the functionality of the application by providing the ability to retrieve and work with vertex order data.

* feat: Add missing semicolon in constants.ts

The commit adds a missing semicolon in the  file in the  directory. This fix ensures that the code is syntactically correct and prevents any potential issues that may arise from the missing semicolon.

* feat: Refactor usePostRetrieveVertexOrder to improve code readability and maintainability

* feat: Add FreezeAllSvg component for displaying a freeze all icon

This commit adds a new component called FreezeAllSvg, which is responsible for rendering an SVG icon representing the freeze all feature. The component accepts props for customizing the size and color of the icon. This addition enhances the visual representation of the freeze all functionality in the application.

* feat: Add freezeMultipleNodes method to FlowStoreType

This commit adds the `freezeMultipleNodes` method to the `FlowStoreType` interface in the `index.ts` file. The method takes an array of node IDs as input and freezes the corresponding nodes in the flow. This addition enhances the functionality of the flow store by providing the ability to freeze multiple nodes at once.

* feat: Update freezeMultipleNodes to use updateFreezeStatus and updateNodeInternals

Refactor the NodeToolbarComponent to use the updated freezeMultipleNodes method in the FlowStore. Instead of directly freezing the nodes, the method now calls updateFreezeStatus to update the freeze status of the nodes and updateNodeInternals to update the node internals. This change improves the functionality and maintainability of the code.

* feat: Update FreezeAllSvg component to use currentColor for fill

The commit updates the FreezeAllSvg component to use the CSS `currentColor` value for the fill property. This change ensures that the fill color of the SVG icon will match the current text color, providing a consistent and customizable visual representation of the freeze all feature.

* feat: Add freezeAll shortcut and component

This commit adds the `freezeAll` shortcut and component to the application. The `freezeAll` shortcut allows users to freeze all nodes in the flow at once, while the `FreezeAllSvg` component is responsible for rendering an SVG icon representing the freeze all feature. These additions enhance the functionality and user experience of the application by providing a convenient way to freeze multiple nodes and a visual representation of the freeze all feature.

* [autofix.ci] apply automated fixes

* feat: Refactor get_vertex method to include silent parameter

This commit refactors the `get_vertex` method in the `Graph` class to include a `silent` parameter. The `silent` parameter allows the method to be called without raising an exception if the vertex is not found. This change improves the flexibility and usability of the method, as it can now be used in scenarios where the absence of a vertex is expected.

* feat: check if parent vertex is frozen and cache children

* feat: change ungroup_node function to add frozen status to nodes

This commit refactors the `ungroup_node` function in the `utils.py` file to add the `frozen` status to each node in the list of nodes. The `frozen` status is obtained from the `group_node_data` parameter and is assigned to each node in the loop. This change improves the functionality and maintainability of the code by ensuring that the frozen status is correctly applied to the nodes during the ungrouping process.

* Refactor code to check if parent vertex is frozen before caching children

* feat: Rename "Freeze All" to "Freeze Path" in shortcuts and components

This commit updates the codebase to rename the "Freeze All" feature to "Freeze Path" in the shortcuts and components. The changes include modifying the constant name, updating the shortcut key, and adjusting the component names and labels. This renaming improves the clarity and accuracy of the feature, aligning it with its intended functionality of freezing a specific path in the flow.

* [autofix.ci] apply automated fixes

* fix: refactor get_vertex method to handle silent parameter

* fix(base.py): remove unnecessary silent parameter in get_vertex method and remove conditional check for silent parameter in get_vertex method to simplify code and improve readability

* Added new freezeAll icon

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
A
anovazzi1 committed
23874b81ed2d24765daf5e7994ffcb0865e7bb92
Parent: 0897ee5
Committed by GitHub <noreply@github.com> on 7/16/2024, 11:48:20 PM