Skip to content

fix: mobile dropdown nav being cut off on narrow screens - #159

Merged
oycyc merged 2 commits into
mainfrom
claude/mobile-dropdown-nav-cutoff-fp7zzw
Jul 27, 2026
Merged

fix: mobile dropdown nav being cut off on narrow screens#159
oycyc merged 2 commits into
mainfrom
claude/mobile-dropdown-nav-cutoff-fp7zzw

Conversation

@oycyc

@oycyc oycyc commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

what

  • Fix the mobile navigation dropdown menu being cut off on the right edge of the screen on narrow (phone) viewports.
  • On viewports <= 575px the dropdown is now anchored to the right edge of the header (where the toggle button lives) and capped to the viewport width, so all menu labels are fully visible.

why

  • On screens <= 575px the dropdown <ul> was styled with both left: 0 and right: 0 while also keeping the fixed width: 200px from the tablet breakpoint.
  • When an absolutely positioned element specifies left, right, and width, browsers (in LTR) honor left and ignore right. Because the nav (its positioning context) sits at the far right of the header on mobile, left: 0 anchored the 200px-wide menu to the right side of the screen and pushed it off-screen — cutting off labels like "OUR SERVICES", "WHO WE ARE", "NEWSLETTER" and "CASE STUDIES".
  • The fix replaces left: 0 with left: auto; right: 0 so the menu stays anchored to the header's right edge (the same behavior the tablet breakpoint already uses), plus a max-width: calc(100vw - 40px) safety net so it can never overflow the viewport on any device width.

Change is scoped to the @media (max-width: 575px) block only, so the desktop and tablet menus are unaffected.

validation

Reproduced and verified locally with Hugo Extended v0.162.1, rendered in a mobile viewport (393px wide, the reported iPhone case) with the dropdown open.

Before — labels overflow and are cut off on the right edge (menu measured at left: 297px → right: 497px in a 393px viewport):

before

After — the full menu is visible and contained within the viewport (measured at left: 173px → right: 373px, no overflow):

after

references

Summary by CodeRabbit

  • Bug Fixes
    • Improved mobile navigation dropdown positioning by anchoring it to the header’s right edge.
    • Prevented dropdown menus from overflowing on narrow screens by adding a viewport-safe width cap.

@oycyc
oycyc requested a review from a team as a code owner July 24, 2026 04:09
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The mobile header dropdown is repositioned against the right edge and constrained to calc(100vw - 40px).

Changes

Mobile navigation

Layer / File(s) Summary
Viewport-safe dropdown positioning
assets/css/custom.scss
The mobile dropdown changes from left-based positioning to right: 0 anchoring with left: auto, and gains a viewport-based max-width.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing the mobile dropdown navigation being cut off on narrow screens.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/mobile-dropdown-nav-cutoff-fp7zzw

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

Why do we need these assets in the repo?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

too much claude vibecoding haha

On viewports <= 575px the dropdown menu was positioned with both left: 0
and right: 0 alongside a fixed width, so browsers honored left and pushed
the fixed-width menu off the right edge of the screen, cutting off the
menu labels. Anchor the dropdown to the right edge of the header instead
and cap its width to the viewport as a safety net.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013YkRkBm7wgX1YXjdDXHgVb
@oycyc
oycyc force-pushed the claude/mobile-dropdown-nav-cutoff-fp7zzw branch from 81f04b8 to 7cec53a Compare July 24, 2026 13:22
@netlify

netlify Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploy Preview for masterpoint ready!

Name Link
🔨 Latest commit f308a7e
🔍 Latest deploy log https://app.netlify.com/projects/masterpoint/deploys/6a67d419c04bf30008b95a66
😎 Deploy Preview https://deploy-preview-159--masterpoint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 39
Accessibility: 89
Best Practices: 92
SEO: 79
PWA: 70
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@oycyc
oycyc merged commit 64a9828 into main Jul 27, 2026
8 checks passed
@oycyc
oycyc deleted the claude/mobile-dropdown-nav-cutoff-fp7zzw branch July 27, 2026 21:59
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.

4 participants