Skip to content

Paint the menu's panel chrome from the token contract and restyle the demo (3.0.0-beta.2) - #115

Merged
jasonrundell merged 7 commits into
mainfrom
claude/menu-chrome-demo-polish
Sep 4, 2026
Merged

jasonrundell merged 7 commits into
mainfrom
claude/menu-chrome-demo-polish

Conversation

@jasonrundell

@jasonrundell jasonrundell commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Why

The demo worked but looked broken. In v2 the demo's theme CSS painted the off-canvas nav and the mega / sub panels, added gutters and swapped in the angle icons by reaching into Emotion internals. The v3 migration dropped all of that and left no token to replace it, so on main today:

  • mega and sub panels have no background and overprint the page copy on desktop and mobile;
  • the desktop nav row sits below the painted 4rem shell (invisible on the Dark override);
  • the mobile-only "back" heading links render on desktop too (the "StoreDeals" mash-up, duplicated Outdoors / Bedroom labels);
  • nothing has a gutter, mega columns are bare flex children, links keep Topiary's underline plus a full-height hover block, and the chevron spans are empty.

What changed

Library (src/styles/style.css, rmmTokens.js, README token table)

  • New tokens, each defaulting to a Topiary token with a fallback: --rmm-panel-bg, --rmm-panel-border, --rmm-panel-shadow, --rmm-panel-padding, --rmm-link-radius, --rmm-icon-stroke, --rmm-gutter, --rmm-column-min-width, --rmm-line-height.
  • Removed --rmm-hamburger-top / --rmm-hamburger-left: the hamburger now sits inline at the right of a single 4rem top bar, so --rmm-menu-height defaults to --rmm-topbar-height.
  • Large breakpoint: top bar and main list share one row inside the shell; each mega panel drops down full-width as an auto-fill grid of columns with a border and shadow; sub lists render inline; the mobile-only heading rows are hidden.
  • Mobile: the nav, mega and sub panels paint --rmm-panel-bg, heading rows get a back chevron and a rule, forward items get a chevron.
  • slideDirection now applies to every level: under rmm__nav--slide-right the mega and sub panels rest off the right edge and animate with the mirror-image keyframes (with matching reduced-motion transforms and large-breakpoint overrides), so a right-sliding menu enters from the same side at every depth.
  • Links drop the underline inside the menu and hover as a rounded pill; chevrons are drawn from two borders so no icon assets ship; the top bar title takes --rmm-menu-text so dark override themes stay legible.
  • styleContract.test.js now asserts every panel surface paints from --rmm-panel-bg, that the removed tokens are gone, and that the right-slide panel rules use the right keyframes. README token table updated (still contract-tested).

Demos

  • Version bumped to 3.0.0-beta.1, then to 3.0.0-beta.2 (see note below); both demos reinstall from the repacked tarball.
  • Vite demo: hero with a monospace prop readout, feature cards, each switcher in its own card, all from Topiary tokens so data-theme re-skins page and menu together. The five override themes gain panel tokens so Dark / Monokai / Retro / Synthwave panels match their bars.
  • Vite demo: a second page at /slide-right/ (slide-right/index.htmlsrc/slide-right.tsx, a second Vite entry) mounts the same app with slideDirection="right" from the first render, so each slide side has a sharable URL. The Slide direction card cross-links the two pages. The entries are resolved with relative paths on purpose: Vercel installs only demo/, so the config cannot rely on @types/node hoisted from the repo root.
  • Next demo: page padding clears the fixed top bar.
  • docs/release/v3.0.0.md records what changed since beta.0 and that beta.2 still needs publishing; README migration notes explain that v3 paints its own panels.

Why beta.2: the panel slide-direction fix (previous commit) verified correct locally in both dev and from-scratch production builds, but the reporter still saw the old left-slide behavior on the deployed Vercel preview after a hard refresh in an incognito window. The tarball's content had changed three times under the single version string 3.0.0-beta.1, which risks a file:-dependency install cache resolving by path/version and serving stale content. Bumping to 3.0.0-beta.2 forces every install, including Vercel's, to resolve genuinely fresh tarball content. docs/release/v3.0.0.md now says to repack and bump together on every content change going forward.

Verification

  • npm test: 11 suites, 114 tests pass (includes axe scans, the new panel-chrome and slide-direction contract tests, README contract).
  • scripts/a11y-walkthrough/walk.cjs against the rebuilt harness: ALL PASS (rows 13 / 13a / 13c, both reduced-motion settings).
  • Vite demo: tsc -b, eslint, vite build clean, also with the repo-root node_modules hidden to mirror Vercel; screenshotted in all four Topiary themes and all five override themes at 1400px and 390px with Store and Outdoors open. Panels never show page content through them.
  • Slide direction, measured mid-animation in a real browser against a from-scratch production build (tsc -b && vite build, served with vite preview, matching what Vercel runs): under "right" the nav, the Store mega panel and the Outdoors sub panel all enter from positive x offsets (from the right); under "left" all three enter from negative offsets. With prefers-reduced-motion: reduce the closed panels rest off the matching edge and the open ones sit at x = 0. Re-verified after the beta.2 bump from a fully clean install (deleted node_modules, the tarball, and dist first).
  • Next demo: eslint and next build clean; next start SSR output carries data-theme and the menu markup.
  • CI green and the Vercel preview deployed on the current head (3ee6a68).

Before / after

Before (main): the Store panel overprints the page; on the Dark override the nav links are invisible.
After: see the screenshots attached in the session; happy to add them here on request.

