Skip to content

Fix mobile menu display#255

Merged
gaelcolas merged 2 commits into
dsccommunity:masterfrom
Gijsreyn:gh-254/main/fix-menu-toggle
Jun 18, 2026
Merged

Fix mobile menu display#255
gaelcolas merged 2 commits into
dsccommunity:masterfrom
Gijsreyn:gh-254/main/fix-menu-toggle

Conversation

@Gijsreyn

@Gijsreyn Gijsreyn commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Updates the mobile menu so all navigation options are visible and easy to select. The menu now opens in a clearer mobile-friendly layout, includes the full list of links, and closes when selecting a link, tapping outside the menu, or pressing Escape.

What was shown before:

image

(whilst pressing the menu, it overlayed totally incorrectly).

To what it is with this change:

image

Also fixes a page styling issue that could affect how the menu and other styles are displayed.


This change is Reviewable

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Gijsreyn, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 53 minutes and 36 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fd9cbdf6-0877-4602-9635-65e7d63f3c7c

📥 Commits

Reviewing files that changed from the base of the PR and between 39f0e43 and f09cc39.

📒 Files selected for processing (5)
  • assets/css/futuristic.css
  • assets/js/main.js
  • i18n/en.toml
  • i18n/fr.toml
  • layouts/partials/header-new.html

Walkthrough

Replaces the transform-based .main-nav mobile navigation with a .mobile-menu overlay system (CSS, HTML), updates JavaScript to toggle/open/close with aria synchronization and body-scroll locking, refactors theme toggle to handle multiple icon variants, adds English and French i18n strings, and updates the dark-mode timeline selector.

Changes

Mobile Navigation Overlay System

Layer / File(s) Summary
Design tokens and header stacking
assets/css/futuristic.css
Added --z-nav-mobile custom property and updated .site-header z-index to var(--z-fixed) to establish stacking context for the new overlay.
Mobile menu CSS overlay system
assets/css/futuristic.css
Replaced the @media (max-width: 768px) mobile navigation with a .mobile-menu overlay (backdrop, slide-in panel, header/close, list/link styling, nested submenu, footer actions, and open/closed state transitions).
Mobile menu JavaScript handlers
assets/js/main.js
Refactored mobile menu to target #mobileMenu/#menuToggle, toggle open class, synchronize aria-expanded/aria-hidden, lock/unlock document.body.style.overflow, close on link click and Escape, and expose closeMobileMenu() and toggleMobileMenu() globally.
Mobile menu HTML markup and header accessibility
layouts/partials/header-new.html
Switched header aria labels to i18n keys, set explicit aria-expanded="false" on toggle button, reordered hamburger SVG lines, and added mobile-menu dialog markup rendering menu items, grouped children, per-item icons, backdrop close, and footer (theme toggle + GitHub).
Theme toggle refinement and localization entries
assets/js/main.js, i18n/en.toml, i18n/fr.toml
updateThemeToggle() now toggles visibility for all sun/moon icon variants; added English and French i18n entries for mobile menu open/close labels, mobile navigation title, theme toggle, theme, and GitHub strings.
Dark mode styling update
assets/css/futuristic.css
Changed .timeline-year-header dark-mode selector to use [data-theme="dark"] attribute directly instead of combined media-query form.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix mobile menu display' directly and specifically describes the main change in the PR—a comprehensive mobile menu redesign with improved display and functionality.
Description check ✅ Passed The description clearly relates to the changeset, explaining the mobile menu improvements, showing before/after screenshots, and mentioning the page styling issue addressed.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@assets/css/futuristic.css`:
- Around line 83-85: The CSS custom property --font-sans has unquoted
font-family keywords (e.g., BlinkMacSystemFont and Roboto) causing Stylelint
value-keyword-case errors; fix it by quoting any multi-word or capitalized font
family names and ensuring consistent quotes for the list used in --font-sans
(e.g., wrap BlinkMacSystemFont and Roboto in quotes or use consistent quoting
for all family names) so Stylelint passes when validating the font-family token.

In `@assets/js/main.js`:
- Around line 105-125: The menu button label isn't updated when toggling the
menu; update the button text/label in both toggleMobileMenu() and
closeMobileMenu() so screen readers see current intent: after toggling open in
toggleMobileMenu() set the menuToggle element's visible label (e.g., textContent
or aria-label) to "Close menu" when isOpen is true and "Open menu" when false,
and in closeMobileMenu() explicitly set menuToggle's label to "Open menu" (or
update aria-label/textContent consistently) while still updating aria-expanded;
reference the elements with IDs "mobileMenu" and "menuToggle" inside those
functions.

In `@layouts/partials/header-new.html`:
- Around line 173-178: Add an aria-controls attribute to the mobile menu toggle
so assistive tech knows which element it controls: update the button with id
"menuToggle" (which calls toggleMobileMenu()) to include
aria-controls="mobileMenu" that matches the mobile menu element's id (e.g., the
menu dialog element should have id="mobileMenu").
- Around line 176-177: The header template contains hardcoded English UI strings
(e.g., the mobile menu button aria-label "Open menu" and other new menu
labels/buttons referenced around the same region) that must be replaced with
i18n keys; update the elements that currently use literal text and aria
attributes (refer to the mobile menu button and the labels introduced near the
other noted blocks) to call the project's localization helper (use the same
i18n/key pattern used elsewhere in the project) and add corresponding string
keys to the locale files so all locales render correctly and no orphaned keys
remain.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 932a18c3-6824-4c14-aaeb-6eec7cff8493

📥 Commits

Reviewing files that changed from the base of the PR and between 6229ee8 and a585e9c.

📒 Files selected for processing (3)
  • assets/css/futuristic.css
  • assets/js/main.js
  • layouts/partials/header-new.html

Comment thread assets/css/futuristic.css
Comment thread assets/js/main.js
Comment thread layouts/partials/header-new.html
Comment thread layouts/partials/header-new.html Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
layouts/partials/header-new.html (1)

173-178: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add aria-controls="mobileMenu" to complete the accessibility binding.

The past review comment requesting aria-controls="mobileMenu" on this button remains unaddressed. Adding it explicitly binds the toggle to the controlled element for assistive technology.

♿ Proposed addition
 <button
   class="menu-toggle"
   id="menuToggle"
   aria-label="{{ i18n "mobileMenuOpenAriaLabel" }}"
   aria-expanded="false"
+  aria-controls="mobileMenu"
   onclick="toggleMobileMenu()"
 >
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@layouts/partials/header-new.html` around lines 173 - 178, The menu toggle
button lacks an explicit aria-controls binding; add aria-controls="mobileMenu"
to the element with id "menuToggle" (the button that calls toggleMobileMenu())
so assistive tech knows it controls the element with id "mobileMenu".
🧹 Nitpick comments (2)
layouts/partials/header-new.html (2)

