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

Refactor Dialog to use <dialog> internally #2496

Merged
merged 7 commits into from
Jan 17, 2024

Conversation

keithamus
Copy link
Member

Reviewers: By approving this Pull Request you are approving the code change, as well as its deployment and mitigation plans.
Please read this description carefully. If you feel there is anything unclear or missing, please ask for updates.

What are you trying to accomplish?

This is a re-attempt at #2364 with some additional bugs fixed.

This PR changes Dialog to no longer use the modal-dialog element we had created to "ponyfill" the native dialog element. Now that native <dialog> is well supported, we can simply use that and remove the vast majority of our code.

We still need a <dialog-helper> element for 2 features:

Screenshots

It is identical in appearance.

Integration

Yes there is a subtle difference which we'll need to change code in dotcom for.

Our modal-dialog element mistakenly dispatches the cancel or close events on a dialog.

List the issues that this change affects.

Risk Assessment

  • Low risk the change is small, highly observable, and easily rolled back.
  • Medium risk changes that are isolated, reduced in scope or could impact few users. The change will not impact library availability.
  • High risk changes are those that could impact customers and SLOs, low or no test coverage, low observability, or slow to rollback.

What approach did you choose and why?

Anything you want to highlight for special attention from reviewers?

Accessibility

  • Fixes axe scan violation - This change fixes an existing axe scan violation.
  • No new axe scan violation - This change does not introduce any new axe scan violations.
  • New axe violation - This change introduces a new axe scan violation. Please describe why the violation cannot be resolved below.

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews (Lookbook)
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@keithamus keithamus requested a review from a team as a code owner January 11, 2024 13:02
@keithamus keithamus requested review from a team, lukasoppermann and jonrohan January 11, 2024 13:02
Copy link

changeset-bot bot commented Jan 11, 2024

🦋 Changeset detected

Latest commit: cb630a1

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

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

This comment was marked as resolved.

@keithamus keithamus changed the title Refactor dialog to use dialog internally Refactor Dialog to use <dialog> internally Jan 11, 2024
@keithamus keithamus force-pushed the refactor-dialog-to-use-dialog-internally branch from efa5fb8 to 67ab782 Compare January 11, 2024 14:45
Copy link
Contributor

@camertron camertron left a comment

Choose a reason for hiding this comment

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

Looks good to me 😄 Looks like there are a few CI issues, but otherwise 👍

Co-authored-by: Keith Cirkel <keithamus@users.noreply.github.com>
@keithamus keithamus merged commit 983e3a5 into main Jan 17, 2024
30 checks passed
@keithamus keithamus deleted the refactor-dialog-to-use-dialog-internally branch January 17, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants