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

Dialog: Full screen & Bottom sheet support #4048

Merged
merged 100 commits into from
Jan 24, 2024
Merged

Conversation

maximedegreve
Copy link
Contributor

@maximedegreve maximedegreve commented Dec 11, 2023

Closes

Note: I've chosen not to tackle the issues mentioned here to avoid causing any disruptive changes.

Changelog

New

1️⃣ action-sheet dialog

We've implemented a range slider to easily adjust the size of the dialog using only a keyboard, enhancing accessibility. We've used a similar approach for our SplitPageLayout resizer. I've also implemented reduced-motion support.

Screen.Recording.2023-12-12.at.17.14.30.mov
keyboard.mov

2️⃣ full-screen dialog

This is quite simple, as it closely resembles the existing dialog behavior, with the only difference being that it's full-screen.

Screen.Recording.2023-12-12.at.17.15.47.mov

Changed

  • Storybook features always display dialogs in an open state so that snapshots can effectively capture any changes.
  • Removed the ability to change props in features for simplicity and consistency with other components
  • In the example called 'WithCustomRenderers', I've placed the header, content, and footer components inside the 'WithCustomRenderers' component. This change improves readability, especially when highlighting the code.

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

Copy link

changeset-bot bot commented Dec 11, 2023

🦋 Changeset detected

Latest commit: db63923

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

@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.

It's looking good! Just one little thing we might to address: we don't delay calling onClose when clicking the "x" or keying Esc

Kapture.2024-01-23.at.19.07.57.mp4

If this is intentional, don't worry about it.

// Arrow keys support in the testing library is currently not implemented and therefore can't be tested
// https://github.com/testing-library/user-event/issues/871

it('expands/contracts when using the range slider', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

If this merges before #4048, I mighjt update my PR to move these tests into the same test file.

@maximedegreve
Copy link
Contributor Author

Yeah that was intentionally because I thought you aren't swiping it away.

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.

Looking good. Since this is such a big PR, it might be nice to get a review from somebody who's "officially" and engineer before merging. Not required though 🙂

@maximedegreve maximedegreve added this pull request to the merge queue Jan 24, 2024
Merged via the queue into main with commit b99e5ff Jan 24, 2024
30 checks passed
@maximedegreve maximedegreve deleted the feature/full-screen-clean branch January 24, 2024 13:58
@primer primer bot mentioned this pull request Jan 24, 2024
@joshblack joshblack restored the feature/full-screen-clean branch January 24, 2024 23:19
@github-actions github-actions bot temporarily deployed to storybook-preview-4180 January 24, 2024 23:24 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants