Skip to content

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

Open
marslanabdulrauf wants to merge 2 commits 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 2 commits into
openedx:masterfrom
mitodl:marslan/11295-sidebar-release-date

Conversation

@marslanabdulrauf

@marslanabdulrauf marslanabdulrauf commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

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.

@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Jun 4, 2026
@marslanabdulrauf marslanabdulrauf force-pushed the marslan/11295-sidebar-release-date branch from 21b722d to 9b34321 Compare June 4, 2026 09:54
@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.66%. Comparing base (3b6ae01) to head (f579eae).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3079      +/-   ##
==========================================
+ Coverage   95.64%   95.66%   +0.02%     
==========================================
  Files        1403     1403              
  Lines       33307    33322      +15     
  Branches     7570     7844     +274     
==========================================
+ Hits        31855    31877      +22     
+ Misses       1402     1382      -20     
- Partials       50       63      +13     

☔ 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

@asadali145 asadali145 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are still some settings and details that are not updating in the sidebar. Like subsection settings and details.

Screenshot 2026-06-19 at 2 30 28 PM Screenshot 2026-06-19 at 2 30 51 PM

@marslanabdulrauf marslanabdulrauf force-pushed the marslan/11295-sidebar-release-date branch from 9b34321 to 9b727b2 Compare June 19, 2026 11:47
@marslanabdulrauf marslanabdulrauf force-pushed the marslan/11295-sidebar-release-date branch from fc6059a to f579eae Compare June 19, 2026 12:40

@asadali145 asadali145 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Timed exam setting is synced but time value is not synced. Also, content summary don't seem to sync if you delete the child like for Section, if you delete subsections, content summary does not update and same for subsections.

Image Image

@bradenmacdonald

Copy link
Copy Markdown
Contributor

@navinkarkera can you take a look at this please?

@marslanabdulrauf @navinkarkera Generally, the way I would prefer for this sort of thing to work is that React Query should hold the source of truth for the state (e.g. const { data: itemData } = useCourseItemData(subsectionId);), shared among all components in the app, and the only local state should be a formStateOverrides that only has any value when the user has made a change in the form (the modal or the sidebar), and only holds that value until they click Save, after which formStateOverrides gets cleared again. (Or until they close the sidebar/modal.)

Then I think you can avoid most of these synchronization issues. The formStateOverrides actually never needs to be changed in response to any external event, only cleared when the user saves or closes the current form, which basically happens anyways when the component is unmounted.

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.

5 participants