Skip to content

Conversation

@wgu-jesse-stewart
Copy link

@wgu-jesse-stewart wgu-jesse-stewart commented Jun 3, 2025

Fixes openedx/frontend-app-learning#1695
Related PR: openedx/frontend-lib-special-exams#164, openedx/frontend-app-learning#1724

This PR simply adds a app-container div or easy styling of app wrapping component

Summary:
When content within a sequence is shorter than the height of the browser viewport, the .sequence-container > .outline-sidebar-wrapper element does not expand appropriately. This causes the course outline sidebar to be partially or completely hidden from view.

Steps to Reproduce:

Open a course sequence that contains very little content (e.g., a short paragraph or notice).

View the course in a tall browser window.

Observe that the sidebar navigation is cut off or hidden.

Expected Behavior:
The sidebar should remain fully visible and accessible, regardless of the amount of content in the main pane.

Actual Behavior:
When the content is short, the parent container height collapses to fit that content, which in turn restricts the sidebar’s height, hiding part of the navigation.

Screenshots:
image

image

Demo of fix:
https://github.com/user-attachments/assets/69ce8dae-e73b-487c-bc6a-862701b1ce8d

I think we should have a discussion about removing these wrapper divs entirely so that the layout can handle all the UI

Merge checklist:

  • Consider running your code modifications in the included example app within frontend-platform. This can be done by running npm start and opening http://localhost:8080.
  • Consider testing your code modifications in another local micro-frontend using local aliases configured via the module.config.js file in frontend-build.
  • Verify your commit title/body conforms to the conventional commits format (e.g., fix, feat) and is appropriate for your code change. Consider whether your code is a breaking change, and modify your commit accordingly.

Post merge:

  • After the build finishes for the merged commit, verify the new release has been pushed to NPM.

@openedx-webhooks
Copy link

Thanks for the pull request, @wgu-jesse-stewart!

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

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.

This comment was marked as outdated.

@wgu-jesse-stewart wgu-jesse-stewart changed the title feat: adds classname to browser-router fix: ensure full-height layout Jun 3, 2025
@codecov
Copy link

codecov bot commented Jun 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.79%. Comparing base (93bee06) to head (2c9f2d4).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #813   +/-   ##
=======================================
  Coverage   86.79%   86.79%           
=======================================
  Files          48       48           
  Lines        1401     1401           
  Branches      297      294    -3     
=======================================
  Hits         1216     1216           
  Misses        172      172           
  Partials       13       13           

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

@wgu-jesse-stewart wgu-jesse-stewart moved this from Needs Triage to Ready for Review in Contributions Jun 3, 2025
@wgu-jesse-stewart wgu-jesse-stewart added core committer mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). and removed core committer labels Jun 3, 2025
@wgu-jesse-stewart wgu-jesse-stewart requested a review from Copilot June 3, 2025 19:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses the issue of a collapsing sidebar when the main content is short by adding a classname for easier styling of the browser router container.

  • Adds the "browser-router" classname to the container div within the Router.
  • Aims to ensure the sidebar remains fully visible with a full-height layout.
Comments suppressed due to low confidence (1)

src/react/AppProvider.jsx:102

  • [nitpick] Consider adding an inline comment to clarify that the 'browser-router' class is added solely to support the full-height layout for the sidebar. This can aid future developers in understanding the rationale behind this styling hook.
<div className="browser-router" data-testid="browser-router">

@wgu-jesse-stewart wgu-jesse-stewart requested review from a team, adamstankiewicz and dcoa June 4, 2025 16:07
Copy link
Contributor

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

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

Not that I'm fundamentally opposed to having a generic class name such as this one, here, but I'm hesitant to introduce a layout feature to what is essentially a data div. Can the desired outcome not be achieved by styling #main-content or SidebarProviderComponent instead?

@brian-smith-tcril
Copy link
Contributor

brian-smith-tcril commented Jun 4, 2025

I think we probably just shouldn't have that extra div in there at all. It looks like it was added purely for testing purposes in #615

Edit: tried removing the div and got the tests to pass again by mocking the router in the test file

jest.mock('react-router-dom', () => ({
  BrowserRouter: ({children}) => (
    <div data-testid="browser-router">
      {children}
    </div>
  ),
}))

@wgu-jesse-stewart
Copy link
Author

I think this is great feedback - I will close this PR and deprecate that test id property in another PR

@github-project-automation github-project-automation bot moved this from Ready for Review to Done in Contributions Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

sequence-container > outline-sidebar-wrapper height is set by sequence height, hiding navigation when content is short

5 participants