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

feat: allow flow name to be edited from the main page or by clicking header #5525

Merged
merged 20 commits into from
Jan 10, 2025

Conversation

lucaseduoli
Copy link
Collaborator

This pull request introduces several enhancements and new features to the flow management components in the frontend. The key changes include the addition of an inline flow name editing feature, improvements to the flow settings modal, and updates to the dropdown component to support editing flow details.

Inline Flow Name Editing:

  • Added state and handlers for editing the flow name inline within the MenuBar component. This includes the use of useEffect, useState, useRef, and event handlers for input changes and key events. (src/frontend/src/components/core/appHeaderComponent/components/FlowMenu/index.tsx) [1] [2] [3] [4] [5] [6] [7] [8]

Flow Settings Modal Enhancements:

  • Modified the FlowSettingsModal component to accept flowData as a prop and updated the state initialization and handlers to use this prop. This allows the modal to be reused with different flow data. (src/frontend/src/modals/flowSettingsModal/index.tsx) [1] [2]

Dropdown Component Updates:

  • Added a new handleEdit prop to the DropdownComponent and updated the useSelectOptionsChange hook to handle the "edit" action. This enables the dropdown menu to trigger the flow settings modal for editing flow details. (src/frontend/src/pages/MainPage/components/dropdown/index.tsx, src/frontend/src/pages/MainPage/hooks/use-select-options-change.tsx) [1] [2] [3] [4] [5]

Integration with Grid and List Components:

  • Integrated the flow settings modal and the edit functionality into the GridComponent and ListComponent. This includes adding state for the modal and passing the handleEdit function to the dropdown component. (src/frontend/src/pages/MainPage/components/grid/index.tsx, src/frontend/src/pages/MainPage/components/list/index.tsx) [1] [2] [3] [4] [5] [6] [7] [8]

Type Definitions:

  • Updated the FlowSettingsPropsType to include an optional flowData property, allowing the flow settings modal to be more flexible. (src/frontend/src/types/components/index.ts)

@lucaseduoli lucaseduoli self-assigned this Jan 2, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request javascript Pull requests that update Javascript code labels Jan 2, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 2, 2025
Copy link
Member

@Cristhianzl Cristhianzl left a comment

Choose a reason for hiding this comment

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

Can we add tests to validate this change?
I think It can be on core tests > extended > features

Copy link
Contributor

@anovazzi1 anovazzi1 left a comment

Choose a reason for hiding this comment

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

image clicking header name makes the name disapper but the / keeps in place. image image Flow settings and edit details open the same modal but have different name and icons

Edit component should not have endpoint name avaliable:
image

lucaseduoli and others added 3 commits January 3, 2025 16:00
…/FlowMenu/index.tsx

Co-authored-by: Cristhian Zanforlin Lousa <[email protected]>
…/FlowMenu/index.tsx

Co-authored-by: Cristhian Zanforlin Lousa <[email protected]>
…/FlowMenu/index.tsx

Co-authored-by: Cristhian Zanforlin Lousa <[email protected]>
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 3, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 3, 2025
@ogabrielluiz ogabrielluiz changed the title feat: rename flows on main page and by clicking header feat: allow flow name to be edited from the main page or by clicking header Jan 6, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 6, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 6, 2025
Copy link
Contributor

@anovazzi1 anovazzi1 left a comment

Choose a reason for hiding this comment

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

editing the flow name directly in the header inside the flow is not working

… input element for flow name for testing purposes

✨ (edit-flow-name.spec.ts): create test to ensure user can edit flow name by clicking on the header or main page, with various random names generated for testing purposes
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jan 8, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 8, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 8, 2025
Copy link
Member

@Cristhianzl Cristhianzl left a comment

Choose a reason for hiding this comment

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

lgtm

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 8, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 8, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 10, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 10, 2025
@lucaseduoli lucaseduoli enabled auto-merge January 10, 2025 18:06
@lucaseduoli lucaseduoli added this pull request to the merge queue Jan 10, 2025
Merged via the queue into main with commit 3e482db Jan 10, 2025
22 checks passed
@lucaseduoli lucaseduoli deleted the feat/rename-flows branch January 10, 2025 18:24
mieslep pushed a commit to mieslep/langflow that referenced this pull request Jan 15, 2025
…header (langflow-ai#5525)

* Added flowData to allow changing flow name without being on the flow

* Added being able to edit the flow name just by clicking the name

* Added handleEdit and edit details option on flow dropdown

* Added flow settings modal to grid and list

* Added flowData type and select option

* Update src/frontend/src/components/core/appHeaderComponent/components/FlowMenu/index.tsx

Co-authored-by: Cristhian Zanforlin Lousa <[email protected]>

* Update src/frontend/src/components/core/appHeaderComponent/components/FlowMenu/index.tsx

Co-authored-by: Cristhian Zanforlin Lousa <[email protected]>

* Update src/frontend/src/components/core/appHeaderComponent/components/FlowMenu/index.tsx

Co-authored-by: Cristhian Zanforlin Lousa <[email protected]>

* Fixed useCallback import

* Implemented details boolean to not show endpoint, changed title of flow settings modal

* Changed Flow Settings to Edit Details

* Changed Flow Settings modal description

* Fixed empty name not appearing, fixed naming conditions not considered

* 📝 (editFlowSettingsComponent/index.tsx): add data-testid attribute to input element for flow name for testing purposes
✨ (edit-flow-name.spec.ts): create test to ensure user can edit flow name by clicking on the header or main page, with various random names generated for testing purposes

* Fixed tests that used Flow Settings

* Fixed tests that rely on flow name to open edit details

* Fixed tests

---------

Co-authored-by: Cristhian Zanforlin Lousa <[email protected]>
Co-authored-by: anovazzi1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request javascript Pull requests that update Javascript code lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants