openstreetmap / iD

🆔 The easy-to-use OpenStreetMap editor in JavaScript.
https://www.openstreetmap.org/edit?editor=id
ISC License
3.34k stars 1.2k forks source link

Warn upon throwing away multi-selection #10446

Open jidanni opened 3 weeks ago

jidanni commented 3 weeks ago

Description

Here we are, multi-selecting several different roads, points, etc., via SHIFT+CLICK.

Problem is that one accidental non SHIFT+CLICK will lose them all, and we need to select them all over again.

No, one cannot always just do a lasso selection.

Yes, if this were an edit, we could just click undo. But we haven't made an edit yet. We are just in the process of multi-selecting items.

No, I don't know the best way to "fix" this.

Wait! Perhaps add a warning:

You have already multi-selected 7 items. Are you sure you want to deselect them all?

Dimitar5555 commented 3 weeks ago

If such events are tracked (as "Cleared selection" for example), it would be easy to undo it. I think that I've seen something similar in an Office program or some image editor.

Should iD record each individual selection/deselection, or should it group consecutive selects/deselects into a single event?

If we choose the first option, maybe we should have a separate stack just for select/deselect events. Otherwise the undo/redo stack might become a bit crowded.

k-yle commented 2 weeks ago

Should iD record each individual selection/deselection, or should it group consecutive selects/deselects into a single event?

Since selections don't actually modify the main state (the 'graph'), it would be a bit confusing and buggy to include them in the same stack used by the undo/redo buttons.

A potentially simpler solution is to show a popup warning before cancelling a multi selection, but only if >10 features are selected (or some other arbitrary limit)

jidanni commented 2 weeks ago

>10? I'd say even >1.

The user is throwing away their multiselection, which doesn't make sense: Why did they bother making a multiselection in the first place but now change their mind and want to throw it away?

And they are not throwing it away by explicitly reducing it item by item, but instead via one rash move that has an 80% chance of simply being their finger is not fully placed upon the shift button etc.

Therefore a polite "...are you sure?" message is called for.

Also in my experience there is no way a user could multiselect 10 items successfully one by one in the first place without something going wrong before they got to number 10.

For me even by the time I have multiselected just five items I get so nervous that I push Save to save my edits before something goes wrong and I lose my multiselection.