-
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
Add: Reorder control at the field level on the new view config UI. #64381
Add: Reorder control at the field level on the new view config UI. #64381
Conversation
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. |
Wouldn't these arrows make more sense sorting the order that the fields display (left to right in the table view, for example)? Seems a bit confusing that instead they seem to be duplicating the same functionality as the 'Sort by' and 'Order' fields above. |
Good point @paulwilde, I interpreted the arrows as sorting but maybe the plan was for reordering. @jameskoster could you clarify if the goal of the arrows was to sort or to reorder? |
@jorgefilipecosta yes these buttons are for re-ordering the display of fields as @paulwilde suggests. Sorry for the confusion! Perhaps we should try using |
13c8ec3
to
b958fdc
Compare
Hi @jameskoster, I updated this PR to make the buttons be reorder instead of sort (only available on table layout). And I also updated the icons. |
Thanks for the update, we're getting close :)
|
b958fdc
to
1a1152f
Compare
Hi @jameskoster the following items were addressed:
This issue was left out: However, only having the actions visible on hover minimizes the issue. It is not possible right now to allow setting the order of all fields regardless of visibility because the data structure that stores the field order is also the data structure that says if a field is visible, if a field is there it is visible and appears in that position. |
Size Change: +775 B (+0.04%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
I pushed a small update to the tooltips.
That sounds good, and fine to handle separately. In the mean time, instead of disabling the re-ordering buttons when a field is hidden, how about visually hiding them? |
disabled={ | ||
! isVisible || index < 1 | ||
} | ||
accessibleWhenDisabled={ 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.
Is there any reason not to use accessibleWhenDisabled={ true }
here? Ideally the buttons are still accessible even when disabled.
6471713
to
fb30ef8
Compare
@jorgefilipecosta coming back to this point:
Would it be possible to have separate groups for hidden / visible fields? A quick mockup: Then we can hide the up/down buttons on the hidden fields. I think that would simplify the UX quite a bit, and hopefully negate the need to modify the data structure. What do you think? |
acc8111
to
f426514
Compare
Flaky tests detected in f426514. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10612850541
|
Hi @jameskoster your feedback was applied and I separated the visible and hidden fields into two groups. |
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 Jorge. I pushed a small spacing tweak; this now looks good to go in terms of design.
…ordPress#64381) Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: paulwilde <paulwilde@git.wordpress.org>
@jameskoster @jorgefilipecosta what are your thoughts on fields that are no visible and "not hidable" [1]? They will never be displayed in the layout, so, as a DataViews' consumer, I wouldn't want them to be listed in the properties panel. They are still useful for providing a filter, for example. You can see this at work in the default story for dataviews (see [1] A better naming would be: its visible/hide status cannot be changed by the user |
I agree, if users cannot toggle visibility then there's no point showing the field in the view options at this stage. |
Prepared #64999 that fixes this and a few other things. |
This PR adds buttons to sort directly at the field level on the new config UI.
Screenshot
cc: @WordPress/gutenberg-design
Testing Instructions
I verified the new sort buttons at the field level work as expected.