Skip to content

chore(ActionMenu): Add fullscreen capabilities #6108

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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

francinelucca
Copy link
Member

@francinelucca francinelucca commented May 21, 2025

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

This pull request introduces a new fullscreen variant for the ActionMenu component, along with related updates to improve responsiveness and user experience. Key changes include adding a fullscreen sample story, introducing a responsive close button for narrow viewports, and modifying the behavior of the ActionMenu and AnchoredOverlay components to support the fullscreen variant.

Changelog

New

  • Make AnchoredOverlay'svariant prop available in ActionMenu.Overlay
  • Add sample story of how to render ActionMenu in fullscreen in small viewports
  • special CSS for fullscreen variant in ActionMenu
  • Render a close button on AnchoredOverlay if fullscreen
  • AnchoredOverlay CSS to support close button on fullscreen variant
  • Added a displayCloseButton prop to show a close button in fullscreen mode in AnchoredOverlay, along with customizable closeButtonProps.
  • SelectPanel: Integrated the new displayCloseButton functionality to handle cancel and close actions in fullscreen mode.
  • Improved padding and layout adjustments for single-selection panels.

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 May 21, 2025

🦋 Changeset detected

Latest commit: 8c24cf1

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 staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels May 21, 2025
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 May 21, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 92.37 KB (+0.1% 🔺)
packages/react/dist/browser.umd.js 92.54 KB (+0.17% 🔺)

@github-actions github-actions bot requested a deployment to storybook-preview-6108 May 21, 2025 19:25 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-6108 May 21, 2025 19:39 Inactive
@francinelucca francinelucca requested a review from mperrotti May 22, 2025 03:04
@francinelucca francinelucca marked this pull request as ready for review May 22, 2025 03:04
@Copilot Copilot AI review requested due to automatic review settings May 22, 2025 03:04
@francinelucca francinelucca requested a review from a team as a code owner May 22, 2025 03:04
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This patch introduces a new fullscreen variant for the ActionMenu component and adds a sample Storybook story demonstrating fullscreen behavior in narrow viewports.

  • Exposes the underlying AnchoredOverlay variant prop on ActionMenu.Overlay with a default value
  • Defines a FullScreen example story showing how to toggle between anchored and fullscreen variants
  • Updates the changelog for a patch release

Reviewed Changes

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

File Description
packages/react/src/ActionMenu/ActionMenu.tsx Added variant to MenuOverlayProps, set default variant
packages/react/src/ActionMenu/ActionMenu.examples.stories.tsx Added FullScreen story showcasing the new fullscreen variant
.changeset/pink-trees-work.md Bumped patch release and updated changelog entry
Comments suppressed due to low confidence (2)

packages/react/src/ActionMenu/ActionMenu.examples.stories.tsx:111

  • Consider adding automated tests (unit, snapshot, or visual regression) for the new fullscreen variant to ensure it renders correctly across viewports and prevent regressions.
export const FullScreen = () => {

packages/react/src/ActionMenu/ActionMenu.examples.stories.tsx:127

  • [nitpick] Multiple list items share the label 'Option 2', which may confuse readers. Consider using unique labels (e.g., 'Option 3', 'Option 4') to clearly demonstrate multiple entries.
<ActionList.Item>Option 2</ActionList.Item>

@primer-integration
Copy link

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

@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 May 22, 2025
@primer-integration
Copy link

🟢 golden-jobs completed with status success.

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh labels May 22, 2025
Copy link
Contributor

@mperrotti mperrotti left a comment

Choose a reason for hiding this comment

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

These changes look good, but we should definitely add a "Close" button.

There are two ways we can do this:

  • (preferred) when variant is 'fullscreen', automatically render <IconButton icon={XIcon} onClick={onClose} aria-label="Close" /> at the top right of the <AnchoredOverlay> we use in <ActionMenu.Overlay>
  • Update the Storybook example to render <IconButton icon={XIcon} onClick={onClose} aria-label="Close" /> as a child of <ActionMenu.Overlay>

@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 May 29, 2025
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

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

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@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 Jun 16, 2025
@github-actions github-actions bot requested a deployment to storybook-preview-6108 June 16, 2025 22:18 Abandoned
@francinelucca francinelucca requested a review from TylerJDev June 16, 2025 22:23
@github-actions github-actions bot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed update snapshots integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jun 16, 2025
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions github-actions bot requested a deployment to storybook-preview-6108 June 16, 2025 22:29 Abandoned
@github-actions github-actions bot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jun 16, 2025
@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 Jun 16, 2025
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions github-actions bot temporarily deployed to storybook-preview-6108 June 16, 2025 22:41 Inactive
@github-actions github-actions bot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jun 16, 2025
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions github-actions bot requested a deployment to storybook-preview-6108 June 16, 2025 22:45 Abandoned
@github-actions github-actions bot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed update snapshots integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jun 16, 2025
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants