-
Notifications
You must be signed in to change notification settings - Fork 170
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
Assessment Workspace: Module tab reloading on each keystroke in editor #2332
Comments
(Moved here from modules repo: source-academy/modules#168) |
See also: #2331 (review) |
One of the things that causes a re-render every time the editor value updates is the session button. This is because the session button takes in the current editor value as a prop so that it can initialise new sessions with it: frontend/src/pages/playground/Playground.tsx Lines 515 to 525 in 1b16551
This isn't an issue for the desktop workspace because the control bar is not a parent or child component of the side content, so the re-rendering of the control bar does not affect the side content component at all. However in the mobile workspace, the control bar is a child of the mobile side content component. I think it should be possible to retrieve the editor value from the Redux store only when it is needed to prevent these unnecessary re-renders. Not sure how close I am to a fix because I'm more or less playing whack-a-mole using the React profiler. |
I've renamed this issue from "Mobile Workspace" to "Assessment Workspace", just to keep the context. I've reopened the issue, because the problem currently arises in the desktop version in the deployed Source Academy (sourceacademy.nus.edu.sg). Screen.Recording.2023-10-16.at.11.55.05.AM.movTo reproduce this example, here is the program:
|
As previously discussed, this issue is likely related to how the various props are being created within the related pages ( The issue may also be affecting Unfortunately, this would require a not-so-trivial refactor of the aforementioned components in order to fix/resolve the problem. |
Just confirming that this issue is still present in the current SA @ NUS. |
How about SA.org? SA @ NUS deployment is frozen so it is expected that the issue still persists there. |
Expected Behavior
Editor keystrokes should not affect module loading.
Current Behavior
Currently each editor keystroke reloads the currently loaded modules in mobile workspace.
Steps to Reproduce
you will see that each keystroke restarts the animation and thus the keyboard entry will be slow.
Context
This is a critical issue in modules. Fixing it is necessary for current CS1101S.
The text was updated successfully, but these errors were encountered: