-
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
Rename view.sort.field
to view.sort.orderby
#55205
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'm not opinionated about the new name (
orderby
or any alternative), but I think it's best to avoidfield
for clarity.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.
Why is field unclear for you?
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.
It suggests the table is sorted by a field (fields API), but it is sorted by the dataset instead.
For example, let's say there was a field called
date
in addition to thedate
property of the dataset. Let's say we haveview.sort.field: date
set. Wouldn't it be confusing, given the view is actually sorted by the datasetdate
and not by the fielddate
?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.
More context about accessing the dataset (underlying raw data) vs accessing the fields (cell value) at #55196 (comment).
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'm not entirely sure what you mean by "dataset". For me it's actually the field. If a dev defines a field that is "full name" that is a computed field from say two properties on the object (first and last name), the sort is the "name" of the field, aka "full name" regardless of how it's really applied under the hood (using two columns to sort for instance)
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.
"columns" is specific to table views, and with the same config we want to be able different kind of views starting with table but also rendering things like "grids", "kanban"... So columns doesn't make sense cross "layout". We're basically just defining the "fields" of our data.
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 agree with @youknowriad here. For us this is a field and is using the
data
internally temporarily.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.
Yeah, I agree
column(s)
is inherently restrictive to a certain view type, but in my opinionfields(s)
comes with its own connotations, especially in the context of WordPress.I personally associate it with a single piece of data vs. what has been described as a possible need in the future of combining pieces of data.
(emphasis mine) I think this also applies to
fields
(plural) as the higher level.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 have no other suggestion/aternative, so please don't let this hold progress, but something about
field(s)
seems as restrictive acolumn(s)
to me 🤷🏻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.
ok, I see where you are coming from. Let's wrap up this conversation and iterate towards that vision.