-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
DataViews edit page and template: remove multiple edit actions #68789
Comments
Thanks for sharing the issue, I was able to achieve the first option suggested: Remove the pencil icon and only have edit in the menu This was a simple fix, however even I feel that option two is much more viable However for now, below screencast shares the draft PR ( #68797 ) changes to achieve Option 1: Screen.Recording.2025-01-21.at.11.15.50.AM.mov |
Thank you @Rishit30G for this. I do wonder if we can do something though about keeping the icon. Seeing this makes me really miss it. It also doesn't resolve the menus with just that item in it. |
Noted @karmatosed, as mentioned above I will investigate it and see how we can achieve that 👍🏻 |
Please let me know if this looks good @karmatosed ? 🙇🏻 |
On investigating a little bit I could find that when we are on the Screen.Recording.2025-01-22.at.1.58.58.PM.mov |
In the template grid view, do we really want a new icon option for edit, and then another button with three dots beside it, that opens a menu that contain a single option? Theme templates that have been edited by the user can be reset, and if edit is moved, that will be the only option in the menu. User created templates have rename and delete, so the three dot menu will always have at least two options. |
Focusing only on this point, I think dropdown menus with only one item are a broader issue across the editor, not limited to Dataviews. It's been discussed previously and I'm still not sure what the benefit of having a dropdown menu that only contains one item is. To me, it's clearly an usability issue and it forces users to a double click to 1) discover 2) take the action. Most of these menus with only one item use an ellipsis icon, which already has inherent accessibility issues. Also, conceptually, the ellipsis icon is a 'More' menu, which implies there should be other controls before it. However, the ellipsis icon button is often used 'in isolation' and named inconsistently: Actions, Options, etc. A couple previous related discussions: #42555 and #42505. Quoting:
A few usage examples outside of the Dataviews can be seen at:
Screenshots: Overall, I'd think the 'menu with only one item' pattern should be considered holistically and likely have a separated issue for discussion. Note: The background setting 'Reset all' sounds a little off as there's only one thing to reset. |
Thanks for sharing your views and thoughts @carolinan and @afercia! 🙇🏻 |
I'd think this specific part of the issue should be extended to all cases where a menu contains only one menu item. It's not just about the 'edit' action. There are other cases where the ellipsis menu contains only one item e.g. in Patterns > All patterns, it only contains 'Duplicate': As an user, I don't want to have to open a menu to find only one action that doesn't need a 'More" menu. |
I would be introducing a new filter function, to separate out the Primary Actions from the dropdown and make them visible as icons only Screen.Recording.2025-01-30.at.4.23.43.PM.movFeedback from Mamaduka: #68797 (comment)
|
Duplicate is only the single item for theme patterns. |
To my understanding, these menus handle the so called 'eligible actions'. An action may be 'primary' and there's some logic to determine whether the primary actions should be displayed as single icon buttons or within the dropdown menu. This also depends on the However, when a Primary action is rendered as single button, it is not filtered out from the other 'eligible actions' used for the dropdown menu. This seems to me the first thing to look into and it's responsible for the duplication. One more thing I would like to address is that when there is only one action, it should not use the dropdown menu and instead be displayed as a single button. I will try a demo PR to better illustrate. |
I submitted #68965 as a demo to illustrate the above. Would appreciate if someone more familiar than me with dataviews could have a look at it 🙏🏻 @WordPress/gutenberg-core |
This PR looks good to me on testing @afercia, it's solves the issue and handles the edge cases as well 🙇🏻 Even I had the same code approach when I discussed about introducing a new function 😄
A small concern I had with this code snippet: const _nonPrimaryActions = _eligibleActions.filter(
( action ) => ! _primaryActions.includes( action )
); I think using const _nonPrimaryActions = _eligibleActions.filter(
( action ) =>
!_primaryActions.some(
( primaryAction ) => primaryAction.id === action.id
)
); Just a suggestion, please feel free to share your thoughts and as mentioned someone more familiar with dataviews can review the PR better! 👍🏻 |
@Rishit30G Yes I read your comment right after I submitted the draft PR at #68965 😄 Looks like we were thinking the same thing. |
Some design feedback has been posted by @jameskoster on the draft PR that tries to split the actions. Quoting it here to keep the genereal discussion in one place:
|
Sharing some visual evidences, to add to the points shared in the above conversation:
This occurs when there it is a user created template
I agree, it’s quite tricky. Another dilemma is that the same issue can arise when dealing with user-created templates in Grid View. Currently, the dropdown contains three options: Edit, Rename, and Delete. If we move two primary actions (Edit and Delete) out of the dropdown, it would leave only one option (Rename) in the menu. |
What problem does this address?
In DataViews there are two issues.
What is your proposed solution?
Overall, I would suggest not using hidden option menus. However, that patterns iteration is a longer discussion. I would like to focus on a fix that can clean up this situation. Then looking at ways to expose as much as possible on interaction over use any hidden menus would be the way forward.
Option one: Remove the pencil icon and only have edit in the menu.
This is less than ideal as the primary action is probably 'edit,' which is why it was exposed in the first place.
The reason to do this might be that the pencil icon is less accessible, but I would love feedback on this. Having hidden features might be less desirable in an options menu.
Evidence to maybe do this is that the Post screen hasn't got an exposed primary action:
Option two: Remove edit from the menu
As it is exposed as a primary feature anyway, this means that this interaction would be true:
This could also apply to other cases. In the case of the Post screen, this could even make rename work by clicking inside the field later. That feels outside the scope of this ticket but is a natural behaviour expected by fields. I think 'view' is the primary. This is one of the issues with these hidden menus and only exposing the primary.
The text was updated successfully, but these errors were encountered: