Skip to content

fix: update release date for sidebar on updating it from outline side#3079

Open
marslanabdulrauf wants to merge 1 commit into
openedx:masterfrom
mitodl:marslan/11295-sidebar-release-date
Open

fix: update release date for sidebar on updating it from outline side#3079
marslanabdulrauf wants to merge 1 commit into
openedx:masterfrom
mitodl:marslan/11295-sidebar-release-date

Conversation

@marslanabdulrauf
Copy link
Copy Markdown
Contributor

@marslanabdulrauf marslanabdulrauf commented Jun 4, 2026

Steps to reproduce issue

  1. Make sure you are on master branch
  2. Click on a section or subsectionView new sidebar
  3. Click on the kebab in the outline and choose configure
  4. Change date or any other setting.
  5. Sidebar doesn't change

Description

This pull request improves how the ReleaseSection and VisibilitySection components in the course outline sidebar handle external updates to their data, such as when changes are made from other UI elements (like a kebab-menu configure modal). The changes ensure that the sidebar UI always reflects the latest state from the backend without accidentally firing redundant mutations or callbacks. Additionally, new tests verify this synchronization behavior.

Synchronization improvements:

  • Both ReleaseSection.tsx and VisibilitySection.tsx now use a useEffect to update their local state when the underlying itemData changes externally, using a skipCallback flag to avoid triggering the onChange mutation redundantly. (src/course-outline/outline-sidebar/info-sidebar/sharedSettings/ReleaseSection.tsx [1] [2]; src/course-outline/outline-sidebar/info-sidebar/sharedSettings/VisibilitySection.tsx [3] [4]

Testing enhancements:

  • The test mocks for useStateWithCallback and DatepickerControl in ReleaseSection.test.tsx were enhanced to handle the new object form with skipCallback, and to allow inspecting the currently displayed value. (src/course-outline/outline-sidebar/info-sidebar/sharedSettings/ReleaseSection.test.tsx src/course-outline/outline-sidebar/info-sidebar/sharedSettings/ReleaseSection.test.tsxL7-R36)
  • New tests were added for both ReleaseSection and VisibilitySection to verify that UI updates correctly when external changes occur, and that onChange is not called in these cases, preventing redundant mutations. (src/course-outline/outline-sidebar/info-sidebar/sharedSettings/ReleaseSection.test.tsx [1]; src/course-outline/outline-sidebar/info-sidebar/sharedSettings/VisibilitySection.test.tsx [2]

Supporting information

https://github.com/mitodl/hq/issues/11295 (MIT Internal)

Testing instructions

  1. Checkout to this branch and repeat the steps mentioned at the top
  2. Outline changes should reflect in the sidebar now as well

AI Tool

Software: Claude Desktop
Model: Claude Sonnet 4.6 (High)

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jun 4, 2026
@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @marslanabdulrauf!

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.

@marslanabdulrauf marslanabdulrauf force-pushed the marslan/11295-sidebar-release-date branch from 21b722d to 9b34321 Compare June 4, 2026 09:54
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.63%. Comparing base (3f531d5) to head (9b34321).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3079      +/-   ##
==========================================
+ Coverage   95.61%   95.63%   +0.01%     
==========================================
  Files        1391     1391              
  Lines       33075    33085      +10     
  Branches     7680     7692      +12     
==========================================
+ Hits        31626    31641      +15     
+ Misses       1384     1379       -5     
  Partials       65       65              

☔ View full report in Codecov by Harness.
📢 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.

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Jun 4, 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: Ready for Review

Development

Successfully merging this pull request may close these issues.

3 participants