Skip to content

Conversation

@navinkarkera
Copy link
Contributor

@navinkarkera navinkarkera commented Dec 25, 2025

Closed in favor of #2778

Description

Add flow in course outline sidebar. Allows author to add new section/subsection/unit or any container from existing libraries via sidebar.
NOTE: The containers can only be added to the last parent block in this flow.

Useful information to include:

  • Which user roles will this change impact? "Course Author"

Screenshots

image image image

Supporting information

Testing instructions

Other information

Include anything else that will help reviewers and consumers understand the change.

  • Does this change depend on other changes elsewhere?
  • Any special concerns or limitations? For example: deprecations, migrations, security, or accessibility.

Best Practices Checklist

We're trying to move away from some deprecated patterns in this codebase. Please
check if your PR meets these recommendations before asking for a review:

  • Any new files are using TypeScript (.ts, .tsx).
  • Avoid propTypes and defaultProps in any new or modified code.
  • Tests should use the helpers in src/testUtils.tsx (specifically initializeMocks)
  • Do not add new fields to the Redux state/store. Use React Context to share state among multiple components.
  • Use React Query to load data from REST APIs. See any apiHooks.ts in this repo for examples.
  • All new i18n messages in messages.ts files have a description for translators to use.
  • Avoid using ../ in import paths. To import from parent folders, use @src, e.g. import { initializeMocks } from '@src/testUtils'; instead of from '../../../../testUtils'

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Dec 25, 2025
@openedx-webhooks
Copy link

Thanks for the pull request, @navinkarkera!

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.

🔘 Update the status of your PR

Your PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate.


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.

@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Dec 25, 2025
@navinkarkera navinkarkera force-pushed the navin/fal-4295/add-sidebar branch 5 times, most recently from 783f859 to 6e5e65e Compare December 29, 2025 06:50
@codecov
Copy link

codecov bot commented Dec 29, 2025

Codecov Report

❌ Patch coverage is 94.00631% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.01%. Comparing base (2209242) to head (9e915d2).

Files with missing lines Patch % Lines
src/CourseAuthoringContext.tsx 86.66% 6 Missing ⚠️
src/course-outline/outline-sidebar/AddSidebar.tsx 95.00% 4 Missing ⚠️
...brary-authoring/library-filters/SidebarFilters.tsx 76.47% 4 Missing ⚠️
src/course-outline/utils.tsx 81.81% 2 Missing ⚠️
src/library-authoring/LibraryAuthoringPage.tsx 94.73% 1 Missing ⚠️
...ary-authoring/collections/CollectionInfoHeader.tsx 80.00% 1 Missing ⚠️
src/library-authoring/data/apiHooks.ts 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2775      +/-   ##
==========================================
+ Coverage   94.99%   95.01%   +0.02%     
==========================================
  Files        1256     1260       +4     
  Lines       28800    28949     +149     
  Branches     6538     6606      +68     
==========================================
+ Hits        27358    27507     +149     
+ Misses       1384     1372      -12     
- Partials       58       70      +12     

☔ 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.

@navinkarkera navinkarkera force-pushed the navin/fal-4295/add-sidebar branch 2 times, most recently from 0c909ac to 8e4c9a1 Compare December 29, 2025 16:56
@navinkarkera navinkarkera changed the title feat: add component sidebar in course oultine feat: Add Sidebar for course outline [FC-0114] Dec 30, 2025
@navinkarkera navinkarkera force-pushed the navin/fal-4295/add-sidebar branch from 144c41a to a412e9c Compare December 30, 2025 13:45
Copy link
Contributor

@rpenido rpenido left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍
Thank you for your work, @navinkarkera!

  • I tested this using the instructions from the PR
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation]

Great work on the refactor.
I was not super thrilled with the useLibraryContext(false), but as you said, we could refactor that later. Maybe splitting the context?

// instanbul ignore next
return `/course/${courseId}/container/${locator}`;
}
return `${getConfig().STUDIO_BASE_URL}/container/${locator}`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this? Wasn't the studio unit outline deprecated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rpenido Did not change the actual implementation, just moved it into the context.

@navinkarkera
Copy link
Contributor Author

navinkarkera commented Dec 30, 2025

I was not super thrilled with the useLibraryContext(false), but as you said, we could refactor that later. Maybe splitting the context?

Me too, but there is no clean way without requiring a lot of refactoring. I thought about splitting the context but even that would not be helpful as most of the components should work in both cases i.e., inside and outside a single library context.

@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Jan 5, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Jan 5, 2026
@navinkarkera navinkarkera requested a review from ChrisChV January 6, 2026 06:19
Comment on lines +26 to +29
export type LibraryIdOneOrMore = {
libraryId: string;
libraryIds: string[];
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not change the LibraryContext to support multiple libraryIds. It makes things too messy. The context is already storing too much data and needs to be simplified, and this makes it even more complex.

Instead, if you really have a page where you need to render content from multiple libraries, wrap each individual component in its own <LibraryContextProvider> for just one library. You can even nest them if you ever need to have a component from a second library displayed inside a main library.

But, to render this sort of view (in mockup below), no LibraryContext should be required at all! All the relevant data comes from Meilisearch, and the <ComponentCard>/<BaseCard> etc. should not depend on a library context. (I think right now it's used for showOnlyPublished but that should be moved to ComponentPickerContext instead of LibraryContext.)

Image

Copy link
Contributor Author

@navinkarkera navinkarkera Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I have updated #2778 to create new contexts for showOnlyPublished and multiple library case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much cleaner to me in the new PR. Thanks!

@navinkarkera navinkarkera force-pushed the navin/fal-4295/add-sidebar branch from e7b11eb to 9e915d2 Compare January 7, 2026 05:44
@navinkarkera
Copy link
Contributor Author

@rpenido @ChrisChV @bradenmacdonald I am closing this in favor of #2778 as it is much easier to refactor context related code in that PR which contains both Add Sidebar and Library filter together and it also helps avoid conflicts.

@github-project-automation github-project-automation bot moved this from Waiting on Author to Done in Contributions Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants