Skip to content

fix: navigation sidebar scrolling on mobile devices - #1927

Open
Agrendalath wants to merge 1 commit into
openedx:masterfrom
open-craft:agrendalath/fix-mobile-navigation-sidebar
Open

fix: navigation sidebar scrolling on mobile devices#1927
Agrendalath wants to merge 1 commit into
openedx:masterfrom
open-craft:agrendalath/fix-mobile-navigation-sidebar

Conversation

@Agrendalath

@Agrendalath Agrendalath commented Jun 15, 2026

Copy link
Copy Markdown
Member

Fixes #1935.

This fixes the following issues with the navigation sidebar on mobile devices:

  1. The sidebar on mobile devices was automatically closed when scrolling down due to the browser's resize event when hiding the URL bar.
  2. The sidebar was not displayed as full-screen because the position from Bootstrap's fixed-top utility class was overridden by the position: relative rule for the .outline-sidebar-wrapper selector.
  3. The full-screen sidebar could not be scrolled due to the lack of vertical overflow.

Testing instructions

Check the use cases described above with the narrow viewport.

Deadline

"None"

Other information

Private-ref: BB-7413

@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @Agrendalath!

This repository is currently maintained by @openedx/committers-frontend-app-learning.

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.

@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 Jun 15, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Jun 15, 2026
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.49%. Comparing base (c694ac6) to head (56ba046).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1927   +/-   ##
=======================================
  Coverage   91.48%   91.49%           
=======================================
  Files         353      353           
  Lines        5838     5843    +5     
  Branches     1356     1357    +1     
=======================================
+ Hits         5341     5346    +5     
  Misses        478      478           
  Partials       19       19           

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

@itsjeyd itsjeyd moved this from Needs Triage to Waiting on Author in Contributions Jun 24, 2026
@itsjeyd

itsjeyd commented Jun 24, 2026

Copy link
Copy Markdown

Hey @Agrendalath, this looks like a clear-scope bug fix. Could you check the instructions for that contribution path and complete the remaining steps (right now that would just be #1 and #3).

@itsjeyd itsjeyd added the product review PR requires product review before merging label Jun 24, 2026
@Agrendalath

Copy link
Copy Markdown
Member Author

@itsjeyd, done.

@itsjeyd itsjeyd moved this from Waiting on Author to Product Review in Contributions Jun 30, 2026
@Agrendalath

Copy link
Copy Markdown
Member Author

@itsjeyd, can I move it to the engineering review myself, or should I ping you to double-check first?

@Agrendalath
Agrendalath force-pushed the agrendalath/fix-mobile-navigation-sidebar branch from 76c539e to ebb5378 Compare June 30, 2026 21:24
@Agrendalath
Agrendalath requested a review from a team July 6, 2026 22:18
@itsjeyd

itsjeyd commented Jul 7, 2026

Copy link
Copy Markdown

@Agrendalath You're welcome to update the status yourself :) However, having cleared product review this would go to Ready for Review now, and only move to In Eng Review once an upstream reviewer has been confirmed and they've started reviewing.

@itsjeyd itsjeyd moved this from Product Review to Ready for Review in Contributions Jul 7, 2026
@itsjeyd itsjeyd added product review complete PR has gone through product review waiting for eng review PR is ready for review. Review and merge it, or suggest changes. and removed product review PR requires product review before merging labels Jul 7, 2026
@itsjeyd

itsjeyd commented Jul 7, 2026

Copy link
Copy Markdown

@openedx/committers-frontend-app-learning This is ready for you.

@brian-smith-tcril brian-smith-tcril 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.

Thanks for the PR!

It looks like this has some conflicts now (likely because #1923 landed). If you could rebase this that would be perfect!

I also left a comment with a small question.

Comment thread src/courseware/course/sidebar/sidebars/course-outline/CourseOutlineTray.jsx Outdated
@itsjeyd itsjeyd moved this from Ready for Review to In Eng Review in Contributions Jul 28, 2026
@itsjeyd itsjeyd added waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. and removed waiting for eng review PR is ready for review. Review and merge it, or suggest changes. labels Jul 28, 2026

@farhaanbukhsh farhaanbukhsh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The code changes look good to me and I have tested them as well. Can we add some tests here @Agrendalath ?

@Agrendalath
Agrendalath force-pushed the agrendalath/fix-mobile-navigation-sidebar branch from ebb5378 to 1b7965b Compare August 5, 2026 14:28
@Agrendalath
Agrendalath force-pushed the agrendalath/fix-mobile-navigation-sidebar branch from 1b7965b to 56ba046 Compare August 5, 2026 14:36
@Agrendalath

Copy link
Copy Markdown
Member Author

@brian-smith-tcril, @farhaanbukhsh, I replaced the SCSS override with the Paragon class and added tests.

@itsjeyd itsjeyd added waiting for eng review PR is ready for review. Review and merge it, or suggest changes. and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Aug 12, 2026

@farhaanbukhsh farhaanbukhsh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

✅ I tested this: on the master devstack

  • The sidebar closing issue is resolved
  • The sidebar takes the whole screen

✅ I read through the code
✅ I checked for accessibility issues
❌ Includes documentation

@farhaanbukhsh

Copy link
Copy Markdown
Member

@brian-smith-tcril do you want to review this PR again?

}, [courseId, courseOutlineShouldUpdate]);

// Collapse sidebar if screen resized to a width that displays the sidebar automatically
const lastWindowWidth = useRef(global.innerWidth);

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.

Could this be simplified by using matchMedia?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@brian-smith-tcril, I like this idea. However, I'm not sure about all the consequences. E.g., it would likely change existing behavior (e.g., when rotating the phone) beyond what we can consider a bug fix. A follow-up refactor would be more suitable for such a change.

@brian-smith-tcril

Copy link
Copy Markdown
Contributor

One other thing I haven't tested but want to look into is if this changes the behavior on mobile when rotating the device (both switching from landscape to portrait and from portrait to landscape).

@farhaanbukhsh

Copy link
Copy Markdown
Member

@brian-smith-tcril @Agrendalath I tried changing the orientation on the simulator and it is working as expected.

Screen.Recording.2026-08-18.at.5.28.41.PM.mov

@brian-smith-tcril

Copy link
Copy Markdown
Contributor

it is working as expected

The expectation is that the sidebar closes when rotating the device? Also that video appears to show a full refresh on rotate which I wouldn't expect on mobile hardware.

@Agrendalath

Copy link
Copy Markdown
Member Author

@brian-smith-tcril, this PR does not modify the existing behavior - i.e., the sidebar closes when rotating the device (even though it's indeed confusing). This only fixes the listed issues that are clear bugs that do not require an extended product review.

Also that video appears to show a full refresh on rotate which I wouldn't expect on mobile hardware.

It appears to be a simulator behavior; I cannot reproduce it on a physical device.

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). open-source-contribution PR author is not from Axim or 2U product review complete PR has gone through product review waiting for eng review PR is ready for review. Review and merge it, or suggest changes.

Projects

Status: In Eng Review

Development

Successfully merging this pull request may close these issues.

Broken sidebar on mobile devices.

5 participants