Feature Request: Confirm Delete Flow

:thought_balloon:

As the title states, a great opportunity to improve the user experience would be a Confirm dialog - such as the one used when there are errors on the flow, with a Confirm button when a user is going to delete a flow from the context menu.

Due to lack of this feature, Node-RED just bit me in the butt because as I was about to rename a flow (that took nearly 20 minutes to wire up), my mouse jumped down just a hair and the whole flow disappeared from my eyes.

Whilst not addressing your issue,

You can possibly recover the flow you have lost.
Assuming you had deployed the flow first, after accidentally deleting something. Kill Node-RED restart and it will load the flow file saved on the last deploy.

(the previous deployed file is also saved as a hidden file within your .node-red directory)

You can also rename a flow by double clicking on the tab, avoiding the menu system.

1 Like

Probably too late now, but a quick Ctrl-Z would have undone the delete.

But your wider point is taken - we try to balance the user experience of nagging with dialogs when the user has purposefully taken an action, versus when we want them to be really sure they mean to do what they are doing.

As deleting a flow can be easily undone, it has not had a confirm dialog added. Other actions, such as removing a node from the palette, is a more drastic action so we do prompt in that case.

2 Likes

Since I'm assuming deleting flows is a rare occurrence, wouldn't adding this additional "check" create more benefit than hinderance?

1 Like

Speaking just selfishly - no.

The thing is, when is a flow a flow and not just a single node and should there be a warning even for a single node being deleted?

As I often use Node-RED for prototyping, I may well be very rapidly adding and deleting nodes and flows. For me, the extra check would drive me mad in short order I'm afraid.

As Nick says, since ctrl-z works just fine, I can't see much benefit of this.

2 Likes

I'm with you, ctrl-z works fine.

Now, if only we had Ctrl-y to redo changes that we have undone...

or has that shortcut already been added to some newer version than what I'm running?

1 Like

if (nr.config.confirmDelete) showConfirm()

Then we get the best of both worlds?

In general we don't add individual settings for things like that - otherwise you end up with 1001 options that rarely get touched by 99% of users. We prefer to get the UX right from the start. Right now I'm happy to let this thread gather opinions and we'll look at it again later.

1 Like

I think most users would not expect UNDO to work on deleting a flow. So maybe, a discrete toast showing "Flow deleted - UNDO to revert", although I'm not personally a big fan of toasts.