Skip to content

Update the default value of unsafeDisableTooltip to false and remove redundant props and wrappers - #4702

Merged
broccolinisoup merged 9 commits into
mainfrom
default-tooltip-icon-button
Jul 9, 2024
Merged

Update the default value of unsafeDisableTooltip to false and remove redundant props and wrappers#4702
broccolinisoup merged 9 commits into
mainfrom
default-tooltip-icon-button

Conversation

@broccolinisoup

@broccolinisoupbroccolinisoup commented Jun 27, 2024

Copy link
Copy Markdown
Member

Closes#2008
Related #4696

Note

We managed to complete the roll out at dotcom 🎉 (View the progress here (internal link only))

Changelog

Changed

  • The default value of unsafeDisableTooltip to false
  • Added unsafeDisableTooltip={true} a coupe of IconButton instances where it is not safe to enable tooltips.

Removed

  • Explicit Tooltip wrappers
  • unsafeDisableTooltip={false} prop since it is the default value now.

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

@changeset-bot

changeset-botBot commented Jun 27, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fd6bd57

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

This PR includes changesets to release 1 package
NameType
@primer/reactMinor

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

@github-actions

github-actionsBot commented Jun 27, 2024

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js91.05 KB (-0.08% 🔽)
packages/react/dist/browser.umd.js91.38 KB (+0.04% 🔺)

@broccolinisoupbroccolinisoup changed the title Update the default value of unsafeDisableTooltip to false and remove redundant props and wrappersUpdate the default value of unsafeDisableTooltip to false and remove redundant props and wrappersJun 28, 2024
@github-actions
github-actionsBottemporarily deployed to storybook-preview-4702 June 28, 2024 05:16 Inactive
@broccolinisoup
broccolinisoup marked this pull request as ready for review June 28, 2024 05:18
@broccolinisoup
broccolinisoup requested a review from a team as a code ownerJune 28, 2024 05:18
@broccolinisoupbroccolinisoup changed the title Update the default value of unsafeDisableTooltip to false and remove redundant props and wrappersDo not merge: Update the default value of unsafeDisableTooltip to false and remove redundant props and wrappersJun 28, 2024
@github-actions
github-actionsBottemporarily deployed to storybook-preview-4702 June 28, 2024 05:21 Inactive
expect(tooltipEl).not.toHaveAttribute(':popover-open')
})

// second ESC closes the dialog and returns focus

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This test is failing - Not sure how to address this. I am trying to await before pressing the second ESC but it doesn't seem to be working. Any suggestions, thoughts? 🤔

@joshblack
joshblack removed their request for review July 2, 2024 15:25
})

it('Returns focus to returnFocusRef on escape', async () => {
const {getByTestId, queryByTestId} = HTMLRender(<Component />)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I had an issue with this existing component. It was supposed to go back to the return ref after pressing the ESC twice (First closing the tooltip, second closing the dialog) but for some reason it didn't work, even though I waited for the previous keyboard event to be completed. This test wasn't about the tooltip itself; it is about the Dialog so I updated to use a different dialog but let me know if I am misinterpreting the issue I encountered.

@joshblack
joshblack removed their request for review July 5, 2024 20:00
@broccolinisoupbroccolinisoup changed the title Do not merge: Update the default value of unsafeDisableTooltip to false and remove redundant props and wrappersUpdate the default value of unsafeDisableTooltip to false and remove redundant props and wrappersJul 8, 2024
<ButtonGroup>
<IconButton icon={PlusIcon} aria-label="Add" />
<IconButton icon={DashIcon} aria-label="Subtract" />
{/* We can remove these unsafe props after we resolve https://github.com/primer/react/issues/4129 */}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 Good to know!

import {useRefObjectAsForwardedRef} from './hooks/useRefObjectAsForwardedRef'
import {XIcon} from '@primer/octicons-react'

// Dialog v1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Classic! 😅

@siddharthkpsiddharthkp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good! Does what it says on the box, good work!

Lets run some integration tests with this before we merge

@siddharthkpsiddharthkp added react integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jul 8, 2024
@primer-integration

Copy link
Copy Markdown

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/332110

@broccolinisoup

Copy link
Copy Markdown
MemberAuthor

Integration tests pass https://github.com/github/github/pull/332110 and tested on RL, everything looks good 🎉

@broccolinisoup
broccolinisoup added this pull request to the merge queueJul 9, 2024
Merged via the queue into main with commit 2536b49Jul 9, 2024
@broccolinisoup
broccolinisoup deleted the default-tooltip-icon-button branch July 9, 2024 23:56
@primerprimerBot mentioned this pull request Jul 9, 2024
@siddharthkpsiddharthkp added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Aug 20, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: passingChanges in this PR do NOT cause breaking changes in gh/ghreact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IconButton should include Tooltip by default

2 participants

@broccolinisoup@siddharthkp