#5114 - Relation suggestions hidden even when stacking is enabled#6008
Merged
reckart merged 2 commits intoMay 6, 2026
Conversation
- Relation suggestion visibility now compares the suggested label against existing relations at the same (source, target) position instead of hiding the whole group as soon as any labeled relation exists there - Suggestions whose label differs from existing relations stay visible when the layer's overlap mode allows stacking (`ANY_OVERLAP` / `STACKING_ONLY`) - Duplicate-label suggestions and label-less suggestions are still hidden, and different-label suggestions remain hidden when stacking is disabled - Added test coverage in `RelationSuggestionVisibilityCalculationTest` for: free position, duplicate label, different label without stacking, different label with stacking (the bug case), duplicate label with stacking, and rejected-learning-record matching/non-matching labels
There was a problem hiding this comment.
Pull request overview
Fixes relation suggestion visibility so that, when the relation layer allows stacking, suggestions with a different label than existing relations at the same (source,target) endpoints remain visible (while duplicates remain hidden), and extends unit tests to cover these cases.
Changes:
- Refined relation overlap/duplicate detection to compare suggestion labels against existing relations at the same
RelationPosition, allowing different-label suggestions when stacking is enabled. - Kept hiding for label-less suggestions and same-label duplicates; continued respecting correction-suggestion semantics.
- Added/expanded unit tests covering free positions, duplicate labels, different-label behavior with/without stacking, and learning-record rejection label matching.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| inception/inception-layer-relation/src/main/java/de/tudarmstadt/ukp/inception/annotation/layer/relation/recommender/ArcSuggestionSupport_ImplBase.java | Updates relation suggestion visibility logic to be label-aware and stacking-aware per (source,target) position. |
| inception/inception-recommendation/src/test/java/de/tudarmstadt/ukp/inception/recommendation/relation/RelationSuggestionVisibilityCalculationTest.java | Adds targeted tests for visibility behavior across stacking modes, labels, and rejected learning records. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix `RelationSuggestionSupport.acceptSuggestion` overwriting an existing relation's label when stacking is enabled: skip the candidate-upsert search for non-correction suggestions on stacking-enabled layers so the suggestion creates a new stacked relation instead. - Added tests
025f51c to
f7e2691
Compare
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.
What's in the PR
ANY_OVERLAP/STACKING_ONLY)RelationSuggestionVisibilityCalculationTestfor: free position, duplicate label, different label without stacking, different label with stacking (the bug case), duplicate label with stacking, and rejected-learning-record matching/non-matching labelsHow to test manually
Automatic testing
Documentation