-
Notifications
You must be signed in to change notification settings - Fork 72
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
Improves the DataTable RowStatus [FC-0036] #2838
Improves the DataTable RowStatus [FC-0036] #2838
Conversation
to "Showing 1 - N of M" instead of just "Showing N of M"
Thanks for the pull request, @pomegranited! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
✅ Deploy Preview for paragon-openedx ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2838 +/- ##
=======================================
Coverage 92.83% 92.83%
=======================================
Files 235 235
Lines 4240 4244 +4
Branches 1029 1031 +2
=======================================
+ Hits 3936 3940 +4
Misses 300 300
Partials 4 4 ☔ View full report in Codecov by Sentry. |
@pomegranited Everything seems to be working perfectly for me. Thanks! |
@pomegranited The indexes have strange changes in the "Backend filtering and sorting" table. (watch the video). It seems to update early and the second update looks strange https://www.loom.com/share/72a23575fd264bb48de59ec2838a0a33?sid=c4d7258b-6c8c-4601-acc4-8b65de020fff |
Thanks for noticing this.. but I'm not sure what to do about it. I think the progressive updates are because of the async backend queries, but since they eventually resolve to being the right numbers, that might be enough? I'm happy to ask upstream about how we can handle this better. |
@pomegranited I understand, I think it is a good idea to ask upstream, also so that they have this behavior registered |
|
The problem is this line: paragon/src/DataTable/RowStatus.jsx Line 10 in 67488a6
What I think is happening: While the requested page is loading, the table still holds the previous value of This is a symptom of a bigger problem: while the next/previous page is loading, the table doesn't display any indicator that it's loading, and still uses values from whatever page was previously displayed. IMHO the best fix is that as soon as the user clicks onto another page, the variable that holds the data ( And (importantly) that placeholder data should have the correct numbers of rows. If there are 7 items total and you're on the third page with a page size of three, the placeholder should only have 1 row, not 3. Then (with no changes to any of your code), the page counts will be accurate the whole time. Plus the user will get important visual feedback when the table is valid (loaded) or not. So my suggestion would be to merge this code as is, since it doesn't make anything worse, and discuss with the paragon maintainers then open a ticket to add a proper loading state to the DataTable component. Here is a screenshot showing the bug in the current master version of paragon - the pagination says this is page 3, but the data is from page 2 while page 3 loads. And the number on the left is wrong. |
Thanks for your assessment @bradenmacdonald . I had a quick play to see if I could handle data loading better here, but since the bulk of the functionality is in react-table, I'm not seeing clearly what needs to be changed. Will see what upstream has to say.. |
@bradenmacdonald Who should I ping for upstream review here? |
@arbrandes We've made this improvement to Paragon as part of the Tagging/Taxonomy Axim funded contribution project, but I'm not sure how to get it reviewed. Would you mind giving us a nudge in the right direction? |
For this one I'll defer to @brian-smith-tcril. |
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.
This looks great! I'll bring it up in the working group meeting tomorrow morning to make sure everyone is happy with the changes.
@bradenmacdonald I will also bring up adding a loading indicator as you mentioned here in the WG meeting tomorrow. |
Awesome, thanks @brian-smith-tcril ! |
@brian-smith-tcril Would you mind merging this for us, if it's good to go? I don't think we have permission. |
@pomegranited 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
🎉 This PR is included in version 21.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thank you for merging this change @brian-smith-tcril ! CC @arbrandes |
🎉 This PR is included in version 22.0.0-alpha.19 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@pomegranited, while Renovate will issue upgrade PRs for packages in the |
Description
Modifies the DataTable RowStatus to read, e.g. "Showing 1 - 10 of 500" instead of just "Showing 10 of 500".
Closes openedx/modular-learning#111
Private-ref: FAL-3534
Deploy Preview
https://deploy-preview-2838--paragon-openedx.netlify.app/components/datatable/#frontend-filtering-and-sorting
Testing instructions
Merge Checklist
example
app?wittjeff
andadamstankiewicz
as reviewers on this PR.Post-merge Checklist