-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
[data-grid] Terminology for various row listings #4151
Comments
@mui/x if you have a moment to read and propose changes. For #3882, I need the terminology of "Rows after the sorting and filtering + without the collapsed children", which is for me the biggest terminology pain right now. |
Its name could be the inverse of mui-x/packages/grid/x-data-grid/src/hooks/features/keyboard/useGridKeyboardNavigation.ts Line 68 in 9e2c4b4
Possible confusion with the detail panel? I also used "expanded". Although, all selectors have the feature name as prefix, e.g.
|
We could indeed replace the current method with one that uses the "visible rows" (v6 terminology).
Do we consider the detail panel as a row ? If not I guess the confusion should not be problematic. Which terminology would you use for this row listing. |
I understand that it could be confusing, but the presence of "Rows" in the selector name should be enough to remove the confusion About the section "Rows that can be reached by scrolling" there is a missing edge case about tree data + pagination
Visible in its definition of "in Page" + "pass Filtered" + "expended row" should be equivalent to "Rows of the current page + without the collapsed children" Do we have use cases where it would be nice to have a selector for rows that are on the page but not expanded? If yes, we could introduce
|
Could you elaborate ?
For me it is exactly the case
The selector do not exist right now and I never heard of a use case. |
What I called the "missing edge case about tree data + pagination" is the selector to get page rows, including collapsed ones. I was checking that all the meaning full combinations are in the list to be sure the naming convention will allow to add them later if needed About If we assume selectors are only to get information about the interface state we could remove mentions of |
OK so if it is for all pages, we have
You could also have a listing of the unsorted and/or unfiltered top level rows. |
The detail panel is not a row, but the row from the detail panel also has the ability to expand. In this context, someone may see a selector named with "expanded" and think it works with the detail panel but it doesn't.
I would include in the name the origin of the information. Take as example |
Not just tree data, also row grouping If we take |
Where it uses
|
The current
The current The relation with
And from what I understand of your logic, it should have |
So anything using
|
I feel like only renaming |
I don't understand your point here. We can add a method if it's easier for users, which would probably be a method on |
Yeah, but for developers, I think the best way is to expose a method to get the rows and to have a param specifying if the collapsed rows should be fetched or not. In the past, it was a mess to get the currently visible rows then For selectors, I tried to come up with the following terminology, but for it to work we also need to update the state.
I avoided the "visible" term because it works for methods but not for selectors. One resulting selector could be When combining prefixes, the first value used goes to the end of the selector name. |
We'll see what method(s) would be the most useful. If a use-case is very common and a method makes it simpler, then of course I am in favor of a method (like the The nomenclature is your are describing looks good to me. |
Related to #3717
The grid contains more than half a dozen row listings depending on what the user (or our team) is trying to achieve.
In v5, some of those listings were not consistently named, one of the goal of v6 is to clarify as much as possible that part.
Proposals
Decide one terminology for each listing above and use this terminology in the name of every selector / api method / params property that uses this listing
Remove
apiRef.current.getRowIndex
, keepapiRef.current.getRowIndexRelativeToVisibleRows
and maybe create aapiRef.current.getRowIndexRelativeToExpandedRows
(see below to discuss the naming of the "expanded" row listing)Remove all the api methods that are just calling a selector (
apiRef.current.getAllRowIds
for instance)Existing listings
Rows in the order given by the user
Terminology in v5:
rows
Terminology in v6:
rows
Usages
gridRowIdsSelector
apiRef.current.getRowsCount
apiRef.current.getAllRowIds
(delete in v6, can usegridRowIdsSelector
)Rows after the sorting
Terminology in v5:
sorted rows
Terminology in v6:
sorted rows
Usages
gridSortedRowIdsSelector
gridSortedRowEntriesSelector
apiRef.current.getSortedRows
(delete in v6, can usegridSortedRowEntriesSelector
)apiRef.current.getSortedRowIds
(delete in v6, can usegridSortedRowIdsSelector
)apiRef.current.getRowIdFromRowIndex
(very unclear, delete in v6, can any row id selector to get the index from the wanted row listing)Rows after the sorting and filtering
Terminology in v5:
filtered sorted rows
Terminology in v6:
filtered sorted rows
(I keep thesorted
because we could have a filtered non-sorted row listing)gridFilteredSortedRowIdsSelector
gridFilteredSortedRowEntriesSelector
Rows after the sorting and filtering + without the collapsed children
Terminology in v5:
visible rows
Terminology in v6:
expanded rows
?sorted expanded rows
?non collapsed rows
?all page rows
?If the tree is flat, this listing is equal to "Rows after the sorting and filtering".
But they must be clearly distinguished because when we have row children, depending on the use case we must use one or another.
For instance the keyboard navigation uses this listing whereas some exports use the filtered rows to include the collapsed children.
Usages
gridVisibleSortedRowIdsSelector
(to rename)gridVisibleSortedRowEntriesSelector
(to rename)gridVisibleRowCountSelector
(to rename)apiRef.current.getVisibleRowModels
(delete in v6, can usegridVisibleSortedRowEntriesSelector
, theMap
return format is to specific for a dedicated methid)Top level rows after the sorting and tiltering
If the tree is flat, this listing is equal to "Rows after the sorting and filtering".
Terminology in v5:
visible sorted top level rows
Terminology in v6:
filtered sorted top level rows
?gridVisibleSortedTopLevelRowEntriesSelector
(renamegridFilteredSortedTopLevelRowEntriesSelector
)gridVisibleTopLevelRowCountSelector
(renamegridFilteredTopLevelRowCountSelector
)Rows that can be reaching by scrolling
If pagination is enabled, this is equivalent to the "Rows of the current page"
If pagination is disabled, this is equivalent to the "Rows after the sorting and filtering + without the collapsed children"
Terminology in v5:
current page
/visible rows
Terminology in v6:
visible rows
Usages
apiRef.current.getRowIndexRelativeToVisibleRows
GridRowScrollEndParas["virtualRowsCount"]
(renamevisibleRowsCount
in v6)Rows of the current page
Should never be used when we don't know if pagination is enabled because otherwise it uses the default page / page size in state
Usages
gridPaginatedVisibleSortedGridRowEntriesSelector
gridPaginatedVisibleSortedGridRowIdsSelector
gridPaginationRowRangeSelector
The text was updated successfully, but these errors were encountered: