Skip to content

fix: unit page title no longer overlaps the Live/Discussions badges - #3243

Merged
farhaanbukhsh merged 1 commit into
openedx:masterfrom
AhtishamShahid:ahtisham/fix-unit-header-title-overlap
Sep 16, 2026
Merged

farhaanbukhsh merged 1 commit into
openedx:masterfrom
AhtishamShahid:ahtisham/fix-unit-header-title-overlap

Conversation

@AhtishamShahid

@AhtishamShahid AhtishamShahid commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Description

To hide blank space under the sub header's action buttons, the unit page pulled everything below the sub header up by a fixed 35px (.course-unit .sub-header { margin-bottom: -35px }). Once the unit display name wraps to a second line the title, not the buttons, sets the header's height, so those 35px come out of the title and the "Live" / "Discussions Enabled" badges are painted over it.

This zeroes the .sub-header-actions bottom margin inside .course-unit instead, closing the same gap by the right amount at any title height. Scoped to .course-unit, so the shared SubHeader on other pages is untouched.

Before

1000px-wide window, display name wrapping to three lines:

before

After

after

Supporting information

Reported as mitodl/hq#12844 (MIT Open Learning, private tracker).

Testing instructions

  1. Give a unit a display name long enough to wrap, publish it with the course start date in the past (Live badge), and turn on openedx discussions plus discussion_enabled on the unit (Discussions Enabled badge).
  2. Open the unit page at a window width of about 1000px so the title wraps: the badges should sit below the title instead of on top of its last line.
  3. Widen until the title fits on one line and confirm the spacing there is unchanged.

Other information

Best Practices Checklist

CSS-only change: no new files, components, state, API calls, or translated strings, so none of the checklist items apply.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Sep 11, 2026
@openedx-webhooks

openedx-webhooks commented Sep 11, 2026

Copy link
Copy Markdown

Thanks for the pull request, @AhtishamShahid!

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

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.02%. Comparing base (87ce85d) to head (0940e69).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3243   +/-   ##
=======================================
  Coverage   96.02%   96.02%           
=======================================
  Files        1401     1401           
  Lines       34129    34129           
  Branches     7842     7842           
=======================================
  Hits        32772    32772           
  Misses       1316     1316           
  Partials       41       41           

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

The unit page cancelled the blank space the shared SubHeader reserves below
its action buttons with `.course-unit .sub-header { margin-bottom: -35px }`.
That shifts everything after the sub header up by a fixed amount regardless of
how tall the title is, which is only correct while the unit display name fits
on a single line. `.sub-header` is a flex row, so once the `<h2>` grows taller
than the action buttons the negative margin eats into the title instead of the
reserved gap, and the "Live" / "Discussions Enabled" status bar is drawn on top
of the last line of the display name.

Remove the reserved space at its source instead, by zeroing the
`.sub-header-actions` bottom margin within `.course-unit`. The correction is
then proportional to the actual header height, so the status bar always lands
below the title no matter how many lines it wraps to. Scoped to `.course-unit`,
so the shared SubHeader on other pages is unaffected.
@AhtishamShahid
AhtishamShahid force-pushed the ahtisham/fix-unit-header-title-overlap branch from 2a77188 to 0940e69 Compare September 11, 2026 10:04
@AhtishamShahid
AhtishamShahid marked this pull request as draft September 11, 2026 10:10
@AhtishamShahid
AhtishamShahid marked this pull request as ready for review September 11, 2026 10:11

@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:

  • by creating a big unit name
  • the name overlaps on master
  • the name is rendered properly on the feature branch.
  • played around with the css and the solution looked optimized

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

@farhaanbukhsh
farhaanbukhsh merged commit d4739b5 into openedx:master Sep 16, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in Contributions Sep 16, 2026
@farhaanbukhsh

Copy link
Copy Markdown
Member

Thank you @AhtishamShahid for the fix :)

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: Done

Development

Successfully merging this pull request may close these issues.

3 participants