Skip to content

Feature Request: Add Undo/Redo functionality to NodeEditor #467

Description

@drongh-bot

Description

It would be a great enhancement to add Undo/Redo (Ctrl+Z / Ctrl+Y) support to the ktsu.ImGui.NodeEditor. Currently, managing mutations and accidental edits in complex node graphs can be difficult for users without a history stack.

Proposed Solution

Implementing a history/command pattern or snapshot system that tracks common graph state mutations, including:

  • Node Operations: Adding, deleting, and duplicating nodes.
  • Connection Operations: Creating or destroying edges/links between sockets.
  • Transformations: Dragging/moving node positions.
  • Data Mutations: Internal property changes within custom nodes (if applicable).

Additional Context

Since ktsu.ImGui.NodeEditor utilizes ForceDirectedLayout for graph simulations, the Undo/Redo stack might need to smoothly restore layout states or snapshot node positions efficiently.

Are there any existing plans or architectural preferences (e.g., Command Pattern vs. State Snapshots) for introducing history management to this library? I'd love to hear your thoughts!

Activity

  1. matt-edmondson commented on Sep 25, 2026

    @matt-edmondson
    Contributor

    ktsu.UndoRedo and ktsu.Keybinding already exist for this purpose, and I've glued them together in the ktsu.Schema project if you want an example in the short term, but I would like to add first class support for them in the node editor too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions