OpenFn / OpenFn/lightning

Undo-redo: work out what to do about invisible state changes

Open
#3,379 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature enhancement
Dominant language
Elixir
Stars
296
Forks
86
Avg merge
1d 13h
Merged PRs (30d)
50

Description

There are a bunch of undo actions which the user might not see.

For example, changing the manual/auto layout option, changing workflow options (like toggling console.logs), or editing job expressions.

These actions either have no visual component, or that visualisation isn't visible from the canvas.

There are basically two options here...

1. Notify users what has been undone or redone

If we can work out a simple natural language label for each action (remove step, edit step label, add edge), we can display a brief notification to alert users what is happening.

I think there are two options here:

a) show a tooltip on the buttons in the react-flow toolbar
b) display a toast or flash notification (but don't make it annoying)

In both cases we have to work out what to do when there are many rapid undo/redo actions

2. Don't support undo for actions that might be invisible

Basically this means don't allow undo-redo on option changes or expression changes.

The problem with this is that applying patches to roll back state gets very tricky if some diffs are ignored. It can create confusing situations where your job expression gets reset just because you deleted a node.

We weren't able to get this working during prototyping 🤷

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the undo/redo state handling and the React Flow toolbar mentioned in the issue. Compare the notification and exclusion approaches, including rapid actions and invisible option or expression changes. Done means a decided behavior with a clear user-facing result and consistent rollback semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir, react
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.