Skip to content

refactor(components): Menu update#3142

Merged
taylorvnoj merged 14 commits into
masterfrom
JOB-164254/Menu-updates
May 11, 2026
Merged

refactor(components): Menu update#3142
taylorvnoj merged 14 commits into
masterfrom
JOB-164254/Menu-updates

Conversation

@taylorvnoj
Copy link
Copy Markdown
Contributor

@taylorvnoj taylorvnoj commented May 9, 2026

Why Is This Changing?

This main purpose of this PR is to address feedback from the original Menu implementation.

What Is Changing?

The composable Menu now merges UNSAFE_* with className/style using Base UI's mergeProps.

Visual regression coverage updated:

  • Menu inside a Modal
  • long scrollable desktop Menu
  • bottom-edge placement
  • long submenu and prefix/suffix variants
  • custom trigger variants
  • small screen long Menu behaviour

The Menu.md file has been rewritten (and renamed to Menu.spec.md) into a more true spec-style document.

Consumer Impact

  • Impact: Low
  • Action required: None
  • Breaking change: No

Validation

  • added/updated unit coverage for merged UNSAFE_* + modern prop behaviour
  • added visual regression coverage
  • updated Menu spec
  • generated new/update visual snapshots

Reviewer Notes

  • mergeUnsafeProps behaviour
  • thoughts on Menu.spec.md

Changes can be
tested via Pre-release


In Atlantis we use Github's built in pull request reviews.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 9, 2026

Deploying atlantis with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2fb85ad
Status: ✅  Deploy successful!
Preview URL: https://a8ac97b1.atlantis.pages.dev
Branch Preview URL: https://job-164254-menu-updates.atlantis.pages.dev

View logs

@taylorvnoj taylorvnoj changed the title removing aria references from classes and other PR feedback refactor(components): Menu update May 9, 2026
@taylorvnoj taylorvnoj self-assigned this May 11, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

Published Pre-release for ad39db8 with versions:

  - @jobber/components@7.9.1-JOB-164254-ad39db8.11+ad39db89b

To install the new version(s) for Web run:

pnpm add @jobber/components@7.9.1-JOB-164254-ad39db8.11+ad39db89b

@taylorvnoj taylorvnoj marked this pull request as ready for review May 11, 2026 12:13
@taylorvnoj taylorvnoj requested a review from a team as a code owner May 11, 2026 12:13
);
});

test("trigger variants render distinctly", async ({ page }) => {
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.

love all the new tests!

});

it("prefers className and style when both prop styles are provided", async () => {
it("merges className and style when both modern and UNSAFE props are provided", async () => {
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.

I looked at this PR earlier and this is the only thing that stuck out to me - what happens or is there a test for the case of a style collision? (like modern and unsafe both try to define border?) Or does this test that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, this fixture is already setting up collision cases, and the updated test now asserts the precedence explicitly. In TestUnsafePropPrecedenceMenu we have:

<Menu.Content
  UNSAFE_style={{
    border: "1px solid red",
    backgroundColor: "rgb(240, 240, 240)",
  }}
  style={{ border: "2px solid blue" }}
>

and on the item:

<Menu.Item
  UNSAFE_style={{ color: "rgb(1, 2, 3)", margin: "11px" }}
  style={{ margin: "22px" }}
  textValue="Open"
>

So the test is covering both cases now:

  • border and margin are true collisions, and we assert the modern props win
  • backgroundColor and color are non-conflicting keys, and we assert they still merge through

So I updated the assertions, so it’s now testing both merge behavior and precedence behavior.

expect(menu).toHaveStyle("border: 2px solid blue");
expect(menu).not.toHaveStyle("border: 1px solid red");

expect(item).toHaveStyle("margin: 22px");
expect(item).not.toHaveStyle("margin: 11px");

@taylorvnoj taylorvnoj merged commit 3248492 into master May 11, 2026
14 checks passed
@taylorvnoj taylorvnoj deleted the JOB-164254/Menu-updates branch May 11, 2026 18:42
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.

3 participants