Skip to content

implement @primer/behaviors displayInViewport for ActionMenu#7500

Open
francinelucca wants to merge 10 commits intomainfrom
test/pin-behaviors-canary-add-sample-story
Open

implement @primer/behaviors displayInViewport for ActionMenu#7500
francinelucca wants to merge 10 commits intomainfrom
test/pin-behaviors-canary-add-sample-story

Conversation

@francinelucca
Copy link
Member

@francinelucca francinelucca commented Feb 3, 2026

Relates to https://github.com/github/primer/issues/6361

This pull request enhances the ActionMenu component in several ways, focusing on improving its usability within dialogs and adding more flexibility to its overlay positioning. The most notable changes include the addition of a new example demonstrating ActionMenu inside a dialog, support for constraining overlays to the viewport, and a minor dependency update for @primer/behaviors.

Changelog

New

  • Added a default max-height: 100vh to .ActionMenuContainer in ActionMenu.module.css to ensure overlays do not exceed the viewport height.
  • InsideDialog example to ActionMenu.examples.stories.tsx demonstrating how ActionMenu can be used interactively inside a scrollable dialog.

Changed

  • update @primer/behaviors version to. v 1.10.2
  • Extended the ActionMenu.Overlay and AnchoredOverlay components to accept a new displayInViewport prop, allowing overlays to be constrained within the viewport for better handling in dialogs and scrollable layouts.

Removed

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

@changeset-bot
Copy link

changeset-bot bot commented Feb 3, 2026

⚠️ No Changeset found

Latest commit: 8e3cfe3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the staff Author is a staff member label Feb 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

@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 Feb 3, 2026
@francinelucca francinelucca added the skip changeset This change does not need a changelog label Feb 3, 2026
@github-actions github-actions bot temporarily deployed to storybook-preview-7500 February 3, 2026 04:27 Inactive
@primer-integration
Copy link

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

@github-actions github-actions bot requested a deployment to storybook-preview-7500 February 5, 2026 00:17 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-7500 February 5, 2026 00:31 Inactive
…om:primer/react into test/pin-behaviors-canary-add-sample-story
@primer-integration
Copy link

⚠️ Integration PR Outdated

This integration PR does not have the latest commit from the primer/react PR.

Integration PR references: 755e65c689320c15e12cd4254ca8c114f014d491
Latest commit on primer/react PR: a561f28a88a4ae5fee183ad5bd9a8a3cced58410

Please update the integration PR to reference the latest commit from the primer/react PR before reviewing workflow results.

@github-actions github-actions bot requested a deployment to storybook-preview-7500 February 5, 2026 18:25 Abandoned
@francinelucca francinelucca changed the title pin behaviors to canary version and add sample story implement @primer/behaviors displayInViewport for ActionMenu Feb 5, 2026
@github-actions github-actions bot requested a deployment to storybook-preview-7500 February 5, 2026 18:30 Abandoned
Copy link
Contributor

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 pull request implements support for displayInViewport from @primer/behaviors in the ActionMenu and AnchoredOverlay components to improve overlay positioning within dialogs and scrollable containers. The changes enhance the ActionMenu's usability by ensuring overlays remain constrained within the viewport, preventing overflow issues.

Changes:

  • Added displayInViewport prop support to ActionMenu.Overlay and AnchoredOverlay components, allowing overlays to be constrained within the viewport
  • Updated @primer/behaviors dependency from v1.10.0 to v1.10.2 to support the new functionality
  • Added default max-height: 100vh CSS rule to .ActionMenuContainer to prevent overlays from exceeding viewport height
  • Created InsideDialog example story demonstrating ActionMenu usage within a scrollable dialog

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/react/src/AnchoredOverlay/AnchoredOverlay.tsx Extends type definition to include displayInViewport and threads the prop to useAnchoredPosition hook
packages/react/src/ActionMenu/ActionMenu.tsx Extends MenuOverlayProps type to include displayInViewport and passes it to AnchoredOverlay component
packages/react/src/ActionMenu/ActionMenu.module.css Adds default max-height: 100vh to .ActionMenuContainer to constrain overlays within viewport
packages/react/src/ActionMenu/ActionMenu.examples.stories.tsx Adds comprehensive InsideDialog example demonstrating the new feature with scrollable content
packages/react/package.json Updates @primer/behaviors dependency to v1.10.2
package-lock.json Updates dependency tree for @primer/behaviors and workspace version references

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm skip changeset This change does not need a changelog staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant