Closing WebIDE file, switch to new file before closing the active one
What does this MR do?
It re-orders the actions taking place in WebIDe when one closes a file (tab). Originally (current master
) we do the following:
- close the opened file
- update the state marking it as non-active anymore
- compute what file should be opened next
- switch state for the new file to be active and opened
Step 1 here means that we destroy repo_editor
component every time the file gets closed and re-mount it on step 4 again. This also means that we discard the monaco editor and create it again on these steps.
This MR suggests the following order of actions instead
- compute what file should be opened next
- switch state for that new file to be active and opened
- update the state marking the previously opened file as non-active
- close the previously opened file
The last two steps already happen in the background since the tabs are switched to another active file already. This gives a slightly improved perceived performance of the process. But most importantly we do not cast resources out of the window anymore: the repo_editor
component doesn't get destroyed in this scenario since we always have an opened file (unless all files get closed).
Screenshots (strongly suggested)
No visually detected changes
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
References #297451 (closed), #292498 (closed)