Hosting Dashboard V2: Add notice component - #103578
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
|
@matt-west I noticed that the warning icon differs from the one used in Gutenberg. Was this intentional? Thank you! |
|
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
|
Feels like we have too much "Notice" components, we should get some clarity on what to use where and maybe adapt naming. |
This is meant to be a replacement for the Notice component. Not a new separate component. CC: @fcoveram as you worked on this design. |
|
Yes. As Joen said, it was thought to replace the current one. |
Oh nice! I'll update the component based on the Figma spec 🙂 |
| const hasLowDensity = density === 'low'; | ||
|
|
||
| return ( | ||
| <Card |
There was a problem hiding this comment.
Given the different notice densities, does it make sense at all to use Card and its subcomponents here vs just a div? Alternatively, should we look into updating Card to offer the same density (padding) options?
There was a problem hiding this comment.
Card already has a size prop which is pretty similar to the density options here. Could/should we use that?
There was a problem hiding this comment.
We could, but as you noticed, it may not follow the exact specs needed by Notice — that's why I was asking.
There was a problem hiding this comment.
Yeah, the padding on different Card sizes here doesn't match the padding used in the density option here 🥲
There was a problem hiding this comment.
It would be better if we could update the Card, CardHeading, and CardBody components to match the new design (or the styles of the new components), or consider creating a new unified one. Otherwise, we'll need to manually customize padding, font sizes, and other styles each time we implement a new component with a similar structure.
There was a problem hiding this comment.
The padding values consider the spacings inside the icon. So the difference is intentional to balance the layout in all density variants. Below you can see a quick test using the values applied in the design, and the ones inherited from Card.
Design paddings
The alignment is slightly off, but general spacings are balanced according to the page layout.
Card paddings.
The component's side spacings make it look more prominent.
There was a problem hiding this comment.
Can't we use the closest Card size then add margin/padding to the internal notice container to make up the difference? So for example if we want 24px padding, use card size small (16px padding) then add 4px padding to the notice container? Having typed that out I guess there's not much value 🙂
I suppose in an ideal world Card size presets would be a bit more expansive than they are currently.
There was a problem hiding this comment.
We can, probably not much of a difference with overriding Card's styles — the issue would be the same: if Card updates, this component would also need updating to avoid visual regressions
There was a problem hiding this comment.
I suppose the long-term solution would be to utilise some semantic spacing tokens from the Theme package.
|
Wasn't the idea to build this as an update to the Notice component in Calypso? |
Yes, I think @fcoveram added this in his redesign of the component. I presume to differentiate from the info icon which is very similar visually. |
I think it would be better to first consider which component we want to replace and plan how to roll out the replacement later. The original idea was to replace the Notice component in Gutenberg. See #103578 (comment). |
Well to clarify: it's all one DS, so even if the ultimate destination is improving the core component directly, for the moment the "upgrade" is being stored in the A8c components package. So to that end, Jay is right. What we want is a single notice: for now that likely has to live in A8c components but with its ultimate destination being WordPress core. What we want to avoid is having multiple components to choose from. Whether that means building this then deprecating the Calypso notice, or just replacing it immediately, I'll leave that to you. But we don't want them both coexisting. |
My suggestion would be to deprecate the old component and adopt the new one for all future notices. We can then progressively replace the existing instances of the Calypso notice, as a complete migration will likely require substantial effort 🙂 |
|
I'll defer to devs (you and others) on the approach there 👍 👍 |
|
Here's a quick GIF of the state: At a glance, looks good, will defer to @fcoveram. |
|
I'll let the rest of @Automattic/team-calypso confirm, but I believe the approach that we have in mind is:
|
|
@Automattic/team-calypso Could you help to review this to see if there is any blocker? Thank you 🙂 |
01f052b to
42ac58b
Compare
|
We need this component in Site Settings, and I don’t see any blockers at this point, so let’s move it forward and address any feedback in a follow-up PR 🙂 |
|
Hey folks 👋🏼🙂 Just a quick question: Do you know if there are any near-term plans to get this Notice component into @wordpress/components? We would like to use it in Studio as well to make the UIs consistent, but it would be great if we could import it directly from WordPress components. Thanks! |
|
@ivan-ottinger There's an internal tracking issue at ARC-692. We don't have immediate plans but it will eventually land in the new |
Thanks, @mirka. That's helpful. |

Part of DOTCOM-13192
Proposed Changes
Noticecomponent for use on the Transfer site.Variant
Density
Others
Why are these changes being made?
yarn run storybook:startTesting Instructions
Pre-merge Checklist