202-202: 💤 Low value

Consider using <div role="dialog"> for semantic clarity.

The <aside> element is semantically meant for tangentially related content. For a modal dialog overlay, <div role="dialog"> or the native <dialog> element is more appropriate.

🎨 Semantic alternative
-<aside class="mobile-menu-panel" role="dialog" aria-modal="true" aria-label="{{ i18n "mobileNavigationAriaLabel" }}">
+<div class="mobile-menu-panel" role="dialog" aria-modal="true" aria-label="{{ i18n "mobileNavigationAriaLabel" }}">
   ...
-</aside>
+</div>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@layouts/partials/header-new.html` at line 202, The mobile overlay currently
uses an <aside class="mobile-menu-panel"> which is semantically for tangential
content; change this element to either a <div role="dialog"> or a native
<dialog> to reflect its modal behavior (preserve class="mobile-menu-panel" and
all aria attributes like aria-modal and aria-label/i18n). Update any JS/CSS that
target the aside selector (e.g., queries or styles referencing
aside.mobile-menu-panel) to the new selector (div.mobile-menu-panel or
dialog.mobile-menu-panel) and ensure focus management/aria attributes remain
unchanged on the element used by the mobile menu code.

59-71: ⚡ Quick win

Extract icon selection logic to a Hugo partial to eliminate triplication.

The icon-mapping logic for menu items (Communityri-team-line, Resource Modulesri-apps-2-line, etc.) is repeated three times: desktop dropdown (lines 59–71), mobile submenu (lines 226–238), and mobile top-level items (lines 249–258). Centralizing this in a partial (e.g., layouts/partials/menu-icon.html) reduces maintenance cost and keeps mappings consistent.

♻️ Refactor direction

Create layouts/partials/menu-icon.html:

{{- $name := . -}}
{{- if eq $name "Community" -}}
<i class="ri-team-line"></i>
{{- else if eq $name "Resource Modules" -}}
<i class="ri-apps-2-line"></i>
{{- else if eq $name "Guidelines" -}}
<i class="ri-book-open-line"></i>
{{- else if eq $name "Blog Posts" -}}
<i class="ri-article-line"></i>
{{- else if eq $name "Config. Management" -}}
<i class="ri-settings-3-line"></i>
{{- else if eq $name "Code of Conduct" -}}
<i class="ri-shield-check-line"></i>
{{- else if eq $name "Community Calls" -}}
<i class="ri-calendar-event-line"></i>
{{- else if eq $name "FAQ" -}}
<i class="ri-question-answer-line"></i>
{{- else if eq $name "Help" -}}
<i class="ri-lifebuoy-line"></i>
{{- else -}}
<i class="ri-file-text-line"></i>
{{- end -}}

Then replace each block with {{ partial "menu-icon.html" .Name }}.

Also applies to: 226-238, 249-258

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@layouts/partials/header-new.html` around lines 59 - 71, Create a new Hugo
partial named menu-icon.html that accepts the menu item name (use the passed-in
.Name) and centralizes the mapping of names to icon markup
(Community→ri-team-line, Resource Modules→ri-apps-2-line,
Guidelines→ri-book-open-line, Blog Posts→ri-article-line, Config.
Management→ri-settings-3-line, Code of Conduct→ri-shield-check-line, Community
Calls→ri-calendar-event-line, FAQ→ri-question-answer-line,
Help→ri-lifebuoy-line, default→ri-file-text-line); then replace each duplicated
icon block in header-new.html (the desktop dropdown block using .Name, the
mobile submenu block, and the mobile top-level items) with a call to the
partial: pass .Name into partial "menu-icon.html" so all three places use the
single source of truth for icons.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@layouts/partials/header-new.html`:
- Around line 173-178: The menu toggle button lacks an explicit aria-controls
binding; add aria-controls="mobileMenu" to the element with id "menuToggle" (the
button that calls toggleMobileMenu()) so assistive tech knows it controls the
element with id "mobileMenu".

---

Nitpick comments:
In `@layouts/partials/header-new.html`:
- Line 202: The mobile overlay currently uses an <aside
class="mobile-menu-panel"> which is semantically for tangential content; change
this element to either a <div role="dialog"> or a native <dialog> to reflect its
modal behavior (preserve class="mobile-menu-panel" and all aria attributes like
aria-modal and aria-label/i18n). Update any JS/CSS that target the aside
selector (e.g., queries or styles referencing aside.mobile-menu-panel) to the
new selector (div.mobile-menu-panel or dialog.mobile-menu-panel) and ensure
focus management/aria attributes remain unchanged on the element used by the
mobile menu code.
- Around line 59-71: Create a new Hugo partial named menu-icon.html that accepts
the menu item name (use the passed-in .Name) and centralizes the mapping of
names to icon markup (Community→ri-team-line, Resource Modules→ri-apps-2-line,
Guidelines→ri-book-open-line, Blog Posts→ri-article-line, Config.
Management→ri-settings-3-line, Code of Conduct→ri-shield-check-line, Community
Calls→ri-calendar-event-line, FAQ→ri-question-answer-line,
Help→ri-lifebuoy-line, default→ri-file-text-line); then replace each duplicated
icon block in header-new.html (the desktop dropdown block using .Name, the
mobile submenu block, and the mobile top-level items) with a call to the
partial: pass .Name into partial "menu-icon.html" so all three places use the
single source of truth for icons.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 522f6429-46e7-48e1-abab-134cf0691441

📥 Commits

Reviewing files that changed from the base of the PR and between a585e9c and 768cf73.

📒 Files selected for processing (3)
  • i18n/en.toml
  • i18n/fr.toml
  • layouts/partials/header-new.html
✅ Files skipped from review due to trivial changes (2)
  • i18n/en.toml
  • i18n/fr.toml

@gaelcolas

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
assets/js/main.js (1)

385-402: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add early return if headings array is empty after filtering.

If all TOC links reference non-existent anchors, headings will be [] after filter(Boolean), making headings[0] undefined. Line 400 then throws TypeError: Cannot read property 'id' of undefined.

🐛 Proposed fix
   const headings = tocLinks
     .map((link) => document.querySelector(link.getAttribute("href")))
     .filter(Boolean);
+  if (headings.length === 0) return;

   function onScroll() {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@assets/js/main.js` around lines 385 - 402, The onScroll function does not
handle the case where the headings array is empty after filtering, which occurs
when all TOC links reference non-existent anchors. This causes a TypeError when
trying to access current.id since current would be undefined. Add an early
return guard at the beginning of the onScroll function that checks if
headings.length is 0 and returns early before any other logic is executed,
preventing the undefined error.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@assets/js/main.js`:
- Around line 385-402: The onScroll function does not handle the case where the
headings array is empty after filtering, which occurs when all TOC links
reference non-existent anchors. This causes a TypeError when trying to access
current.id since current would be undefined. Add an early return guard at the
beginning of the onScroll function that checks if headings.length is 0 and
returns early before any other logic is executed, preventing the undefined
error.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 33fc61fb-c746-4a19-af3d-91debcd5d4b1

📥 Commits

Reviewing files that changed from the base of the PR and between 768cf73 and 39f0e43.

📒 Files selected for processing (2)
  • assets/css/futuristic.css
  • assets/js/main.js

@Gijsreyn Gijsreyn force-pushed the gh-254/main/fix-menu-toggle branch from 39f0e43 to f09cc39 Compare June 18, 2026 06:54
@gaelcolas

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@gaelcolas gaelcolas merged commit 0fad686 into dsccommunity:master Jun 18, 2026
2 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