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

Overlay: Add min-width to Overlay container #5129

Merged
merged 20 commits into from
Oct 31, 2024
Merged

Conversation

TylerJDev
Copy link
Contributor

@TylerJDev TylerJDev commented Oct 15, 2024

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

Adds a prop that enables "reflow", making the Overlay responsive when the screen width reaches a breakpoint of 320px.

Example: Memex Nested Overlays Story

Draft note: The prop is added so that this doesn't affect implementations that utilize Overlay such as ActionMenu and others.

Example video

Screen.Recording.2024-10-28.at.2.34.39.PM.mov

Video description: Video showcases the responsiveness of the "Memex Nested Overlays" story. I adjust the width of the viewport to demonstrate the reflow behavior of the Overlay component.

Changelog

Changed

  • Adds min-width to Overlay container

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 Oct 15, 2024

🦋 Changeset detected

Latest commit: 2f7a92c

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 Minor

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

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!

@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 Oct 15, 2024
@github-actions github-actions bot temporarily deployed to storybook-preview-5129 October 15, 2024 19:20 Inactive
Copy link
Contributor

github-actions bot commented Oct 15, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 97.75 KB (+0.09% 🔺)
packages/react/dist/browser.umd.js 98.05 KB (+0.04% 🔺)

@github-actions github-actions bot temporarily deployed to storybook-preview-5129 October 15, 2024 20:23 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-5129 October 15, 2024 20:31 Inactive
@TylerJDev TylerJDev requested a review from mperrotti October 15, 2024 20:53
@github-actions github-actions bot temporarily deployed to storybook-preview-5129 October 27, 2024 14:47 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-5129 October 28, 2024 12:59 Inactive
@primer-integration
Copy link

primer-integration bot commented Oct 28, 2024

🟢 golden-jobs completed with status success.

@github-actions github-actions bot temporarily deployed to storybook-preview-5129 October 28, 2024 18:38 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-5129 October 28, 2024 18:41 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-5129 October 29, 2024 22:02 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-5129 October 29, 2024 22:13 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-5129 October 29, 2024 22:19 Inactive
@@ -227,7 +231,7 @@ const Overlay = React.forwardRef<HTMLDivElement, OwnOverlayProps>(
...styleFromProps,
} as React.CSSProperties
}
data-reflow-container={reflowSize && reflow ? true : undefined}
data-reflow-container={overflow || (reflowSize && !preventOverflow) ? true : undefined}
Copy link
Member

Choose a reason for hiding this comment

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

I'm confused about this logic, wouldn't the second part be overriding the FF? or is that the intent here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For this, I was thinking of adding the prop outside of the FF, but putting the opt-out factor inside the feature flag. So basically someone could use the prop today, but they'd have to pass it themselves.

if overflow is true, that means that the FF is enabled and a consumer would have to opt-out of it via preventOverflow=true. Otherwise, if the FF is not enabled, they must pass in preventOverflow="false" in order to get the reflow style.

Copy link
Member

Choose a reason for hiding this comment

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

ahh I see, thanks for explaining that!

@github-actions github-actions bot temporarily deployed to storybook-preview-5129 October 30, 2024 13:38 Inactive
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.

🚀

@github-actions github-actions bot temporarily deployed to storybook-preview-5129 October 31, 2024 18:45 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-5129 October 31, 2024 19:14 Inactive
@TylerJDev TylerJDev added this pull request to the merge queue Oct 31, 2024
Merged via the queue into main with commit e27decd Oct 31, 2024
43 checks passed
@TylerJDev TylerJDev deleted the tylerjdev/overlay-reflow branch October 31, 2024 19:40
@primer primer bot mentioned this pull request Oct 31, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants