-
Notifications
You must be signed in to change notification settings - Fork 4.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
Pages data view: Update quick-actions #59551
Conversation
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -4 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
Hmm, not sure about this one, actually. What this does is remove the quick-hover shortcut for trashing in favor of the edit button. But in the process, move to trash becomes the primary action in the ellipsis view, and the "Edit" action is already available when you just click the title of a post. |
Do you think this is clear enough? If a user were to assume that the designated Actions are the only ones available, it might seem strange that Edit isn't included there, and that trashing is given such prominence. On the latter point, trashing is not a super-common task for pages, so the ellipsis menu seems reasonable – like in Patterns.
Good point, I'll flip trashing and viewing revisions. cc @pablohoneyhoney since this change is based on some of your feedback. |
That would help. I do personally like the ability to quick trash, but I also suspect this is something we can finetune. |
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.
Code wise this looks good and I left a really small comment. So it's just the design decision to be made 😄 Thanks!
@@ -27,7 +27,7 @@ const { useHistory } = unlock( routerPrivateApis ); | |||
export const trashPostAction = { | |||
id: 'move-to-trash', | |||
label: __( 'Move to Trash' ), | |||
isPrimary: true, | |||
isPrimary: false, |
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 handled by default when not true
, so we can remove this line completely. Additionally we can remove the icon
too, as it's used only for primary actions.
Given that RC1 is today, I'm removing this from 6.5 as non essential. |
8feae84
to
e79172e
Compare
Rebased and updated the OP to include before/after screenshots. |
I like the edit as an explicit action and I wouldn't mind trash being a secondary one. Two thoughts:
If edit becomes primary for Pages, I'd expect to be so in all other pages as well (Templates, Parts, etc.). Essentially, for any page that uses the The number of actions that are primary over the total seems too much. For example, 3 out of 4 actions are primary for posts that are not trashed, so it's easy to run into this: All actions are primary for posts that are trashed: |
Personally I agree that Trashing doesn't warrant being primary, for the reason you mention and simply because trashing is relatively uncommon compared with other actions.
Doesn't the explicit 'Edit' action help remedy that?
I agree, and that's a detail to follow-up on if we want to merge this PR. Should that be something we add to the API? An
I think we can massage things a bit in both cases. We already spoke about 'Move to Trash' potentially not being a quick-action, and it's worth noting there will likely be other actions in the future e.g. 'Rename' and 'Duplicate'. Similarly in the Trash view 'Permanently delete' can be secondary as it's something more likely to be done in bulk. I'll push some adjustments. |
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 seems like the right path forward, and it unlocks some followups including moving the destructive "revert revision" button into the ellipsis menu, as well as sorting similarly for other types like André suggests.
Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: oandregal <oandregal@git.wordpress.org>
What?
Testing Instructions
Before
After