-
Notifications
You must be signed in to change notification settings - Fork 2k
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
A4A Referrals: convert the actions field into proper actions #94250
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~12 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
client/a8c-for-agencies/sections/referrals/referrals-list/index.tsx
Outdated
Show resolved
Hide resolved
Thanks for taking a look! Yes, that's a known issue I mentioned in the PR description (TODO). Didn't get to work on this PR today but I will next week. |
@@ -49,10 +49,6 @@ | |||
padding: 0; | |||
} | |||
} | |||
th[data-field-id="actions"] { |
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.
DataViews no longer includes data-field-id
since 4.0.0 (see)
const [ dataViewsState, setDataViewsState ] = useState< DataViewsState >( { | ||
...initialDataViewsState, | ||
layout: { | ||
primaryField: 'client', |
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 provides some styles (bolder, etc.), renders the field in a special place for list layout (comparing before/after, the field is rendered vertical aligned while before it was ). It also makes it not hidable in list layout and soon in table as well (see).
> | ||
{ item.client.email } | ||
</Button> | ||
<span className="a4a-referrals-client">{ item.client.email }</span> |
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 wanted to make it look the same as before, so added this class to target it. Is this the proper naming structure?
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 |
@@ -21,10 +21,6 @@ | |||
color: var(--color-jetpack-50); | |||
} | |||
|
|||
.dataviews-view-table__actions-column { |
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 wonder if this style (and the other two in a8c-for-agencies & components/dataviews) is affecting any other screen.
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.
Not as far as I've reviewed: A4A Sites, A4A Sites Import Modal, A4A Referrals Details, A4A Team, Dotcom Sites.
Also, DataViews doesn't render the actions column if no actions are declared. Not sure why this rule was necessary.
} | ||
|
||
.dataviews-view-list li { | ||
cursor: pointer; |
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 already taken care of in dataviews.
cursor: pointer; | ||
} | ||
|
||
.dataviews-view-list li .components-h-stack { |
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.
Not sure what this was for, but it was creating some issues with vertical alignment and spacing in the list view when actions were visible.
@Automattic/a4a-genesis This is now ready in terms of behavior/styling. I need to review that there are not side-effects to other screens (Actions column is not unintentionally shown in other screens that are not ready for it, for example). |
In my testing, the main behavior change I see is the fact that clicking the row (outside of the chevron) navigates to details in trunk but not in this branch. Also in both this branch and trunk, when hovering a row (but not an action), there's an inconsistency between desktop and mobile: on mobile the cursor is a pointer but not in desktop. |
I like the code cleanup a lot :) |
👍
In production, I see the pointer both is desktop & mobile, but only when you hover over the client field, which was a button. In this branch, I don't see it in any breakpoint. |
One thing I've noticed is that the actions column is sticky but its background is transparent, hence the action buttons overlaps other columns when manually reducing the viewport. This also happens in |
I've prepared a fix for this at #94323 |
@oandregal Can we hide the dropdown, if we only have primary actions? |
No, that's how DataViews actions work. Note that displaying only the primary actions if there are no secondary ones comes with some details to figure out: for example, only the dropdown is visible until an item is hovered to avoid visual weight. If we wanted to investigate this, it should be an upstream (core dataviews) follow-up PR.
This is intentional. The "click row" behavior should not be overriden (it's used for item selection with "bulk actions") and we should prefer primary actions for the "overview-to-details" interaction. See design feedback at pfYzsZ-g9-p2 |
Yes, that was actually my suggestion (upstream PR), maybe only when there's a single primary action and make it visible. |
I don't think I can get to this this week, but created an issue in case anyone wants to tackle it (and also to gather design feedback): WordPress/gutenberg#65165 |
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.
Thanks for working on this!
I don't have any more feedback apart from the one I have mentioned already.
So, I'm approving the PR.
CC: @madebynoam @jeffgolenski FYI 🙂
I'd like to wait until tomorrow to merge this PR, in case there's some late design feedback at pfYzsZ-g9-p2. |
I saw this issue: In theory, it will be fixed by this PR: #94323 |
That also happens in trunk:
I can confirm it does. I've cherry-picked that branch into this one for local testing and this is the result: |
Follow-up to #93503
Related to #94198
Proposed Changes
This PR converts the existing
actions
field into proper DataViews actions.Why are these changes being made?
Part of clean-up of DataViews in A4A to use core-first APIs.
Testing Instructions
yarn && yarn start-a8c-for-agencies
Visit
agencies.localhost:3000
and navigate to the "Referrals" section.Pre-merge Checklist