Skip to content

Bug/fix unit title discussion overlap - #13

Merged
choeying-10 merged 4 commits into
wbc-ulmo1-stagefrom
bug/fix-unit-title-discussion-overlap
May 30, 2026
Merged

Bug/fix unit title discussion overlap#13
choeying-10 merged 4 commits into
wbc-ulmo1-stagefrom
bug/fix-unit-title-discussion-overlap

Conversation

@choeying-10

Copy link
Copy Markdown

Long unit titles in the Learning MFE courseware header overlapped the discussion/forum and navigation buttons, and even when they didn't overlap they sat too close to the buttons. This PR makes the title wrap based on its container width (not its character count), keeps clear spacing from the action buttons, and behaves responsively across all breakpoints.

Problem

In the unit header (UnitTitleSlot), the title <h3> and the nav row (discussion, notifications, prev/next) were laid out with Bootstrap flex utilities (flex-xl-row, w-100). With a long title this caused:

  1. Overlap — the title had no min-width: 0 / wrapping rules, so it overflowed into the buttons, especially when the discussions sidebar narrowed the content column.
  2. No spacing — even without overlap, there was no gap between the title and the buttons.
  3. The nav wrapper's w-100 competed with the title for horizontal space.
    Two additional issues surfaced while verifying with runtime layout measurements:
  4. On desktop, the empty .outline-trigger-mobile wrapper still carried margin-left: -2.4rem, dragging the discussion buttons ~26px onto the title.
  5. A breakpoint collision at exactly 1200px (min-width-xl and max-width-lg both firing) collapsed the nav to 0 width.

Changes

  • src/plugin-slots/UnitTitleSlot/index.jsx — replaced the flex utility classes with semantic wrappers (unit-title-header, unit-title-container, unit-title-nav).
  • src/index.scss
    • Introduced a CSS Grid header: grid-template-columns: minmax(0, 1fr) auto (≥xl) so the title is bounded by its container and wraps; single 1fr column with the nav stacked on top below xl.
    • Added overflow-wrap: anywhere so long unbroken titles break instead of overflowing.
    • Added column-gap / row-gap for consistent spacing between title and buttons.
    • Neutralized the empty outline trigger's negative margin within the header on desktop.
    • Used a single min-width: xl query for the row layout to avoid the 1200px breakpoint collision.
    • Commented out the @edx/brand/paragon/learning-mfe import, which is missing from the installed @openedx/brand-openedx package and breaks the webpack build (approved).

Tenzin Choeying and others added 3 commits May 30, 2026 12:18
Let the title container flex and wrap based on available width instead of competing with the full-width nav row, and add spacing between title and action buttons.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use a CSS grid (minmax(0, 1fr) auto) so the unit title is bounded by its
container and wraps based on available width rather than its length. Allow
long unbroken titles to break, neutralize the empty outline trigger's
negative margin that pulled the discussion buttons onto the title, and
use a single min-width:xl query for the row layout to avoid the 1200px
breakpoint collision. Stacks responsively below xl.

Co-authored-by: Cursor <cursoragent@cursor.com>
learning-mfe.scss is not present in the installed @openedx/brand-openedx
package, which breaks the webpack build. Comment it out (approved) until a
custom brand providing this file is added.

Co-authored-by: Cursor <cursoragent@cursor.com>
@choeying-10
choeying-10 requested a review from 10kalden May 30, 2026 13:50
@choeying-10 choeying-10 self-assigned this May 30, 2026
@choeying-10
choeying-10 merged commit da4f4cf into wbc-ulmo1-stage May 30, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants