Skip to content

feat: settings tab in sidebar#2968

Open
navinkarkera wants to merge 40 commits intoopenedx:masterfrom
open-craft:navin/fal-4324/settings-tab
Open

feat: settings tab in sidebar#2968
navinkarkera wants to merge 40 commits intoopenedx:masterfrom
open-craft:navin/fal-4324/settings-tab

Conversation

@navinkarkera
Copy link
Copy Markdown
Contributor

@navinkarkera navinkarkera commented Mar 30, 2026

Description

Adds settings tab to section, subsection and unit sidebar in outline and unit page as described in #2794

Also, simplifies notification and unit settings in unit page using react-query, removing redux.

Useful information to include:

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

Screenshots:

image image image

Supporting information

Testing instructions

  • Create section, subsection and unit in a course.
  • Select them and check settings tab in sidebar for each element.
  • Try out different options in the settings sidebar and compare it with configure modal (three dots menu -> configure).

Other information

Leave without saving? This functionality is only working when user tries to leave the page. But changing the tab or closing the sidebar does not trigger this confirmation modal, it will require extensive changes and is not feasible with current limited time and budget.

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 Mar 30, 2026
@openedx-webhooks
Copy link
Copy Markdown

openedx-webhooks commented Mar 30, 2026

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.

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 Mar 30, 2026
@navinkarkera navinkarkera force-pushed the navin/fal-4324/settings-tab branch from 339bc8a to 04e3ada Compare March 30, 2026 16:13
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Apr 1, 2026
@navinkarkera navinkarkera force-pushed the navin/fal-4324/settings-tab branch 3 times, most recently from 87cef28 to 282bdad Compare April 3, 2026 11:44
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

❌ Patch coverage is 97.56098% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.59%. Comparing base (2930265) to head (dbb2458).

Files with missing lines Patch % Lines
src/generic/expandable-card/ExpandableCard.tsx 85.71% 5 Missing ⚠️
...unit-sidebar/unit-info/GenericUnitInfoSettings.tsx 94.11% 3 Missing ⚠️
...e/outline-sidebar/info-sidebar/UnitInfoSidebar.tsx 87.50% 2 Missing ⚠️
.../info-sidebar/sharedSettings/VisibilitySection.tsx 96.15% 1 Missing ⚠️
src/course-unit/legacy-sidebar/index.tsx 50.00% 1 Missing ⚠️
src/course-unit/xblock-container-iframe/index.tsx 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2968      +/-   ##
==========================================
+ Coverage   95.57%   95.59%   +0.02%     
==========================================
  Files        1366     1375       +9     
  Lines       31507    31877     +370     
  Branches     7119     7259     +140     
==========================================
+ Hits        30113    30474     +361     
+ Misses       1344     1341       -3     
- Partials       50       62      +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 requested a review from rpenido April 3, 2026 15:13
@navinkarkera navinkarkera marked this pull request as ready for review April 3, 2026 15:13
@navinkarkera navinkarkera force-pushed the navin/fal-4324/settings-tab branch from 06da56f to 9fbec58 Compare April 6, 2026 10:32
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Apr 6, 2026
@mphilbrick211 mphilbrick211 moved this from Waiting on Author to Ready for Review in Contributions Apr 6, 2026
@navinkarkera navinkarkera force-pushed the navin/fal-4324/settings-tab branch from 9fbec58 to dbb2458 Compare April 9, 2026 10:17
Copy link
Copy Markdown
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

NOTE: Not in the scope of this task, but it seems weird to me that "2:00" is not a valid value for Time Alloted. I think it was a bug typing it and not getting it saved.

Comment on lines +229 to +250
mutate({
itemId: subsectionId,
sectionId: selectedContainerState?.sectionId,
isVisibleToStaffOnly: itemData.visibilityState === VisibilityTypes.STAFF_ONLY,
releaseDate: itemData.start,
graderType: itemData.format == null ? 'notgraded' : itemData.format,
dueDate: itemData.due == null ? '' : itemData.due,
isTimeLimited: itemData.isTimeLimited,
isProctoredExam: itemData.isProctoredExam,
isOnboardingExam: itemData.isOnboardingExam,
isPracticeExam: itemData.isPracticeExam,
examReviewRules: itemData.examReviewRules,
defaultTimeLimitMinutes: itemData.defaultTimeLimitMinutes,
hideAfterDue: itemData.hideAfterDue === undefined ? false : itemData.hideAfterDue,
showCorrectness: itemData.showCorrectness,
isPrereq: itemData.isPrereq,
prereqUsageKey: itemData.prereq,
prereqMinScore: defaultPrereqScore(itemData.prereqMinScore),
prereqMinCompletion: defaultPrereqScore(itemData.prereqMinCompletion),
...variables,
});
};
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.

Don't we allow partial updates in our API, right?
With the current approach, we override the entire config using cached data on every change, which may cause concurrency issues.
If our API is not prepared for partial updates, the change may be big for this task, so I think we should live with it.

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.

Yes, from what I've seen, it's always been handled that way


useEffect(() => {
const element = contentRef.current;
if (!element) { return () => {}; }
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.

I think we can just return undefined here instead of an empty function

Suggested change
if (!element) { return () => {}; }
if (!element) { return; }

const { setData } = useScrollState(courseKey);
const dispatch = useDispatch();
return useMutation({
return useMutationWithProcessingNotification({
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.

Nice clean-up! 👍

closeToast,
} = useToastContext();
const { showToast, closeToast } = useToastContext();
return useMutation({
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.

Can we use the useMutationWithProcessingNotification here? If not, could you please put a comment about it?

* Wraps useMutation to add a processing notification when the mutation is initiated and removes it
* when the mutation is settled.
*/
export const useMutationWithProcessingNotification = <
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.

Nice! 👍 👍

@ChrisChV
Copy link
Copy Markdown
Contributor

@navinkarkera This checkbox cannot be unchecked by clicking on it, is that expected?

image

Comment on lines +49 to +54
useEffect(() => {
if (contentRef.current) {
const { scrollHeight } = contentRef.current;
setNeedsExpansion(scrollHeight > maxHeight);
}
}, [children, maxHeight]);
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.

@navinkarkera, I think this is duplicated. The above useEffect already does this

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: Ready for Review

Development

Successfully merging this pull request may close these issues.

5 participants