Skip to content

Feature/layout navigation v2#2635

Draft
bramvanderholst wants to merge 7 commits into
canaryfrom
feature/layout-navigation-v2
Draft

Feature/layout navigation v2#2635
bramvanderholst wants to merge 7 commits into
canaryfrom
feature/layout-navigation-v2

Conversation

@bramvanderholst
Copy link
Copy Markdown
Contributor

@bramvanderholst bramvanderholst commented May 28, 2026

Summary

Refactors LayoutNavigation in the example storefronts from a single ~180-line file
into composable pieces and moves the canonical LayoutDefault from
@graphcommerce/next-ui into each project's components/Layout/. No visual change,
no breaking imports.

What's in this PR

  • Split LayoutNavigation into Header/Header.tsx, Header/HeaderContainer.tsx,
    MenuOverlay.tsx, and a project-local LayoutDefault.tsx. HeaderContainer is the
    <Container component='header'> wrapper lifted out of LayoutDefault, so each project
    fully owns its header container (sticky, mobile pointer-events, styling) without
    forking next-ui.
  • Header/ and Footer/ live in their own subfolders so future additions
    (mega menu, mobile-only header, extra footer columns) don't require further moves.
  • LayoutMinimal uses the same local LayoutDefault + HeaderContainer as the
    canonical pattern.
  • disableScrollEffects prop added to CartFab and NavigationFab, which makes
    it easier to drop them into a fully-custom header.
  • @graphcommerce/next-ui's LayoutDefault is marked @deprecated. The
    implementation stays in place; the deprecation only points consumers at the local copy
    they already have after a sync.

Migration

Old monolithic version is kept as LayoutNavigationLegacy.tsx. To revert, flip one line
in components/Layout/index.ts:

export * from './LayoutNavigation'
// export * from './LayoutNavigationLegacy'

…outNavigation

Unchaged for now. Changes coming in next commits.
…w local LayoutDefault in new LayoutNavigation

Unchaged for now (except import paths). Changes coming in next commits.
… components

LayoutNavigation was a big file that mixed the navigation overlay,
the header content, and the layout shell.
Customizing the header — sticky behavior, owning the container styling,
or adding a beforeHeader slot — required forking the whole file or
copying chunks of @graphcommerce/next-ui's LayoutDefault.

The header is now four reusable pieces:

  - HeaderContainer  the <Container component='header'> wrapper, lifted
                     out of LayoutDefault so each project owns its
                     header container.
  - Header           the header content (Logo, DesktopNavBar,
                     DesktopNavActions, MobileTopRight).
  - MenuOverlay      the NavigationProvider + NavigationOverlay.
  - LayoutDefault    a local copy that renders the `header` slot raw,
                     since the wrapping now lives in HeaderContainer.

Keeping LayoutDefault as a project-local copy makes the layout shell
itself customizable: tweaking the grid, the fab container, the
beforeHeader slot or the sticky behavior no longer requires patching
@graphcommerce/next-ui or copying the file — the example owns it.
Combined with the extracted Header / MenuOverlay / HeaderContainer,
projects can override any single piece without forking the rest.

LayoutNavigation becomes a slim orchestrator that composes them.
LayoutMinimal is updated to use the same local LayoutDefault +
HeaderContainer so both layouts share the canonical header pattern.

The previous monolithic version is kept as LayoutNavigationLegacy.tsx.
The active version is selected with a one-line switch in
components/Layout/index.ts:

    export * from './LayoutNavigation'
    // export * from './LayoutNavigationLegacy'

There is no visual change in the new default path:
HeaderContainer carries the same styling that the
header slot of next-ui's LayoutDefault used to apply.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
graphcommerce-246 Ready Ready Preview May 29, 2026 2:02pm
graphcommerce-247 Ready Ready Preview May 29, 2026 2:02pm
graphcommerce-hygraph-dynamic-rows-ui Ready Ready Preview May 29, 2026 2:02pm
graphcommerce-open-source Ready Ready Preview May 29, 2026 2:02pm
graphcommerce-storyblok Ready Ready Preview May 29, 2026 2:02pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 28, 2026

