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

Removing the button wrapper when using a tooltip with a button #2296

Merged
merged 12 commits into from
Nov 8, 2023

Conversation

jonrohan
Copy link
Member

@jonrohan jonrohan commented Oct 19, 2023

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?

Remove the withTooltip wrapper that we add to buttons when they have a tooltip.

The wrapper was initially added https://github.com/github/primer/issues/826 because of elements using different positioning the tooltip would end up in an incorrect place. However since this issue was occurring we have refactored tooltip to use the popover browser api #2111 which takes care of positioning problems.

Screenshots

There shouldn't be any visual changes. Some of our components the spacing slightly changed because we're not dealing with the double dom elements anymore. I would consider the old state broken and the new images as fixed.

Integration

There is some code changes, the wrapper_arguments was removed, anything in these arguments should be moved to the main system arguments of the component.

Example:

- <%= render Primer::Beta::Button.new(wrapper_arguments: { classes: "foo" }, classes: "bar") %>
+ <%= render Primer::Beta::Button.new(classes: "foo bar") %>

We should send this PR only to review-lab to make sure we don't see any regressions.

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.

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.

@changeset-bot
Copy link

changeset-bot bot commented Oct 19, 2023

🦋 Changeset detected

Latest commit: 3802727

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

@jonrohan jonrohan temporarily deployed to preview October 19, 2023 20:03 — with GitHub Actions Inactive
@github-actions github-actions bot added ruby Pull requests that update Ruby code css Pull requests that update CSS code labels Oct 19, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 19, 2023

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

@jonrohan jonrohan temporarily deployed to preview October 19, 2023 20:17 — with GitHub Actions Inactive
@jonrohan jonrohan force-pushed the removing_button_with_tooltip_wrapper branch from 6d77854 to 3eb29d7 Compare November 7, 2023 18:28
@jonrohan jonrohan marked this pull request as ready for review November 7, 2023 18:30
@jonrohan jonrohan requested a review from a team as a code owner November 7, 2023 18:30
@jonrohan jonrohan requested review from a team, tobiasahlin, camertron and langermank and removed request for tobiasahlin November 7, 2023 18:30
Copy link
Contributor

@langermank langermank left a comment

Choose a reason for hiding this comment

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

Nice work!

Copy link
Member

@keithamus keithamus left a comment

Choose a reason for hiding this comment

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

🔥

@jonrohan jonrohan merged commit 3374555 into main Nov 8, 2023
29 of 30 checks passed
@jonrohan jonrohan deleted the removing_button_with_tooltip_wrapper branch November 8, 2023 21:53
@primer primer bot mentioned this pull request Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css Pull requests that update CSS code minor release ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants