Skip to content

Indicate applied and partially applied relations for multi-selection#11949

Draft
aditya1010-max wants to merge 1 commit intoopenstreetmap:developfrom
aditya1010-max:relations-dropdown-ui
Draft

Indicate applied and partially applied relations for multi-selection#11949
aditya1010-max wants to merge 1 commit intoopenstreetmap:developfrom
aditya1010-max:relations-dropdown-ui

Conversation

@aditya1010-max
Copy link

@aditya1010-max aditya1010-max commented Mar 1, 2026

When multiple entities are selected, the raw membership editor now indicates
whether a relation applies to all selected entities or only a subset.

  • Shows “Applied" when a relation includes all selected entities
  • Shows “Partially Applied” when a relation includes some of them
  • Preserves existing behavior for single selection

This PR addresses one aspect of issue #10981

@tordans
Copy link
Collaborator

tordans commented Mar 2, 2026

@aditya1010-max before look into this…

  • remember to use let/const for new code
  • UI: add (a) space between word
  • UI suggestion: I suggest to move the new feature to a pill/badge like look to the right of the line https://tailwindcss.com/plus/ui-blocks/application-ui/elements/badges
  • please explain why this is a draft and what you plan to do before un-drafting
  • please move the relevant parts of your comment on the issue here; we want the conversation about the implementation in one place (here); not scattered on issue and PR

UI:
I wonder if we want this red-green look here. Its more of a "warning", "all good" signal where this information is more of an FYI, right? We could make both just a gray FYI label… – Lets see what others say.

Comment on lines +355 to +368
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont quite see the value in having this extracted and then only used once.

Suggested change
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants