Skip to content

fix: make sidebar sticky, fix styles, responsiveness, scroll and remove padding#3057

Open
rpenido wants to merge 1 commit into
openedx:masterfrom
open-craft:rpenido/make-sidebar-sticky
Open

fix: make sidebar sticky, fix styles, responsiveness, scroll and remove padding#3057
rpenido wants to merge 1 commit into
openedx:masterfrom
open-craft:rpenido/make-sidebar-sticky

Conversation

@rpenido
Copy link
Copy Markdown
Contributor

@rpenido rpenido commented May 12, 2026

Description

This PR fixes an issue introduced by #3056 and #3055, in which the sidebar lost its sticky style after adding a div to wrap it, alongside some styles, responsiveness, and scroll.

It also removes the padding added by #3055, which causes misalignment with the main content on the left.

Supporting information

Testing instructions

  • Checkout this PR and run npm run build
  • Check with the following env.config.jsx to see the behaviour with insert/wrapping components:
import { PLUGIN_OPERATIONS, DIRECT_PLUGIN } from '@openedx/frontend-plugin-framework';

import { Card } from "@openedx/paragon"

const config = {
  pluginSlots: {
    'org.openedx.frontend.authoring.course_unit_sidebar.v2': {
      keepDefault: true,
      plugins: [
        {
          op: PLUGIN_OPERATIONS.Insert,
          widget: {
              id: 'course-unit-sidebar',
              priority: 1,
              type: DIRECT_PLUGIN,
              RenderWidget: () => <Card><Card.Header title="v2"/></Card>,
          },
        },
        {
            op: PLUGIN_OPERATIONS.Wrap,
            widgetId: 'default_contents',
            wrapper: ({component}) => (
                <div className="flex-fill d-flex overflow-hidden" style={{ border: 'thick dashed green' }}>
                    {component}
                </div>
            ),
        },
      ],
    },
    'org.openedx.frontend.authoring.course_outline_sidebar.v1': {
      keepDefault: true,
      plugins: [
        {
          op: PLUGIN_OPERATIONS.Insert,
          widget: {
              id: 'course-sidebar',
              priority: 1,
              type: DIRECT_PLUGIN,
              RenderWidget: () => <Card><Card.Header title="v2"/></Card>,
          },
        },
        {
            op: PLUGIN_OPERATIONS.Wrap,
            widgetId: 'default_contents',
            wrapper: ({component}) => (
                <div className="flex-fill d-flex overflow-hidden" style={{ border: 'thick dashed green' }}>
                    {component}
                </div>
            ),
        },
      ],
    },
  },
};

export default config;

Note: The flex classes in the wrapping divs are necessary so the content adapts to the remaining space correctly.

  • Check that the sidebar on both Course Outline and Unit Outline has 100vh and occupies the whole left while scrolling.
  • Resize your browser vertically and check if a scrollbar is shown inside the sidebar, and you can see the whole content.

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 the open-source-contribution PR author is not from Axim or 2U label May 12, 2026
@openedx-webhooks
Copy link
Copy Markdown

openedx-webhooks commented May 12, 2026

Thanks for the pull request, @rpenido!

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.52%. Comparing base (adf92ef) to head (e7b8ce6).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3057   +/-   ##
=======================================
  Coverage   95.52%   95.52%           
=======================================
  Files        1393     1393           
  Lines       32969    32971    +2     
  Branches     7592     7600    +8     
=======================================
+ Hits        31493    31495    +2     
  Misses       1408     1408           
  Partials       68       68           

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

@rpenido rpenido force-pushed the rpenido/make-sidebar-sticky branch from a95cc72 to 505cd04 Compare May 12, 2026 12:47
@rpenido rpenido marked this pull request as draft May 12, 2026 15:05
@rpenido rpenido force-pushed the rpenido/make-sidebar-sticky branch 7 times, most recently from 47a2e51 to d506490 Compare May 12, 2026 17:53
@rpenido rpenido changed the title fix: make sidebar sticky fix: make sidebar sticky, fix styles, responsiveness, scroll and remove padding May 12, 2026
@rpenido rpenido force-pushed the rpenido/make-sidebar-sticky branch from d506490 to e7b8ce6 Compare May 12, 2026 17:58
@rpenido rpenido marked this pull request as ready for review May 12, 2026 18:13
@rpenido rpenido requested a review from brian-smith-tcril May 12, 2026 18:24
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions May 14, 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