Skip to content

feat: three-column mega-menu with Tabler icons and unified nav pills#76

Merged
eamonxg merged 2 commits into
masterfrom
feat/mega-menu-three-column
Jun 15, 2026
Merged

feat: three-column mega-menu with Tabler icons and unified nav pills#76
eamonxg merged 2 commits into
masterfrom
feat/mega-menu-three-column

Conversation

@eamonxg

@eamonxg eamonxg commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

Redesign the desktop mega-menu as a centered three-column canvas and unify the navigation interaction language across both dropdown modes.

  • Layout: centered three-column grid — anchor (icon + title) / submenu / device board. Below lg the side columns drop so tablets get just the submenu column; below md it's the existing mobile drawer.
  • First-level icons: mapped by LuCI node name (Tabler set, stable & language-independent), with a default icon fallback for unmapped sections.
  • Submenu: column-flow, content-width columns that grow rows (not width) via --menu-rows; the panel only scrolls once it exceeds the viewport.
  • Unified pill: hover/active are now one pill vocabulary across top triggers and submenu links in both mega-menu and boxed-dropdown modes — the old underline is gone.
  • Active page: submenu now marks the current page (isActivePath) so it gets the active pill, matching the top-level trigger.
  • Device board: moved to the right column (cloned per panel), gains an i18n Device label, uses Tabler icons (router / cpu / package / tag), and wraps long values instead of truncating.
  • Accessibility: global prefers-reduced-transparency fallback — drops backdrop-filter blur and makes the mega-menu background opaque.

Test plan

  • pnpm build
  • pnpm test ✓ (57/57)
  • ⚠️ Needs on-device check (pnpm dev): hover/expand + cross-fade, board clone in the third column, 4-column fit for heavy categories (e.g. Network/Services), and tablet width showing only the submenu column.

🤖 Generated with Claude Code

Redesign the desktop mega-menu as a centered three-column canvas and
unify the navigation interaction language.

- Layout: centered grid (anchor / submenu / device board); below lg the
  side columns drop so tablets get just the submenu column.
- First-level icons mapped by LuCI node name (Tabler set), with a
  default fallback for unmapped sections.
- Submenu fills the middle column top-to-bottom with content-width
  columns, growing rows not width; the panel scrolls only past viewport.
- Unified pill hover/active across top triggers and submenu links in
  both mega-menu and boxed-dropdown modes; drop the old underline.
- Mark the active submenu page so it gets the active pill.
- Device board moves to the right column (cloned per panel), gains an
  i18n "Device" label, uses Tabler icons (router/cpu/package/tag), and
  wraps long values instead of truncating.
- Global prefers-reduced-transparency fallback: drop backdrop blur and
  make the mega-menu background opaque.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread .dev/src/media/_layout.css Outdated
Fixed max-width keeps every category the same width, so switching
is a pure cross-fade. Below lg the side tracks drop and only the
links column remains (tablet → just the submenu). */
@apply pointer-events-none absolute inset-x-0 top-14 mx-auto grid max-w-[72rem] translate-y-1.5 grid-cols-[12rem_minmax(0,1fr)_13rem] gap-x-8 px-10 pt-7 pb-8 opacity-0 transition-[opacity,transform] duration-[250ms] ease-out max-lg:max-w-[44rem] max-lg:grid-cols-1 max-lg:px-8;

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This panel is not bounded by the viewport and has no scrolling mechanism. Because .desktop-menu-container uses overflow-hidden, a tall submenu (or one enlarged by translation/font metrics) is clipped with no way to reach the hidden links, despite the PR promising that the panel scrolls once it exceeds the viewport. Please cap the panel/list against the available viewport height and add vertical overflow scrolling.

Comment thread .dev/src/resource/menu-aurora.js Outdated
E(
"a",
{
class: isActive ? "is-active-page" : "",

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

The current desktop submenu item gets the visual class but not aria-current="page". The shared sidebar/mobile renderer already sets that attribute, so mega-menu and boxed-dropdown users of assistive technology lose the current-page indication. Please add aria-current when isActive is true.

Comment thread .dev/src/media/_layout.css Outdated
--menu-icon is set per node name below; unmapped → default. */
&::before {
@apply size-6 shrink-0 bg-current content-[''];
mask: var(--menu-icon, url("@assets/icons/category.svg")) center / contain no-repeat;

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Repository CSS rules require declarations to be expressed through Tailwind @apply, and the review workflow explicitly flags raw CSS properties. Please express this mask through Tailwind arbitrary utilities (including the CSS-variable fallback) rather than adding a raw mask: declaration.

@eamonxg

eamonxg commented Jun 15, 2026

Copy link
Copy Markdown
Owner Author

Code Review

Summary

This PR coherently implements the three-column mega-menu, active navigation pills, per-panel device board, and reduced-transparency fallback. The generated assets match the source, and both pnpm test (57/57) and pnpm build pass, but the new mega-menu behavior itself is not covered by automated tests.

Issues Found

  • .dev/src/media/_layout.css:33 — oversized menus can be clipped by the container without a viewport height bound or scrolling mechanism.
  • .dev/src/resource/menu-aurora.js:267 — active desktop submenu links omit aria-current="page", unlike sidebar/mobile links.
  • .dev/src/media/_layout.css:49 — the raw mask: declaration violates the repository requirement to express styling through Tailwind @apply.

Suggestions

Add focused tests for desktop submenu active-page semantics and for the mega-menu structure (board clone, row calculation, and responsive overflow behavior).

@eamonxg eamonxg merged commit 1260f09 into master Jun 15, 2026
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.

1 participant