Opened 2 years ago

Closed 23 months ago

#22300 closed enhancement (duplicate)

Not possible to undo merge layer / merge selection command

Reported by: olejorgenb Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: merge undo Cc:

Description (last modified by olejorgenb)

This just lost me about an hour of manual work after mistakenly merging my whole workset into my "done" layer :(

Tip to future travelers: If I had kept a temporary "in-progress" tag on my workset I could have recovered.

Attachments (0)

Change History (8)

comment:1 by olejorgenb, 2 years ago

Description: modified (diff)
Type: defectenhancement

comment:2 by taylor.smock, 2 years ago

We really don't have a good way of undoing layer merges. I rather suspect that undo isn't available to avoid data integrity issues.

From my experience (MapWithAI plugin), it is a PITA to ensure that things go correctly when moving stuff between data sets. Making things go one way "fixes" a lot of the issues I ran into, since you just have to copy the data one way. With undo/redo, you have to keep references hanging around to ensure that other commands don't get borked due to the undo/redo commands.

With that said, depending upon how often you upload, you might have been able to use a search for new. Or modified, depending. See wiki:Help/Action/Search

comment:3 by anonymous, 2 years ago

Yeah I can see it becoming complex. I was not aware of the new/modified filter. Not sure if it would've helped, but nice to know. Probably best solved by adapting a more robust workflow.

comment:4 by GerdP, 2 years ago

We have merge code in the reverter plugin which allows undo/redo. Maybe it can go into core?

in reply to:  4 comment:5 by taylor.smock, 2 years ago

Replying to GerdP:

We have merge code in the reverter plugin which allows undo/redo. Maybe it can go into core?

I wasn't aware of that the reverter plugin had undo/redo code across layers.

Since we have at least two plugins trying to support undo/redo across layers (reverter/MapWithAI), I think it would be nice to put it in core, especially since we have a potential core usecase. This might also be useful for the conflation plugin. If it doesn't have code doing that already.

My proposal:

  1. New interface (MoveDataSetCommand, probably parameterized to allow for data transfer across distinct data types, e.g. HistoryNode -> Node)
  2. Require the implementation of getParticipatingPrimitives(OsmData<?, ?, ?, ?> data) in the interface, have a default implementation of getParticipatingPrimitives() set to call getParticipatingPrimitives with the current edit layer or null.
  3. In the UndoRedo handler, check for the interface and use the current edit layer to figure out if it is relevant for the current edit layer.

comment:6 by olejorgenb, 2 years ago

Note: I managed to make the mistake again (but this time I had a semi-recent save and managed to grab the autosave as well). I'm quite sure it happens for me due to the very similar hotkeys: Ctrl-M for "merge layer" and Ctrl-Shift-M for "merge selection". The resulting dialog is very not *that* different and when doing repetitive work the brain easily skips the button text which.

The hotkey for merge layer is easy to disable. I'm quite sure this will solve my problems.

Version 1, edited 2 years ago by olejorgenb (previous) (next) (diff)

comment:7 by GerdP, 2 years ago

As a workaorund you may assign a different hotkey to one of the actions or remove it.

comment:8 by skyper, 23 months ago

Keywords: merge undo added
Resolution: duplicate
Status: newclosed

Closed as duplicate of #7489.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.