🤖 Generated with Claude Code

https://claude.ai/code/session_017NynwxzG7ZKWBaHW4QAmcp

…contract

The v2 demo painted the off-canvas nav and the mega / sub panels, added
gutters and drew the angle icons from its theme CSS by reaching into
Emotion internals. v3 dropped all of that with no token to replace it, so
panels rendered transparent over page content, the desktop nav row sat
outside the painted shell, mobile-only back links showed on desktop and
nothing had a gutter.

The shipped stylesheet now owns that chrome:

- New tokens: --rmm-panel-bg, --rmm-panel-border, --rmm-panel-shadow,
  --rmm-panel-padding, --rmm-link-radius, --rmm-icon-stroke, --rmm-gutter,
  --rmm-column-min-width and --rmm-line-height, each defaulting to a
  Topiary token with a fallback.
- Removed --rmm-hamburger-top / --rmm-hamburger-left: the hamburger now
  sits inline at the right of a single 4rem top bar, so the mobile shell
  is one row (--rmm-menu-height defaults to --rmm-topbar-height).
- At the large breakpoint the top bar and main list share one row and
  each mega panel drops down full-width as a grid of columns; sub lists
  render inline and the mobile-only heading rows are hidden.
- Links drop Topiary's underline inside the menu and hover as a rounded
  pill; chevrons are drawn from borders so no icon assets ship.

styleContract.test.js asserts every panel surface paints from
--rmm-panel-bg and that the removed tokens are gone; the README token
table is updated and stays contract-tested.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NynwxzG7ZKWBaHW4QAmcp
The library half (panel chrome, single-row shell, grid mega panels) is
a contract change, so the package moves to 3.0.0-beta.1 and both demos
reinstall from the repacked tarball.

Vite demo: a hero with a monospace prop readout, feature cards in a
grid, and each switcher in its own card, all styled from Topiary
tokens so the four data-theme values re-skin the page and the menu
together. The five override themes gain --rmm-panel-bg / -border /
-shadow so Dark, Monokai, Retro and Synthwave panels match their bars
(Synthwave also steps its pixel font down a size).

Next demo: page padding clears the fixed top bar.

docs/release/v3.0.0.md records what changed since beta.0 and that
beta.1 still needs publishing; the README migration section explains
that v3 paints its own panels.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NynwxzG7ZKWBaHW4QAmcp
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
react-mega-menu Ready Ready Preview Sep 4, 2026 2:39am UTC

…as() enhancement

Review follow-up. Comments only in the stylesheet (the panel's
containing block at the large breakpoint must stay the fixed shell, and
the :has() active tint is an enhancement), a corrected comment on the
demo's top padding, and the tarball / demo lockfiles repacked so the
committed artifact matches the source.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NynwxzG7ZKWBaHW4QAmcp
…irection="right"

A second Vite entry (slide-right/index.html -> src/slide-right.tsx)
renders the same App with defaultSlideDirection="right", so each slide
side has a sharable page instead of only the in-page toggle. The Slide
direction card cross-links the two pages and the demo README documents
the entry.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NynwxzG7ZKWBaHW4QAmcp
Vercel installs only demo/, so vite.config.ts cannot rely on @types/node
being hoisted from the repo root; the node:url / import.meta.url entry
resolution failed its typecheck there. Relative input paths resolve
against the Vite root and need no Node imports. Verified by hiding the
repo root node_modules and running the demo's tsc -b and vite build.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NynwxzG7ZKWBaHW4QAmcp
The nav honoured slideDirection but the mega and sub panels that slide
over it always entered from the left, so a right-sliding menu fought
itself at every level below the first. Under rmm__nav--slide-right the
panels now rest off the right edge and animate with the mirror-image
keyframes, with matching reduced-motion transforms and large-breakpoint
overrides at one class higher specificity than the left-slide rules.

styleContract.test.js asserts the right-slide panel rules; the README
props row and release notes say the prop covers every level. Verified
in a real browser on both demo pages: mid-animation the mega and sub
panels enter from positive offsets under slideDirection="right" and
negative ones under "left", and reduced motion rests closed panels
off the matching edge. Tarball repacked; both demos reinstalled.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NynwxzG7ZKWBaHW4QAmcp
The right-slide-panel fix (215e856) is correct in the source and in a
from-scratch production build verified twice locally, but the reporter
still saw Store and Outdoors slide in from the left on the deployed
Vercel preview after a hard refresh in an incognito window. beta.1's
tarball changed content three times (panel chrome, doc comments, then
the panel slide-direction fix) while keeping one version string, which
risks a file:-dependency install cache resolving by path/version and
serving stale content instead of noticing the tarball changed.

Bumping to 3.0.0-beta.2 removes that risk: every install now resolves a
genuinely new dependency rather than relying on a cache correctly
detecting changed content at an unchanged specifier. Repacked the
tarball, pointed both demos at it, and reinstalled and rebuilt both
clean. docs/release/v3.0.0.md records why and the going-forward rule:
repack and bump together on every content change, not just the first
one per beta.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NynwxzG7ZKWBaHW4QAmcp
@jasonrundell jasonrundell changed the title Paint the menu's panel chrome from the token contract and restyle the demo (3.0.0-beta.1) Paint the menu's panel chrome from the token contract and restyle the demo (3.0.0-beta.2) Sep 4, 2026
@jasonrundell
jasonrundell merged commit 26a8cbf into main Sep 4, 2026
4 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