show more relevant presets when switching preset of an object #10138
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When changing the preset of an existing object, the preset list currently contains a few of the recently used presets and a relatively long "default" list of presets which match the selected feature's geometry. Listing the completely context-less list of "defaults" is in general not very useful: it is pretty unlikely that one wants to change a
building
feature to something completely different like a park for example.1 Usually one wants to change an object's preset to either refine it (choosing to a more specific sub-preset, e.g. from a Doctor to a General Practitioner), or update the map by choosing a closely related preset (e.g. when switching from ashop=shoes
toshop=clothes
if a POI changed in reality or the POI was previously mapped incorrectly).In this PR, the suggestions are based on the object's previous preset:
highway=primary
will offer the "Major Roads" category)barrier=kerb
will offer presets like Raised Curb, Lowered Curb, etc.)(currently this also increases the number of shown previously used presets from 4 to 5, see #9545)
Some unfinished business:
building=yes
might more likely be changed to a common building type likebuilding=house
, compared to something rare likebuilding=yurt
for example)Footnotes
There is a little bit of merit to not completely omit showing these defaults, tough: It teaches the mapper that there are many very different thing one can map in OSM: e.g. from natural features, landuse and water features, to points of interest, etc. ↩