Fix/5524 collection selector hide communities#5882
Conversation
|
@shernandez-dev Thanks for your contribution, and identifying the secondary issue on this component! @tinsch Since you reported the original issue about the collection selector, would you by chance be interested in testing this to confirm if this addresses the usability concerns appropriately? |
|
@lgeggleston yes I am happy to test this 👍 |
|
@shernandez-dev thanks for the fix! I tested it and the UX is much better now. The tree structure between communities and collections is visible and it is clear only collections are selectable. The toggle between "Whole repository" und collections also works well 👍 |
|
While the grouped presentation is much clearer than the previous flat list. However, I noticed one usability regression in the new design The previous
With the new button-based selector, we lose all of these and can only click every collection individually, which feels like a significant usability regression BeforeTested on demo.dspace.org before.webmAfterafter.webm |
References
Description
Replaces the flat
<select>list in the Metadata Query Report Collection Selector with a grouped tree-style selector that shows communities as non-selectable headers and collections as clickable options, eliminating the confusion caused by unselectable community entries mixed with collections.Instructions for Reviewers
Root Cause
The
loadCollections()method inFilteredItemsComponentbuilt a flatOptionVO[]array by mixing communities (markeddisabled=true) and collections together in a single<select multiple>element. Communities appeared as entries that users could not select, and when many communities appeared at the top of the list, it was unclear whether anything could be selected at all.Changes
filtered-items.component.ts:CollectionGroupinterface to group collections under their parent communitycollectionGroups: CollectionGroup[]propertyloadCollections()to no longer push communities as disabled<option>entries — instead, each community becomes a group header with its collections as selectable itemstoggleCollection(collectionId: string)method to handle multi-selection via clickisCollectionSelected(collectionId: string)method to track selected statecollections: OptionVO[]is still maintained for form compatibility withtoQueryString()toggleCollection()to enforce mutual exclusion between "Whole Repository" and specific collections — selecting one automatically deselects the other (Administrator Reports - Metadata Query: "Whole Repository" and specific collections can be selected simultaneously in Collection Selector #5883)filtered-items.component.html:<select multiple>with a custom list using Bootstraplist-group-itembuttonstext-muted smallnon-interactive headersfw-boldclickable buttons withbg-primaryhighlight on selectiondso-selector), as suggested in the issue discussion. A full reuse of thedso-selectorcomponent was considered but not pursued, as that component is designed for single selection and would require significant refactoring to support multi-selection. Instead, the same visual hierarchy (community as breadcrumb context, collection as bold selectable item) was replicated using standard Bootstraplist-group-itembuttons, keeping the change isolated to this component.filtered-items.component.spec.ts:loadCollections(),toggleCollection(), andisCollectionSelected()Before
Communities and collections mixed in a flat
<select>list. Communities appeared as unselectable entries, making it unclear what could be selected:After
Communities shown as non-interactive group headers (grey, small text). Collections shown as bold clickable buttons with highlight on selection:
How to Test
Reproduced and confirmed on DSpace 9.x and DSpace 10.0 (as reported in the original issue).
Checklist
mainbranchnpm run lintfails with a pre-existing error unrelated to this fix (src/themes/custom/eager-theme-components.ts). ESLint was run directly on the 3 modified files and passes without errors.npx madge --circularon the affected directory)