view_components icon indicating copy to clipboard operation
view_components copied to clipboard

do not allow non-modal Alpha::Dialog

Open keithamus opened this issue 1 year ago • 3 comments

Authors: Please fill out this form carefully and completely.

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?

Our Primer::Alpha::Dialog component should only ever be shown as modal. Today it's possible to make the Dialog initially open by calling .new(open: true).

While it is certainly contentious to have an initially open Dialog, it is still possible to get the Dialog in a weird state where it's [open] as non-modal.

This patch ensures that any [open]:not(:modal) dialogs are closed and re-opened as modal.

Screenshots

See VRT.

Integration

N/A

List the issues that this change affects.

Closes #2581

Risk Assessment

  • [x] 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

  • No new axe scan violation - This change does not introduce any new axe scan violations.

Merge checklist

  • [x] Added/updated tests
  • [ ] Added/updated documentation
  • [x] Added/updated previews (Lookbook)
  • [x] Tested in Chrome
  • [x] Tested in Firefox
  • [x] 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 avatar Feb 09 '24 17:02 keithamus

⚠️ Visual differences found

Our visual comparison tests found UI differences. Please review the differences by viewing the files changed tab to ensure that the changes were intentional.

Review visual differences

github-actions[bot] avatar Feb 09 '24 17:02 github-actions[bot]

🦋 Changeset detected

Latest commit: 7b56f25d52384220a0e2fbf5379d17f63695be6f

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

changeset-bot[bot] avatar Feb 09 '24 17:02 changeset-bot[bot]

A quick search across the codebase says no, I can’t see any instances that do this in dotcom or education.

keithamus avatar Feb 15 '24 08:02 keithamus