-
Notifications
You must be signed in to change notification settings - Fork 2k
Dashboard V2: Introduce ActionList and ActionItem components #103371
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
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Hi there 👋 Could you explain a bit more about the need for this component? Has it been already reviewed and approved by designers to belong in the Design System? |
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this components for Site Settings, Domain Settings like the SummaryButton. I was asked whether it makes sense to extend the Summary button but it would be better to have ActionItem to be more specific about action intent. See QOBjujZah0UlGDDdLKZhzi-fi-74_35008#1246206155
Makes sense, looks like a useful component.
Still, I'd echo what @ciampo suggested above - I see in the FIgma file that the component is marked as "WIP". Ideally, we'd have design approved first, and then potentially the component can be built outside of @automattic/components
before promoting it to be formally part of the design system.
Talking about design, what's the state of the design review here?
Ok, sounds good to me! I'll move the component to dashboard v2 first if it's still not ready 🙂
@matt-west @jasmussen I noticed the |
@jameskoster any thoughts? My understanding is that it's ready for implementation. |
I think the design is ready. We use the 'WIP:' prefix in Figma to indicate the component isn't implemented yet. We should probably revise this so we have more granular status indicators. |
I guess the broader question to ask here is: is every new component DS-worthy? I believe we can't just put every component in the DS. What's the criteria we've used to assess whether a component should be part of the DS or not? |
I'm happy to go with either adding the component to Dashboard V2 or DS. I’m also wondering if there are specific criteria we follow when deciding where a component belongs. From my perspective, the |
Exactly - we don't know what the criteria are. How Definitely don't consider this a blocker. Feel free to put the component inline in the dashboard directory for now if you want to move it forward. We have a DS call on Thursday, and we're planning to discuss this problem more broadly and agree on acceptance criteria for components in DS. |
Ok! I'll go ahead and place the component inline in the dashboard for now. Thanks for catching this! 🙂 |
The |
In terms of adding this to the Design System, I'm not sure whether we need to expose The relationship is a bit similar to What do y'all think? |
expect( screen.getByText( 'Action item title 1' ) ).toBeVisible(); | ||
expect( screen.getByText( 'Action item title 2' ) ).toBeVisible(); | ||
} ); | ||
} ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just my opinion, I know it's not shared by everyone, but I'm going to share it anyway :)
Testing our code is very important but there are good and bad tests and I prefer no tests over bad tests. For me these tests are useless, they test the output without any behavior testing. So these tests will never break or only break when we actually need to change them, so they won't catch any regressions, so I don't really think they are good tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Removed these tests 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments about what I would have done differently (or tried) but overall looks to me.
I agree. I haven't seen a need for using ActionItem outside of an ActionList. |
) { | ||
return ( | ||
<Card className="action-list" ref={ ref }> | ||
{ ( title || description ) && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we render <CardBody />
to surround the content?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked the storybook. Looks good to me, thanks for working on this!
9509283
to
c4c8e9d
Compare
Unless designs that I've missed call for it I think it would be simpler to start with a single action for now. The action should always be a
We can be stricter with this description:
|
Yes, that's my first proposal. But we're favor composition and we might want multiple actions in the future, so the current way provides more flexibility. We'll still use the single action and compact sized button on hosting dashboard v2.
👍 |
c4c8e9d
to
c9dc67f
Compare
ref: React.ForwardedRef< HTMLAnchorElement | HTMLButtonElement > | ||
) { | ||
return ( | ||
<Card className="action-list" ref={ ref }> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't taken a deep look at the code, but one thing that we should consider (even while this component is still implemented locally) is to introduce list semantics — ie. action list could render a title + ul
element (the ul
should be the .action-list__actions
) and action item could render a li
element
Additionally, the ul
should be aria-labelledby
the title (and optionally, the description)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also that classname is way too generic and doesn't follow the guidelines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. We should try to scope our class names better (ie. a8c-dashboard-action-list
or something similar)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
per our guidelines, this one would be dashboard-action-list
Part of DOTCOM-13098
Proposed Changes
ActionList
andActionItem
componentWhy are these changes being made?
ActionList
andActionItem
components on Site Settings pageTesting Instructions
yarn run storybook:start
ActionItem
componentPre-merge Checklist