feat: Prioritize parent relations of connected features in relation dropdown menu#11896
Conversation
|
On which usecase you have tested it? Can you attach screenshot/video of testing? |
|
Before : simplescreenrecorder-2026-03-01_19.06.25.online-video-cutter.com.mp4After : pritorizes the relations of the neighouring/parent ways simplescreenrecorder-2026-03-01_19.14.22.online-video-cutter.com.mp4 |
| const selected = graph.hasEntity(entityID); | ||
|
|
||
| if (selected) { | ||
| let connectedWays = []; |
There was a problem hiding this comment.
maybe it would be nice to also make it a set to avoid the same way potentially being added multiple times?
| }); | ||
| } | ||
|
|
||
| connectedWays.forEach(way => { |
There was a problem hiding this comment.
I guess we can care here only about way relation members and ignore cases where nodes are relation members, as those are quire exotic
| } | ||
|
|
||
| result.sort(function(a, b) { | ||
| const aConnected = connectedRelationIDs.has(a.relation.id); |
There was a problem hiding this comment.
are more clear variable names possible? Admittedly I tries to find some that would not require me to drawing diagram to understand logic of this sort and failed.
There was a problem hiding this comment.
pr maybe just put here comment of // if exactly one of two relations is connected to our selection - prefer it over unconnected
or is it stating obvious and I for some reason have trouble to understand obvious here?
…-of-connected-features
fixes #11676
this pr uses the logic given by @k-yle in #11683 (comment) to
prioritize parent relations of connected features in relation dropdown.