Open BaumiCoder opened 7 months ago
A similar problem with the old online editor was reported in #7393.
Thanks for reporting - I'll have a look
There are two underlying problems:
I think Monaco provides a nice solution for this. There's a method saveViewState
that stores the current position of the editor, its scroll position (among other things) and returns an object containing this information. Instead of manually restoring the cursor position, we could try saving and restoring the view state of the editor instead.
We'll have to see how this interacts with the feedback widgets rendered in the editor, though
(Edit: after trying it locally - the widgets do cause problems here, as they are rendered just a little bit later than the rest of the editor. we'll have to be careful about when to restore the view state of the editor)
Describe the bug
When I use the new online editor (Monaco) the scrolling position of the editor is always on the top of a file after opening it. I would expect that the previous scrolling position be retained for each file.
This problem applies to online editor for student submission (https://github.com/ls1intum/Artemis/pull/8130) and for the online editor for instructors (https://github.com/ls1intum/Artemis/pull/8389). Technically it should be quite the same situation.
To Reproduce
Example for the student submisson:
Expected behavior
The editor is still in the scrolling position from step 4.
Screenshots
The editor is again at the top of the file.
Which version of Artemis are you seeing the problem on?
7.0.0
What browsers are you seeing the problem on?
Firefox
Additional context
The situation in the online editor for instructors (https://github.com/ls1intum/Artemis/pull/8389) was tested with the branch
feature/programming-exercises/monaco-instructors
at Commit 25d4fe5.Relevant log output
No response