🦋 Changeset detected

Latest commit: fddc406

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 86 packages
Name Type
@graphcommerce/magento-cart Major
@graphcommerce/next-ui Major
@graphcommerce/magento-open-source Major
@graphcommerce/magento-storyblok Major
@graphcommerce/magento-graphcms Major
@graphcommerce/address-fields-nl Major
@graphcommerce/algolia-categories Major
@graphcommerce/algolia-insights Major
@graphcommerce/algolia-personalization Major
@graphcommerce/algolia-products Major
@graphcommerce/algolia-recommend Major
@graphcommerce/algolia-search Major
@graphcommerce/demo-magento-graphcommerce Major
@graphcommerce/ecommerce-ui Major
@graphcommerce/google-datalayer Major
@graphcommerce/google-playstore Major
@graphcommerce/googleanalytics Major
@graphcommerce/googlerecaptcha Major
@graphcommerce/googletagmanager Major
@graphcommerce/hygraph-dynamic-rows Major
@graphcommerce/hygraph-ui Major
@graphcommerce/lingui-next Major
@graphcommerce/magento-cart-checkout Major
@graphcommerce/magento-cart-coupon Major
@graphcommerce/magento-cart-email Major
@graphcommerce/magento-cart-items Major
@graphcommerce/magento-cart-payment-method Major
@graphcommerce/magento-cart-pickup Major
@graphcommerce/magento-cart-shipping-address Major
@graphcommerce/magento-cart-shipping-method Major
@graphcommerce/magento-category Major
@graphcommerce/magento-compare Major
@graphcommerce/magento-customer Major
@graphcommerce/magento-graphql-rest Major
@graphcommerce/magento-newsletter Major
@graphcommerce/magento-payment-adyen Major
@graphcommerce/magento-payment-afterpay Major
@graphcommerce/magento-payment-braintree Major
@graphcommerce/magento-payment-included Major
@graphcommerce/magento-payment-klarna Major
@graphcommerce/magento-payment-multisafepay Major
@graphcommerce/magento-payment-paypal Major
@graphcommerce/magento-payment-tokens Major
@graphcommerce/magento-product-bundle Major
@graphcommerce/magento-product-configurable Major
@graphcommerce/magento-product-downloadable Major
@graphcommerce/magento-product-grouped Major
@graphcommerce/magento-product-simple Major
@graphcommerce/magento-product-virtual Major
@graphcommerce/magento-product Major
@graphcommerce/magento-recently-viewed-products Major
@graphcommerce/magento-review Major
@graphcommerce/magento-search-overlay Major
@graphcommerce/magento-search Major
@graphcommerce/magento-store Major
@graphcommerce/magento-wishlist Major
@graphcommerce/mollie-magento-payment Major
@graphcommerce/storyblok-ui Major
@graphcommerce/framer-next-pages-example Major
@graphcommerce/framer-scroller-example Major
@graphcommerce/graphcms-ui Major
@graphcommerce/magento-cms Major
@graphcommerce/docs Major
@graphcommerce/browserslist-config-pwa Major
@graphcommerce/changeset-changelog Major
@graphcommerce/eslint-config-pwa Major
@graphcommerce/graphql-codegen-markdown-docs Major
@graphcommerce/graphql-codegen-near-operation-file Major
@graphcommerce/graphql-codegen-relay-optimizer-plugin Major
@graphcommerce/misc Major
@graphcommerce/next-config Major
@graphcommerce/prettier-config-pwa Major
@graphcommerce/typescript-config-pwa Major
@graphcommerce/cli Major
@graphcommerce/framer-next-pages Major
@graphcommerce/framer-scroller Major
@graphcommerce/framer-utils Major
@graphcommerce/graphql-mesh Major
@graphcommerce/graphql Major
@graphcommerce/hygraph-cli Major
@graphcommerce/hygraph-dynamic-rows-ui Major
@graphcommerce/image Major
@graphcommerce/magento-graphql Major
@graphcommerce/react-hook-form Major
@graphcommerce/service-worker Major
@graphcommerce/image-example Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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