refactor(components): Menu update#3142
Merged
Merged
Conversation
Deploying atlantis with
|
| Latest commit: |
2fb85ad
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a8ac97b1.atlantis.pages.dev |
| Branch Preview URL: | https://job-164254-menu-updates.atlantis.pages.dev |
|
Published Pre-release for ad39db8 with versions: To install the new version(s) for Web run: |
scotttjob
reviewed
May 11, 2026
| ); | ||
| }); | ||
|
|
||
| test("trigger variants render distinctly", async ({ page }) => { |
Beccaneer
reviewed
May 11, 2026
| }); | ||
|
|
||
| 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 () => { |
Contributor
There was a problem hiding this comment.
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?
Contributor
Author
There was a problem hiding this comment.
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");
Beccaneer
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why Is This Changing?
This main purpose of this PR is to address feedback from the original
Menuimplementation.What Is Changing?
The composable
Menunow mergesUNSAFE_*withclassName/styleusing Base UI'smergeProps.Visual regression coverage updated:
Menuinside aModalMenuMenubehaviourThe
Menu.mdfile has been rewritten (and renamed toMenu.spec.md) into a more true spec-style document.Consumer Impact
Validation
UNSAFE_*+ modern prop behaviourMenuspecReviewer Notes
mergeUnsafePropsbehaviourMenu.spec.mdChanges can be
tested via Pre-release
In Atlantis we use Github's built in pull request reviews.