-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autocomplete to support distinguisher labels in case of shared preferred labels #1380
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1380 +/- ##
============================================
- Coverage 71.17% 70.20% -0.97%
- Complexity 1650 1664 +14
============================================
Files 32 32
Lines 3788 4293 +505
============================================
+ Hits 2696 3014 +318
- Misses 1092 1279 +187
☔ View full report in Codecov by Sentry. |
SonarCloud Quality Gate failed. 0 Bugs No Coverage information |
Thank you for these @frosterus ! We discussed the proposed UI alternatives and preferred the second one. However we would like to see that option in a three different modified versions:
Also we would like to see this implementation as a step towards a solution in which all the extra information to the label in the autocomplete list (including concept type) would be configurable and included or left out all together. |
After review, the suggestion was to go with the latter approach but move the type indication to the top line and force it there (so if the label does not fit, it will go to two lines but the type indication is always on the top line). |
… label if long enough
… on top of the suggestion, concept label is on the first row with the type information only if it fully fits there, otherwise drops on the next row
SonarCloud Quality Gate failed. 0 Bugs No Coverage information |
I have now updated this PR based on #1380 (comment). I had a conversation with @jarmosaarikko about how long labels should be wrapped altogether with the type information (which was not detailed in the aforementioned comment) and we concluded that it would be better to not wrap the concept label element in case it does not fully fit with the type information. See the image below. Also, it was discussed that would be better to break at word boundaries (determined by the user's browser), however, there is a caveat: this does not fully work in case there are long lists of single-word types (or distinguishers) in either As a last note: in order to force type on the first row I switched the type-including element before the label element (which I wrapped in a wrapper element). This may be semantically wrong (WCAG-wise), however, proper fix would most likely require a flexbox-reaching approach (via |
I agree that the prefix setting is a bit problematic (which is why it is stated in the OP under the section The issue you had with your example And yes, distinguishers are listed with a comma but without spaces because that is the way they are now implemented in the autocomplete in case there are multiple types. This can be changed but I would suggest to change it in both places, simultaneously. |
afer commas for multiple values.
SonarCloud Quality Gate failed. 0 Bugs No Coverage information Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
I have the same concerns as @joelit - it seems like a very generic configuration mechanism, but the configuration syntax is ad-hoc and potentially fragile. Nevertheless there is a clear need for this, and it doesn't seem to break anything we currently have in Skosmos or Finto, so I think this can be merged for Skosmos 2.x. For Skosmos 3, where the autocomplete component hasn't yet been implemented, I think we need to have a new discussion about the requirements. I've understood that the data model for the Metadata Vocabulary is probably going to change as well in the near future. I think that for Skosmos 3 it would be better to implement an autocomplete component with support for a relatively short selection of distinguishers (e.g. rdf:type, skos:inScheme, inverse skos:member) that can be enabled or disabled per vocabulary as needed, instead of attempting a more generic mechanism which has lots of pitfalls. I will merge this now, so we can release it as part of the upcoming Skosmos 2.17 release. |
Reasons for creating this PR
There are vocabularies (such as https://dev.finto.fi/mts/fi/) that require shared preferred labels (e.g., "opettaja") to exists in different parts of the vocabulary. However, in the past it was impossible to distinguish between autocomplete hits, see #1335 for more information.
Link to relevant issue(s), if any
Description of the changes in this PR
This PR bring in the ability to differentiate between identical autocomplete results via special vocabulary-specific
skosmos:resultDistinguisher
. Only works in case a single vocabulary search is initiated.Known problems or uncertainties in this PR
Possible enhancements still to be done
skosmos:alphabeticalListQualifier
?Checklist
.sr-only
class, color contrast)