Steps to reproduce
- Open a large/complex file in edit mode (e.g. the “Start here” page in Help), then open another large/complex file in the same pane (e.g. “Format your notes” in Help).
- Switch the edit mode pane to preview mode
- Go back to the first file
- Go forward to the second file
Navigating forward or back should display the correct note in the relevant mode, without an intermediate state.
When going forward or back, the current file switches modes to match the mode you’re about to navigate to, and then loads the other file, creating a visible flicker and screen refresh that gives the impression you’ve moved through history twice instead of once.
(If you’re doing this in the Help vault, you’ll see the difference in how the two side-by-side panes behave: the pane where the mode stays the same will change once, but the pane where the history has different modes will change twice.)
- Operating system: Windows
- Obsidian version: 0.12.1
I previously reported this bug against 0.11.9 and that report was closed as being fixed in 0.11.13. However, it appears that only the flicker of “No file” was fixed, not the mode change issue itself.
When I debugged this previously, the sequence of events taking place was:
setMode()to switch the mode
setMode()hides the old mode and reveals the new mode
setState()loads the file asynchronously, allowing the changes made by
setMode()to be displayed while the file is loading
This could perhaps be resolved by allowing
setMode() to accept a file argument, and load it into the new mode before hiding the old mode and displaying the new one, so as to avoid the double rendering and the disorienting flickers.