-
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
Split the dataviews primary and non primary actions for display purposes #68965
base: trunk
Are you sure you want to change the base?
Conversation
I'm a bit concerned about removing primary actions from the actions menu. The intended UX pattern is that the menu consistently includes all available actions, while consumers of the Dataviews component can highlight specific actions they believe users will need more frequently in layouts like Table and List. If we change this behavior, we'll introduce inconsistencies where the menu’s contents vary depending on the selected layout. For example, on the Templates page, the Table layout actions menu would only include ‘Rename,’ whereas in Grid layout, it would contain ‘Edit,’ ‘Rename,’ and ‘Delete.’ This inconsistency could be frustrating for users who habitually access actions via the menu regardless of layout. Additionally, visually inconsistencies would exist within the same page. In Grid layout on the Templates page, theme-supplied templates would have an 'Edit' icon button, while custom user-generated templates would display an ellipsis icon button. Furthermore, once a theme-supplied template is edited, the 'Edit' button would disappear, replaced by an ellipsis icon button that surfaces a menu including 'Edit' and 'Reset.' I don't know that this behvaior is helpful. Finally, another reason to keep all actions in the menu is so that it can function as a context menu when users right-click a record, ensuring a consistent and predictable experience. |
I understand the concerns but, to me, an ellipsis menu is a 'More' menu and should only show the actions that aren't shown in first function. |
P.S. when possible, please let's all try to keep the general discussion on the associated issue so that it's all in one place and not scattered around issues and PRs. Ideally, PRs should only serve to discuss the coding part. |
Quoting from the issue: I think using const _nonPrimaryActions = _eligibleActions.filter(
( action ) =>
!_primaryActions.some(
( primaryAction ) => primaryAction.id === action.id
)
); @Rishit30G Sure totally in favor of improvements. Could you please add more context on why it would be more robust in your view? |
Sure @afercia, For the given scenario, the code snippet with But let's say in-future, these two situations arise:
In these two cases |
Note: a few tests are failing so far. Those should be adjusted, and likely complemented with new tests, depending on the decision about how primary and non-primary actions should be displayed. |
See #68789
This is a demo PR so far, to illustrate what I would like to propose for #68789
The second point implies that all actions should now have an icon. That's because any action may now be displayed as a single button if it's the only action available. So far, I've added a few icons for some actions but not for all of them yet.
This is a demo, I would greatly appreciate that someone else more familiar then me with dataviews could have a look at it as there's likely many things I'm missing.
What?
Closes
Why?
How?
Testing Instructions
Go to Pages and observe the 'Edit' action is not duplicate in the menu any longer:
Go to Templates and observe the only available action (Edit) is now displayed with a single icon button a no longer with an ellipsis dropdown menu that contains only one action:
Go to All Patterns and observe the only available action (Duplicate) is now displayed with a single icon button a no longer with an ellipsis dropdown menu that contains only one action:
Make sure you have at least one custom pattern (Duplicate one of the 'All patterns)'. Go to My patterns and observe all actions are inside the dropdown menu. This is unchanged from trunk and respects the
isCompact
prop.Testing Instructions for Keyboard
Screenshots or screencast