Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActionBar: Ensure overflow menu only exists if there is no space #5476

Merged
merged 6 commits into from
Dec 30, 2024

Conversation

TylerJDev
Copy link
Contributor

@TylerJDev TylerJDev commented Dec 23, 2024

Closes https://github.com/github/primer/issues/4584

Ensures that the "overflow" menu in ActionBar only appears when there is no space for all items. Also ensures that the overflow menu is present if there is no space for all items on initial render.

Fixed behavior:

Screen.Recording.2024-12-23.at.7.36.19.PM.mov
Video description

Video showing ActionBar at different resize points. When the small screen size is shown, the overflow menu in ActionBar appears. When at a medium screen size, the overflow menu is hidden and all menu items are present.

Changelog

Changed

  • Overflow menu will only appear if there is no space for all items
  • Overflow menu will appear on initial render if there is no space for all items

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

Copy link

changeset-bot bot commented Dec 23, 2024

🦋 Changeset detected

Latest commit: ea548fe

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

This PR includes changesets to release 1 package
Name Type
@primer/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

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Dec 23, 2024
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

Copy link
Contributor

github-actions bot commented Dec 23, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 103.67 KB (-0.1% 🔽)
packages/react/dist/browser.umd.js 104.06 KB (-0.05% 🔽)

@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/356310

@primer-integration
Copy link

🔴 golden-jobs completed with status failure.

@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Dec 27, 2024
@github-actions github-actions bot temporarily deployed to storybook-preview-5476 December 27, 2024 15:58 Inactive
@TylerJDev TylerJDev force-pushed the tylerjdev/fix-actionbar-resize-bug branch from ca815b8 to 7600df6 Compare December 27, 2024 17:33
@github-actions github-actions bot temporarily deployed to storybook-preview-5476 December 27, 2024 17:35 Inactive
@TylerJDev TylerJDev marked this pull request as ready for review December 27, 2024 18:52
@TylerJDev TylerJDev requested a review from a team as a code owner December 27, 2024 18:52
Copy link
Member

@francinelucca francinelucca left a comment

Choose a reason for hiding this comment

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

🚀

@@ -160,6 +161,9 @@ const overflowEffect = (
}

updateListAndMenu({items, menuItems})
} else if (numberOfItemsPossible >= childArray.length && hasActiveMenu) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: the '=' part of this condition(I think) never happens because of the equality check on L139

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! the less code the better 😂

@TylerJDev TylerJDev added this pull request to the merge queue Dec 30, 2024
Merged via the queue into main with commit 578a33d Dec 30, 2024
42 checks passed
@TylerJDev TylerJDev deleted the tylerjdev/fix-actionbar-resize-bug branch December 30, 2024 15:27
@primer primer bot mentioned this pull request Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: failing Changes in this PR cause breaking changes in gh/gh update snapshots
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants