show more relevant presets when switching preset of an object#10138
Draft
show more relevant presets when switching preset of an object#10138
Conversation
suggestions are based on the object's previous preset: * if it was part of a category, show that category again (e.g. editing a `highway=primary` will offer the "Major Roads" category) * if a preset has sub-presets: offer up to 5 of these (e.g. `barrier=kerb` will offer presets like Raised Curb, Lowered Curb, etc.) * show the "partent" i.e. more generic preset if there is a matching one * show up to 5 "sibling" presets this also increases the number of shown previously used presets from 4 to 5. todo: * should these be sorted differently, e.g. before the previously used presets)? * should there be a visual separation between these suggestions, the recents and the defaults * investigate if better candidates could be found when many siblings exist * add mechanism to show more related presets (or recently used presets) * write test cases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
buildingfeature 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=shoestoshop=clothesif 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=primarywill offer the "Major Roads" category)barrier=kerbwill 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=yesmight more likely be changed to a common building type likebuilding=house, compared to something rare likebuilding=yurtfor 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. ↩