Add "delete" (×) button next to each changeset comment in dropdown
Description
descripton :
When entering a new changeset comment in the Upload to OpenStreetMap panel, the previously entered comments appear in a dropdown. I’d like to have a "×" (cross/delete) button next to each comment in the dropdown list to allow removing individual saved comments.
proposed behavior :
-
Add a small × icon next to each dropdown comment.
-
On clicking the × icon then:
- the selected comment is deleted from the saved history.
- it no longer appears in future sessions.
Screenshots
As you can see in this image there is no option to remove a particular comment from the dropdown.
@tyrasd what's your opinion in this feature ?
IMO this is a reasonable use case. Sometimes the user makes a typo or a one-off comment that they don’t want interfering with their selection of previous changeset comments. Some browsers have a similar feature in native <select> elements. For example, Firefox has a hidden feature allowing you to highlight an option in the dropdown menu and press CtrlShiftBackspace (⇧⌥⌦ on macOS) to delete it from history.
The changeset comment history comes from an OSM API call. There’s no special storage of this history; it’s literally the history of changesets you’ve saved. Curating the history would require putting something either in your OSM account or in local storage.
https://github.com/openstreetmap/iD/blob/74728c51d4a69a10798609f2eb98d505e80ed0e5/modules/ui/changeset_editor.js#L74-L80
@1ec5 @tyrasd i have made a small video regarding this : https://www.loom.com/share/92bd1455f0d34e12b3cf51d8d5b8336f?sid=067be99e-2b61-4d58-b180-4c09f27da602 basically
- i have made cross button on every comment
- then on clicking the cross button i add that comment in localstorage .
- then i use the filter method for removing the delete comment from the variable which contain all the comments. if you seem any issue you can tell me else i can send its PR :)
This would seem sensible, as it mirrors native browser behaviour.
(Mac / Chromium 136.0.7103.93)