Skip to content

feat(evo-react): add fake menu - #790

Open
HenriqueLimas wants to merge 4 commits into
mainfrom
evo-fake-menu-react
Open

feat(evo-react): add fake menu#790
HenriqueLimas wants to merge 4 commits into
mainfrom
evo-fake-menu-react

Conversation

@HenriqueLimas

@HenriqueLimas HenriqueLimas commented Aug 4, 2026

Copy link
Copy Markdown
Member

Description

Adds EvoFakeMenu to @evo-web/react using the explicit compound-component API established by EvoMenu.

  • Adds root, items, item, badge, and separator components backed by existing Skin menu styles.
  • Supports anchor and button items, React 19 refs, custom framework link components through as, current and disabled states, class prefixes, and positioning variants.
  • Updates Skin to infer badged fake-menu items with :has(.badge) while retaining the legacy --badged selectors for compatibility.
  • Adds browser and SSR coverage, Storybook documentation, app migration guidance, and patch changesets for Skin and evo-react.

Notes

No issue number was provided. No verification hooks were bypassed.

Screenshots

Percy dry-run discovery found all eight Skin/Menu/Fake Menu stories, including the badged use case. No Percy build was created in dry-run mode.

Checklist

  • I verify the linked issue has been triaged ("Needs Triage" label removed)
  • I verify all changes are within scope of the linked issue
  • I added/updated/removed testing (Storybook in Skin) coverage as appropriate
  • I tested the UI in all supported browsers
  • I tested the UI in dark mode and RTL mode

Copilot AI lite review requested due to automatic review settings August 4, 2026 17:52
@changeset-bot

changeset-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4b23dfa

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

This PR includes changesets to release 2 packages
Name Type
@ebay/skin Patch
@evo-web/react Patch

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new EvoFakeMenu compound-component API to @evo-web/react, mirroring the Skin/legacy fake-menu markup patterns while providing React 19-friendly composition, SSR/browser tests, Storybook docs, and app migration guidance.

Changes:

  • Introduces EvoFakeMenu + subcomponents (Items, Item, ItemBadge, Separator) with shared context and Skin backing styles.
  • Adds Vitest browser + SSR snapshot coverage and a Storybook docs story for the new component.
  • Updates the app-migration skill docs and adds a patch changeset for @evo-web/react.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/evo-react/src/fake-menu/types.ts Public prop types for the compound API (root/items/item/badge/separator).
packages/evo-react/src/fake-menu/context.tsx Context plumbing for prefixed BEM base class.
packages/evo-react/src/fake-menu/fake-menu.tsx Root wrapper applying Skin classes/modifiers and providing context.
packages/evo-react/src/fake-menu/fake-menu-items.tsx <ul> wrapper establishing fake-menu__items + tabIndex={-1}.
packages/evo-react/src/fake-menu/fake-menu-item.tsx Anchor/button item rendering, current state, disabled handling, tick icon.
packages/evo-react/src/fake-menu/fake-menu-item-badge.tsx Badge wrapper mapping to EvoBadge with type="menu".
packages/evo-react/src/fake-menu/fake-menu-separator.tsx Separator <hr> inside <li> with context-prefixed separator class.
packages/evo-react/src/fake-menu/index.ts Barrel exports for component entrypoint + types.
packages/evo-react/src/fake-menu/README.md Minimal component README pointing to Storybook docs.
packages/evo-react/src/fake-menu/fake-menu.stories.tsx Storybook “autodocs” story + custom link adapter example.
packages/evo-react/src/fake-menu/test/test.server.tsx SSR snapshot coverage for key variants and classPrefix modifiers.
packages/evo-react/src/fake-menu/test/test.browser.tsx Browser tests for roles/attrs, current state, refs, and disabled behavior.
packages/evo-react/src/fake-menu/test/snapshots/test.server.tsx.snap Stored SSR snapshots for the new component.
.claude/skills/evo-app-migrate-react/SKILL.md Adds evo-fake-menu to the supported migration mapping table.
.claude/skills/evo-app-migrate-react/components/evo-fake-menu.md Component-specific migration guidance for apps moving off ebay-fake-menu.
.changeset/add-evo-fake-menu.md Patch changeset announcing the new component.

Comment on lines +48 to +54
<Component
{...(rest as ComponentProps<"a">)}
href={disabled ? undefined : href}
aria-disabled={disabled ? "true" : undefined}
aria-current={ariaCurrent}
className={itemClassName}
>
import type { EvoBadgeProps } from "../badge/types";

export type EvoFakeMenuProps = ComponentProps<"span"> & {
/** Prefix applied to item and separator BEM classes when embedded in another component. */
Comment thread .changeset/add-evo-fake-menu.md
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

PR Preview Deployed

Websiteevo-markoevo-reactebayui-coreebayui-core-reactskin

commit 4b23dfa

@ArtBlue ArtBlue left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Solid compound-component structure and thorough test/story coverage overall, but there's one blocking bug: EvoFakeMenuItem never applies the fake-menu__item--badged modifier class Skin's CSS requires for badge positioning, and nests the badge inside the label <span> instead of rendering it as a sibling — confirmed in the SSR snapshot (<span>Messages<span class="badge...">5</span></span>). The legacy ebayui-core-react implementation gets this right (hasBadge && "menu__item--badged"); this compound-API redesign lost it. Also non-blocking: the separator drops the explicit role="separator" its Marko sibling sets (native <hr> implies it, so low risk, but EvoFakeMenuSeparatorProps explicitly omits role from the props type, implying the intent was to hardcode it). Separately, both this PR's description and the migration doc say EvoFakeMenu follows "the same compound-component API as EvoMenu", but no EvoMenu React component exists in this repo (only evo-marko's evo-menu, which uses a different attr-tag/slot API) — worth double-checking that reference isn't a leftover from a different draft.

Comment thread packages/evo-react/src/fake-menu/fake-menu-item.tsx
export function EvoFakeMenuSeparator({
className,
...rest
}: EvoFakeMenuSeparatorProps) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Non-blocking: EvoFakeMenuSeparatorProps omits role from the native <hr> props (implying the component controls it), but no role="separator" is ever set here — the evo-marko sibling sets it explicitly (<hr class=... role="separator">). Native <hr> does default to an implicit separator role in most browsers/AT, so this likely isn't a real regression today, but consider setting it explicitly to match the sibling implementation and the apparent intent behind omitting role from the prop type.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There is a jsx-a11y/no-redundant-roles in eslint that fails if we add role="separator"

# Conflicts:
#	.claude/skills/evo-app-migrate-react/SKILL.md
#	.claude/skills/evo-migrate-react/SKILL.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

evo-react: migrate ebay-fake-menu

4 participants