[PR #3927] feat: undo/redo for workflow editor #24333

Closed
opened 2026-02-21 20:22:48 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/3927

State: closed
Merged: Yes


Description

This resolves #3911 by introducing zundo to create a zustand store for creating a history over changs in the workflow editor.
The workflow store as well as the reactflow store remain untouched.

UI Elements

Buttons are added to the UI for both Workflow and Chatflow Editor:
image

Change History

I also added a way to see all changes and navigate through the history.
image

Translations

I provided translations for all currently supported languages. However, apart from EN and DE, I had all translations generated by AI.

Keyboard Shortcuts

Common keyboard shortcuts are also supported.

  • Undo

    • Windows/Linux: Ctrl + Z
    • macOS: Cmd + Z
  • Redo

    • Windows/Linux: Ctrl + Y or Ctrl + Shift + Z
    • macOS: Cmd + Shift + Z or Cmd + Y

Current Limitations

  • InputChange events in Node Panels do not trigger state changes.
  • This is an issue we need to adress since it also affects the sync workflow darft feature
  • Resizing UI elements does not trigger state changes.
  • But I think we can ignore them anyway

Type of Change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update, included: Dify Document
  • We might want to add documentation about the limitations
  • We might want to document this feature incl. keyboard shortcuts

How Has This Been Tested?

I recorded a video of manual testing.
https://github.com/langgenius/dify/assets/11357019/4045181b-3b49-4a10-a15e-5e5c3ca518f3

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
  • optional I have made corresponding changes to the documentation
**Original Pull Request:** https://github.com/langgenius/dify/pull/3927 **State:** closed **Merged:** Yes --- # Description This resolves #3911 by introducing zundo to create a zustand store for creating a history over changs in the workflow editor. The workflow store as well as the reactflow store remain untouched. ### UI Elements Buttons are added to the UI for both Workflow and Chatflow Editor: ![image](https://github.com/langgenius/dify/assets/11357019/2e282ae1-a7bd-45c4-b742-98fdbb717a52) ### Change History I also added a way to see all changes and navigate through the history. ![image](https://github.com/langgenius/dify/assets/11357019/f180fedf-b4cb-4c69-bc20-da2ef03a026a) ### Translations I provided translations for all currently supported languages. However, apart from EN and DE, I had all translations generated by AI. ### Keyboard Shortcuts Common keyboard shortcuts are also supported. - **Undo** - **Windows/Linux**: `Ctrl` + `Z` - **macOS**: `Cmd` + `Z` - **Redo** - **Windows/Linux**: `Ctrl` + `Y` or `Ctrl` + `Shift` + `Z` - **macOS**: `Cmd` + `Shift` + `Z` or `Cmd` + `Y` ## Current Limitations - InputChange events in Node Panels do not trigger state changes. - This is an issue we need to adress since it also affects the sync workflow darft feature - Resizing UI elements does not trigger state changes. - But I think we can ignore them anyway ## Type of Change - [x] New feature (non-breaking change which adds functionality) - [x] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - We might want to add documentation about the limitations - We might want to document this feature incl. keyboard shortcuts # How Has This Been Tested? I recorded a video of manual testing. https://github.com/langgenius/dify/assets/11357019/4045181b-3b49-4a10-a15e-5e5c3ca518f3 # Suggested Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods - [ ] `optional` I have made corresponding changes to the documentation
yindo added the pull-request label 2026-02-21 20:22:48 -05:00
yindo closed this issue 2026-02-21 20:22:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#24333