-
Notifications
You must be signed in to change notification settings - Fork 747
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 loader to YourClasses component #11061
Add loader to YourClasses component #11061
Conversation
Build Artifacts
|
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.
Thank you @LianaHarris360, this is a step in a good direction. Setting a fixed timeout in the component will indeed help in some cases, but we can't rely on that in all situations as we don't know how long the loading takes.
For example, see the following recording (please be patient with it, all steps take a while), where I reloaded the Classes page. At first, you will see the circular loader, and after the timeout "You are not enrolled in any classes" gets displayed. However, that's really not the case, because I'm enrolled in classes that are still being fetched so after another while you will see "You are not enrolled in any classes" replaced by class cards.
I'd suggest examining the code which loads the classes for this page (https://github.com/learningequality/kolibri/blob/release-v0.16.x/kolibri/plugins/learn/assets/src/modules/classes/handlers.js#L6) where you can see it sets the global loading
state. I think you could use it. Please don't inject it directly to YourClasses
component though as we're trying to avoid dependencies to Vuex in smaller components for a number of reasons. You could add loading
prop to YourClasses
and send this information down from its parent component, AllClassesPage
where it's okay to map Vuex state as it's a root business component which already has some Vuex injected.
Thank you for the suggestion, it was very informative @MisRob I've updated the pr and used the global loading state 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.
Thanks @LianaHarris360, code changes are looking good to me.
@pcenov @radinamatic Just a note that during QA, you won't see the circular loader like in the original PR recording since when loading the whole page, we currently still follow the pattern to show the linear loader under the top bar.
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 confirm that this is implemented exactly as specified above and the unnecessary text is no longer being displayed while the page is loading.
Noting though that I am not able to open any of the assigned resources in the lesson, and there is a TypeError: Cannot read properties of undefined (reading 'catch')
error in the console. If this is not caused by any of the changes in this PR, then it's good to go.
2023-08-09_14-44-40.mp4
Thank you @pcenov. From the code, I feel confident that this PR shouldn't be causing the other error you describe. |
Summary
This pr adds a loader to the
YourClasses
component to fix flash of text stating "You are not enrolled in any classes" that would previously display before list of classes finished loading.Page loading with throttling preset Fast 3G:
fast3G.mov
Page loading with throttling Slow 3G:
slow3G.mov
References
Fixes #11043
Reviewer guidance
Network
tab after inspecting the page and changeNo throttling
to a different browser speedTesting checklist
PR process
Reviewer checklist
yarn
andpip
)