Fix region-specific presets in Recently Used list (#11405)#11906
Open
Kayd-06 wants to merge 1 commit intoopenstreetmap:developfrom
Open
Fix region-specific presets in Recently Used list (#11405)#11906Kayd-06 wants to merge 1 commit intoopenstreetmap:developfrom
Kayd-06 wants to merge 1 commit intoopenstreetmap:developfrom
Conversation
Contributor
|
in which way, if any, it is superior to #11810 ? |
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.
Fixes #11405
Summary
Region-specific presets (e.g.
motorway_link-US) could occupy slots in the“Recently Used” list but not appear in the UI when editing in a location
where that preset variant was invalid.
Problem
presetIndex.defaultsfiltered presets bylocationSetafter selectingrecent presets. If a region-specific preset was invalid for the current
location, it was removed without attempting to replace it, which could
result in unused (“ghost”) slots in the Recently Used list.
Solution
Update
presetIndex.defaultsto:matchTagsisEqual(to avoid unintended preset switching)If no equivalent preset exists, the invalid regional preset is removed.
Tests
Added regression tests to
test/spec/presets/index.jsto verify: