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
Desktop: Fixes #6416: Switching a note using Sidebar is slow and grayed out #6430
Conversation
But I'm wondering why no note is selected for a moment? Wasn't that some kind of hack to reset the editor state for instance? And by fixing it we may bring back some old bug? Or is it not possible to fix the state handling so that it doesn't have a gap with no selected note? |
I thought the possibility, if it were intentional. But it seems no to be intentional. The reason why no note is selected is just that there is no way to decide the first note in the new notebook when Speaking of resetting, it is unreasonable that resetting scripts relies on SideBar. Anyway, initializing scripts are performed when a new note is loaded. And, if reloading scripts is needed, it should be implemented in a more reliable way than clicking SideBar. If resetting (reloading) is needed explicitly by a user's operation, other operations such as showing options and selecting an empty notebook delivers the same effect.
As stated in this comment, a modification in reducer will have a heavy impact on wide areas. In the GUI part, no no-note-state can be accepted. But I don't know if it is OK elsewhere. So I think it is safe not to erase the no-note-state. |
Thanks for clarifying but I feel it's risky to change this, and I'm not keen having certain parts of the code loading an old note, and other parts loading no note. Right now, it's not ideal but at least it's consistent with the application state. Does it make a big performance improvement to remove this temporary gray screen? |
This time gap causes no inconsistency, because it is transient and has no timing room for user's interaction. Practically speaking, this PR only ignores a transient state which is perfectly acceptable not to be recognized. Of course, fixing reducer is ideal.
Yes. This PR removes "Reloading script" part of image (B) and (C) in this comment. |
Thanks for the fix @ken1kob! |
This PR fixes issue #6416.
Features:
Description:
NoteEditor.renderNoNote()
is called, and then its body (Editor/Viewer) is unmounted. So, NoteEditor becomes grayed out, and scripts in Editor/Viewer gets reloaded.