Skip to content

Conversation

@bra-i-am
Copy link

@bra-i-am bra-i-am commented Jan 9, 2026

This pull request introduces enhanced support for bulk selection and management of collections and their components in the library authoring interface. The main changes add the ability to select entire collections, track selection status (selected/indeterminate), and ensure consistent UI feedback when interacting with collections and their components. Filtering logic has also been updated to ensure all relevant items remain available for selection workflows.

Bulk selection and collection management:

  • Added new types and state management in ComponentPickerContext.tsx to track selected collections and their status (selected or indeterminate). Also introduced logic for updating collection selection status when components are added or removed, supporting both individual and bulk operations. [1] [2]
  • Updated the AddComponentWidget to support bulk selection of all components in a collection, including logic to build component lists and count collection membership. The widget now displays checkboxes that reflect collection selection status and supports indeterminate states. [1] [2] [3]

UI integration and feedback:

  • Modified CollectionCard and ComponentCard to use the updated AddComponentWidget, enabling bulk selection on collection cards and correct checkbox display for both collections and components. [1] [2] [3] [4]

Filtering logic improvements:

  • Changed backend and frontend filtering logic in LibraryAuthoringPage.tsx and LibraryContent.tsx to ensure all components remain available for selection, even when viewing the Collections tab. This supports workflows where components are added to xblocks by selecting an entire collection. [1] [2] [3]

Context and provider updates:

  • Updated context provider return values and memoization to include the new selectedCollections state, ensuring all components have access to the latest selection data. [1] [2]

How to test

Make sure you have a collection in your Libraries ( http://apps.local.openedx.io:2001/authoring/libraries ) with questions in it

  1. Have a Teak environment
  2. Mount this MFE and switch to this branch
  3. Install https://github.com/eduNEXT-collab/xblock-exam-question-bank in the CMS
  4. Go to the Authoring MFE ( http://apps.local.openedx.io:2001/authoring/ ), create a new course or use any existing one, go to Settings > Advanced Settings and add "examquestionbank" to the list of Advanced module list
  5. Go to the content outline and access a unit
  6. Click Advanced in the component selector and add an Exam Question Bank
  7. Click Add Problems and select a collection; it should be selected and deselected properly, and once you click Add Selected Components, they should be displayed in the xblock as will be shown in the following screencast

Screencast

Screencast.from.09-01-26.14.40.43.webm

@bra-i-am bra-i-am marked this pull request as ready for review January 14, 2026 13:14
@MaferMazu MaferMazu self-requested a review January 15, 2026 15:55
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