Indicate applied and partially applied relations for multi-selection#11949
Indicate applied and partially applied relations for multi-selection#11949aditya1010-max wants to merge 5 commits intoopenstreetmap:developfrom
Conversation
|
@aditya1010-max before look into this…
UI: |
| var count = relationCounts.get(entity.id) || 0; | ||
| var flags = { | ||
| isCommon: count === selectedEntities.length, | ||
| isPartial: count > 0 && count < selectedEntities.length | ||
| }; | ||
|
|
||
|
|
||
| result.push({ | ||
| relation: entity, | ||
| value, | ||
| display: baseDisplayLabel(entity) | ||
| display: baseDisplayLabel(entity, flags), | ||
| title: value, | ||
| isCommon: flags.isCommon, | ||
| isPartial: flags.isPartial |
There was a problem hiding this comment.
Dont quite see the value in having this extracted and then only used once.
| var count = relationCounts.get(entity.id) || 0; | |
| var flags = { | |
| isCommon: count === selectedEntities.length, | |
| isPartial: count > 0 && count < selectedEntities.length | |
| }; | |
| result.push({ | |
| relation: entity, | |
| value, | |
| display: baseDisplayLabel(entity) | |
| display: baseDisplayLabel(entity, flags), | |
| title: value, | |
| isCommon: flags.isCommon, | |
| isPartial: flags.isPartial | |
| const count = relationCounts.get(entity.id) || 0; | |
| result.push({ | |
| relation: entity, | |
| value, | |
| display: baseDisplayLabel(entity, flags), | |
| title: value, | |
| isCommon: count === selectedEntities.length, | |
| isPartial: count > 0 && count < selectedEntities.length |
There was a problem hiding this comment.
Thanks- Agreed. Since it’s only used once, I’ll simplify this.
|
Thanks for the feedback. I’ll update the new code accordingly and also fix the spacing issues. I like the suggestion of moving this to a pill/badge-style element on the right. I’ll explore different implementations and update the UI based on that direction. This PR is marked as draft to get early feedback and iterate on UI details. Before un-drafting, I plan to address the UI feedback and make sure the behavior is aligned with expectations. Regarding the green/orange signaling, I agree it’s quite bold and doesn’t align well with the iD style. A neutral FYI-style label makes more sense here, and I’m happy to adjust based on what others think. I’ll also take the other suggestions into consideration. |
|
I have addressed the feedback above and pushed the latest updates. I would really appreciate any additional thoughts on the UI direction, especially around font size, spacing, background/border colors, or overall badge styling. If there are existing patterns in iD that this should align more closely with, I am happy to adjust it accordingly. I will keep this PR in draft for a few more days while I review edge cases and look into adding tests where appropriate. If there are specific scenarios you’d like me to cover, please let me know. I’ll follow up here once that’s complete. |


Summary
This PR improves the discoverability of applied relations in the relations dropdown. While the dropdown already lists nearby relations, it is not currently clear which of those relations are applied to the current selection.
This change surfaces that information directly in the UI.
Behavior
These labels reflect existing state only and do not alter how relations are created or managed.
Scope / Non-goals
More invasive approaches (such as enforcing constraints or modifying actions) are intentionally left out of scope for this PR.
This PR addresses one aspect of issue #10981.