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

Feature: Autosave and Undo/Redo #3687

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open

Feature: Autosave and Undo/Redo #3687

wants to merge 30 commits into from

Conversation

0xi4o
Copy link
Contributor

@0xi4o 0xi4o commented Dec 12, 2024

  • Implements autosave in chatflow and agentflow canvas
  • Implements undo/redo functionality in chatflow and agentflow canvas

@0xi4o 0xi4o marked this pull request as draft December 12, 2024 02:40
@0xi4o 0xi4o changed the title Feature: Autosave and Undo/Redo [WIP] Feature: Autosave and Undo/Redo Dec 12, 2024
0xi4o added 21 commits December 12, 2024 14:11
… first load, autosave clears redo, and sync node triggers autosave
@0xi4o 0xi4o marked this pull request as ready for review December 20, 2024 10:53
@0xi4o 0xi4o changed the title [WIP] Feature: Autosave and Undo/Redo Feature: Autosave and Undo/Redo Dec 20, 2024
@HenryHengZJ
Copy link
Contributor

HenryHengZJ commented Dec 21, 2024

spotted 2 issues:

  • strange black bar at top when refresh
  • when open a new flow, it always autosaved first:
autosave.mp4

@HenryHengZJ
Copy link
Contributor

HenryHengZJ commented Dec 21, 2024

Also something we discussed, nodes feel pretty laggy when there are quite a lot

  • memoization of the nodes and inputs

@HenryHengZJ
Copy link
Contributor

2 more bugs:

  • as i type something and stop for seconds, it goes into autosave right, and it then unfocus the field, so I have to click the field again to make it focus, then i can start typing
autosavebug1.mp4
  • open a canvas, modify some input field, wait for autosave to happens. now try pressing Ctrl + Z, it doesnt undo. However, it works when I click the Undo button
autosavebug2.mp4

@HenryHengZJ
Copy link
Contributor

can play around with the background color of the toolbox in dark mode to see if white or some other dark colors suit better:
image

@0xi4o
Copy link
Contributor Author

0xi4o commented Dec 23, 2024

  • open a canvas, modify some input field, wait for autosave to happens. now try pressing Ctrl + Z, it doesnt undo. However, it works when I click the Undo button
  • canvas controls styling in dark mode
  • as i type something and stop for seconds, it goes into autosave right, and it then unfocus the field, so I have to click the field again to make it focus, then i can start typing

@HenryHengZJ
Copy link
Contributor

HenryHengZJ commented Jan 9, 2025

1.) Delete node -> wait for autosave -> refresh page. Node still there:

deletenodes.mp4

2.) When click Save on expanded dialog, it doesnt get autosaved:

prompts.mp4

Same when you load prompt from langchain hub:
image

@@ -100,6 +104,7 @@ const CredentialInputHandler = ({ inputParam, data, onSelect, disabled = false }
<div key={reloadTimestamp} style={{ display: 'flex', flexDirection: 'row' }}>
<AsyncDropdown
disabled={disabled}
key={`${data.id}-${inputParam.name}-${data.inputs[credentialId]}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need this?

I got error when trying to create a custom assistant:
image

@@ -152,6 +152,7 @@ export const AsyncDropdown = ({
)
}}
sx={{ height: '100%', '& .MuiInputBase-root': { height: '100%' } }}
key={`${nodeData.id}-${name}-${nodeData.inputs[internalValue]}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

there are other places that uses AsyncDropdown, for example when creating custom assistant. In those cases, there will be no nodeData, then it will throw error:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants