Skip to content

Add nav dropdowns and restyle mobile menu - #641

Open
tbantle22 wants to merge 11 commits into
mainfrom
taylor/nav-dropdowns
Open

tbantle22 wants to merge 11 commits into
mainfrom
taylor/nav-dropdowns

Conversation

@tbantle22

Copy link
Copy Markdown
Collaborator

Library-only groundwork for the Homepage v3 nav. No apps touched.

Mobile — menu scrolls (the overflow was previously unreachable), rows restyled to full-bleed 60px with dividers, socials moved into flow so they stop overlapping the last link.

Desktop — full-bleed dropdown panel with a scrim.

New API (all additive): leftLinksMobile, mobileActions, MobileNavDropdown, DesktopNavDropdown.

Worth a look

  • .logoLeft no longer sets relative on .inner — .right uses ml-auto instead. Needed so a panel anchors to the header rather than the padding-inset inner div. Affects DoltHub, DoltLab and Workbench; looked identical locally, but Chromatic should confirm.
  • .container gaining relative activates its previously inert z-50. Sits below Modal (1000), mobile menu (100), Loader (2e9).

Not done yet

Desktop link spacing still uses .left a { ml-2 mr-10 }, so the dropdown trigger gets no gap — the design wants a uniform gap-46px. Nav height, centered links, and the #070f25 / #a5a7b8 tokens are also still open.

Stories cover each existing consumer's link shape as a regression baseline.

🤖 Generated with Claude Code

Mobile menu becomes a scrolling sheet of full-bleed 60px rows, with a
nav item that expands in place and a full-width action slot.
Desktop gets a full-bleed dropdown panel with a scrim.

Both dropdown triggers use Btn, since this package's preflight leaves
button backgrounds opaque on purpose.

`.logoLeft` no longer sets `relative` on `.inner`: `.right` is pinned
with `ml-auto` instead, so an absolutely positioned panel anchors to
the header and can span the full page width.

New API: leftLinksMobile, mobileActions, MobileNavDropdown,
DesktopNavDropdown. Stories cover each existing consumer's link shape
as a regression baseline.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tbantle22 tbantle22 added the components Related to changes in components package. label Sep 16, 2026
tbantle22 and others added 7 commits September 16, 2026 15:03
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds align ("full" | "left" | "right"), hideCaret, underlineOnOpen,
openOnHover and triggerClassName to DesktopNavDropdown. The scrim stays
a root child so it always covers the page while an anchored panel hangs
off the trigger instead.

The nav row now stretches to the navbar's full height, so an open item's
underline and an anchored panel both land on its bottom edge. `.left`
spaces with gap rather than margins on `a`, which skipped dropdown
triggers and left the row unevenly spaced.

Panel content no longer forces items-start; the navbar already centers
descendant anchors, which is what simple rows want, and cards set their
own alignment on an inner element.

Adds space-900 (#070F25) for the nav and dropdown ground.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds a mobileAccount slot to Navbar, rendered in its own region between
the links and actions so the 60px row styling never reaches it.

Mobile dropdowns get the design's chevron chip, a bottom border on the
open panel, and no longer impose row styling on panel content: the
`.links` rule skips anything inside [data-nav-panel], so cards and links
keep their own spacing. The story's panel links carry their own classes.

Also centers the mobile top bar's contents vertically, centers the
actions button at 327px from md up, and sets the logo-to-links gap on
the desktop nav to 64px.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The social row no longer takes `mt-auto` when actions sit directly above
it, so the Sign in/out button stays at the bottom with the social links
instead of splitting the free space.

A transparent navbar's open mobile menu now falls back to space-900, the
same ground as the opaque navbar, so signed in and signed out match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reverts the transparent menu fallback to the themed background-acc-1,
which kept DoltHub navy out of Workbench's menu, and adds
mobileMenuBgColor so a consumer can choose the open menu's ground. The
open menu's sticky top bar now uses that color too, so links scrolling
under it stay hidden.

Stories now cover each prop this PR adds: DesktopNavDropdown's align
(left/right), hideCaret, underlineOnOpen, openOnHover, className,
triggerClassName and controlled isOpen/setIsOpen; MobileNavDropdown's
className and controlled state; and Navbar's mobileAccount and
mobileMenuBgColor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With a transparent navbar, the bar over the page stays transparent while
the open menu's sticky bar now takes the menu's color. Adds a test for
menuBgColor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

Moderate accessibility and null-override issues remain unresolved.

Review effort: Lite
Findings: None

What changed in this PR

Library-only navigation groundwork for Homepage v3, adding mobile menu enhancements and reusable dropdown APIs.

Changes:

  • Adds configurable mobile navigation content and improved scrolling/layout.
  • Adds mobile and desktop dropdowns with scrim support.
  • Adds color token, exports, tests, and Storybook coverage.
File Description
packages/​components/​src/​tailwind/​theme/​base/​colors.ts Adds the space-900 color token.
packages/​components/​src/​Navbar/​index.tsx Wires new navigation props.
packages/​components/​src/​Navbar/​ForMobile/​NavDropdown.tsx Implements mobile dropdown behavior.
packages/​components/​src/​Navbar/​ForMobile/​NavDropdown.module.css Styles mobile dropdowns.
packages/​components/​src/​Navbar/​ForMobile/​index.tsx Integrates mobile navigation content.
packages/​components/​src/​Navbar/​ForMobile/​index.module.css Restyles and enables mobile menu scrolling.
packages/​components/​src/​Navbar/​ForDesktop/​NavDropdown.tsx Implements desktop dropdown behavior.
packages/​components/​src/​Navbar/​ForDesktop/​NavDropdown.module.css Styles desktop panels and scrims.
packages/​components/​src/​Navbar/​ForDesktop/​index.module.css Updates desktop layout and anchoring.
packages/​components/​src/​index.ts Exports the new dropdown components.
packages/​components/​src/​__tests__/​Navbar.test.tsx Extends mobile navigation tests.
packages/​components/​src/​__stories__/​MobileNavbar.stories.tsx Adds mobile stories.
packages/​components/​src/​__stories__/​DesktopNavDropdown.stories.tsx Adds desktop dropdown stories.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@tbantle22
tbantle22 marked this pull request as ready for review October 5, 2026 23:05
tbantle22 and others added 3 commits October 6, 2026 10:11
Also switches the desktop dropdown story to bg-space-900; its comment
said the colour was not in the palette, which stopped being true when
this branch added the token.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

components Related to changes in components package.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants