-
Notifications
You must be signed in to change notification settings - Fork 8.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
[Discover] Allow to select/deselect all rows in the grid at once #184241
Conversation
/ci |
Hi @andreadelrio, What UX would you suggest here: select all loaded rows or only rows on the current page? If it's the second, how would we allow selecting rows on other pages? (low prio) |
adding also @MichaelMarcialis to the loop, currently working on data table stuff |
Thanks for the ping. This addition generally makes sense, though I did have a few questions:
I would suggest that it should select all rows on the current page, not only the loaded rows (as that would likely confuse users). As for existing patterns for selecting items on other pages, I would suggest revealing a conditional action adjacent to the current selection options that allows users to select everything on all pages, similar to how our table UX patterns suggest. |
I've tested it here, and on my M1 MacBook Pro, 2021, comparing 500 docs is not a big problem https://kertal-pr-184241-175943-select-all-rows.kbndev.co/app/discover However it doesn't make much sense, and if we want to be safe on performance side, we could e.g. disable comparing after selecting X documents, FYI @davismcphee
I think it started as a part of the "Selected" menu, but was moved to a separate button during the review of #166577 |
I agree it doesn't make sense to compare 500 docs at once. We could disable comparing entirely when selecting a lot of docs as you mentioned, although currently we already limit the number of comparison fields to 100 and display a banner, so maybe we could take a similar approach here with something like 20-30 docs?
We originally had it that way, but as @kertal mentioned it was suggested to move it to a dedicated button during the PR review, mainly for feature visibility. Also ++ to selecting the entire page and offering a secondary option to select all loaded docs. |
# Conflicts: # packages/kbn-unified-data-table/src/components/data_table.tsx
@MichaelMarcialis @davismcphee @kertal Thanks for your suggestions! Regarding an option to select all others, should we try to fit it in the grid toolbar? Can we add this action to the "Selected" menu instead? |
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.
Code changes look good and it works great! Much nicer for selecting lots of docs, LGTM 👍
packages/kbn-unified-data-table/src/components/data_table_document_selection.tsx
Outdated
Show resolved
Hide resolved
…ment_selection.tsx Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
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 for putting this together, @jughosta. It looks great!
The only thing that stood out to me in my testing was that the "Select all X" button shows even if only a single document is selected on the current page. Would it be possible to change this behavior so that the "Select all X" button only appears when all documents on the current page have been selected? Doing so would more closely follow the table bulk selection patterns we try to follow.
Otherwise, everything else looks good from my perspective. Assuming you're able to address my comment above, I'll approve now so I don't hold you up further. Thanks again!
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.
LGTM, cr only.
@MichaelMarcialis Thanks for the review! Updated. QQ: If user selects all rows on the current page, then we show "Select all X" button. Should we hide it when user navigates to another page? |
Good question. I'm inclined to say no, we should continue to show the "Select all X" button in that case. Amending my previous rule condition, we should only show the "Select all X" button if the user has selected all rows on one or more pages (even if that selection is not the currently viewed page). |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: cc @jughosta |
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.
🎉 Looks good!
select all
documents #175943Summary
This PR adds a checkbox which allows now to select all rows at once (or deselect all) on the current page.
Checklist