Skip to content

Conversation

@bra-i-am
Copy link
Contributor

@bra-i-am bra-i-am commented Jan 14, 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

@openedx-webhooks
Copy link

openedx-webhooks commented Jan 14, 2026

Thanks for the pull request, @bra-i-am!

This repository is currently maintained by @bradenmacdonald.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jan 14, 2026
@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Jan 14, 2026
@bra-i-am bra-i-am changed the title Bc/allow selecting collections feat: enable to select collections as components in problems picker Jan 14, 2026
@bradenmacdonald
Copy link
Contributor

Very cool! @edschema or @sdaitzman could you please review this draft contribution from a product perspective? (see video)

@bra-i-am bra-i-am marked this pull request as ready for review January 14, 2026 19:12
@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 75.51020% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.98%. Comparing base (969f7a2) to head (c751d18).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...uthoring/common/context/ComponentPickerContext.tsx 54.71% 24 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2824      +/-   ##
==========================================
- Coverage   95.04%   94.98%   -0.07%     
==========================================
  Files        1265     1265              
  Lines       29128    29243     +115     
  Branches     6630     6455     -175     
==========================================
+ Hits        27686    27776      +90     
- Misses       1384     1409      +25     
  Partials       58       58              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@edschema
Copy link

Will review this and provide some product/UX thoughts this week! @bra-i-am this is great!

@sdaitzman
Copy link

Hi @bra-i-am, thank you for contributing this! From a product standpoint, it's great to add easier ways for users to reuse content from their libraries in bulk.

Recommendation 1: I don't think it makes sense to include an additional problem-bank-like block that supports this, and would strongly recommend keeping this feature as an option within the existing problem bank rather than adding a special block type.

Question: in the current implementation, when a collection is selected and saved, then new items are added to that collection on the library-side and published, can the new objects be "synced in" somehow? If not, I think this is a bit more like a "Bulk Add" shortcut workflow, vs. a true "Select Collection" workflow.

Longer-term, I think it's worth enhancing the workflow to allow users to select a full collection, and sync in changes to the collection set going forward. We could either make collections publishable, or treat published objects added to/removed from a collection's set as available to "sync."

This would require additional design investment to fill in the details (including diffs), and it's likely still worth merging a bulk-add version before that can be completed. I do want to make sure the interface doesn't suggest the collection itself is being selected.

Lastly, if collections are referenced (vs. bulk add collection children): under “these are the problems in the bank" I think we should consider modifying the list to visually represent the folder and its current children.

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Jan 16, 2026
@mphilbrick211 mphilbrick211 moved this from Waiting on Author to In Eng Review in Contributions Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: In Eng Review

Development

Successfully merging this pull request may close these issues.

5 participants