langflow-ai / langflow

Langflow is a low-code app builder for RAG and multi-agent AI applications. It’s Python-based and agnostic to any model, API, or database.
http://www.langflow.org
MIT License
27.06k stars 3.58k forks source link

[Feature Request] Component Copy and Paste Between Flows #2821

Open YamonBot opened 1 month ago

YamonBot commented 1 month ago

Feature Request

Content of the Proposal

Add a feature that allows users to copy a component within a flow using Ctrl + C, which copies the configuration of the component to the clipboard. When pasting it into another flow, the component's content should be inserted as it was. Currently, copying and pasting within the same window is supported, but pasting into a different window that is open separately is not possible. This feature could be implemented by applying the functionality to import flow with JSON. (Copy the JSON format to the clipboard)

Technical Considerations

  1. Ensure that the chat input and chat output components can only be inserted once per flow. Implement exception handling for these cases.
  2. Modify the existing Copy button to support copying across different windows, not just within the same screen.(Export)

Potential Use Cases

  1. Users working on multiple flows can easily transfer components without manually reconfiguring them.
  2. Simplifies the workflow for complex projects where components need to be reused.

Motivation

Currently, users can import JSON to add components to an existing flow, but it would be more efficient if copying and pasting components directly between flows were possible. This would streamline the process and save time.

Your Contribution

We lack an understanding of the frontend, so if you need consultation at the backend code level, we will support you.

YamonBot commented 1 month ago

I think a handler is needed that exports only the selected components to JSON when pressing Ctrl+C, and this handler should interfere to ensure that formats like SecretStr are not copied. I believe this handler could be a reusable feature for my other suggestions as well. Similarly, validation should be performed when pasting. (Currently, this is only important for chat input and chat output, but such elements are likely to emerge soon.)

1728

carlosrcoelho commented 2 weeks ago

@YamonBot

Do you need any assistance with this case? If not, please let us know if this issue can be closed.

YamonBot commented 1 week ago

After using the latest version, it seems that it has not been implemented yet. The key request is the concept of the flow being copied to the clipboard.