Show conflicting tags in merge operation tooltip#12367
Open
Xaves23 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the merge operation UX so that when a merge is blocked due to tag conflicts, the tooltip can list which tag keys are conflicting (addressing #11406).
Changes:
- Extend
actionJoin.disabled()to report conflicting tag keys along with theconflicting_tagsreason. - Update merge operation tooltip logic to show a detailed
conflicting_tagsmessage including the key list. - Adjust join action tests to accommodate the updated
disabled()return shape for conflicting tags.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
modules/actions/join.js |
Returns conflict details (type + conflicting keys) when tag conflicts prevent joining ways. |
modules/operations/merge.js |
Unwraps the join action disabled reason and conditionally displays a detailed tooltip including conflicting keys. |
data/core.yaml |
Adds a new localized string for the detailed conflicting-tags tooltip message. |
test/spec/actions/join.js |
Updates expectations for conflicting_tags to match the new disabled-reason structure. |
Comment on lines
210
to
212
| if (conflicting) { | ||
| return 'conflicting_tags'; | ||
| return { type: 'conflicting_tags', keys: conflictingKeys }; | ||
| } |
Comment on lines
+84
to
+88
| if (disabled === 'conflicting_tags') { | ||
| var actionDisabled = _action.disabled(context.graph()); | ||
| if (actionDisabled.keys && actionDisabled.keys.length) { | ||
| return t.append('operations.merge.conflicting_tags_details', | ||
| { keys: actionDisabled.keys.join(', ') }); |
| ]); | ||
|
|
||
| expect(iD.actionJoin(['-', '=']).disabled(graph)).to.equal('conflicting_tags'); | ||
| expect(iD.actionJoin(['-', '=']).disabled(graph)).to.deep.include({ type: 'conflicting_tags' }); |
Comment on lines
+622
to
623
| expect(iD.actionJoin(['-', '=']).disabled(graph)).to.deep.include({ type: 'conflicting_tags' }); | ||
| }); |
Comment on lines
+633
to
634
| expect(iD.actionJoin(['-', '=']).disabled(graph)).to.deep.include({ type: 'conflicting_tags' }); | ||
| }); |
Comment on lines
+644
to
645
| expect(iD.actionJoin(['-', '=']).disabled(graph)).to.deep.include({ type: 'conflicting_tags' }); | ||
| }); |
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 #11406
When merging ways, tags are checked to see if a conflict exists. The tool tip did not give hints on which tags were conflicting. Now the conflicting tags are listed in the conflicting tag merge operation tool tip.
Before
"These features can't be merged because some of their tags have conflicting values."
After
"These features can't be merged because some of their tags have conflicting values: natural, surface"
Example screenshot:
