Skip to content

Closing WebIDE file, switch to new file before closing the active one

Denys Mishunov requested to merge 292498/webide-switch-before-closing into master

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:

  1. close the opened file
  2. update the state marking it as non-active anymore
  3. compute what file should be opened next
  4. 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

  1. compute what file should be opened next
  2. switch state for that new file to be active and opened
  3. update the state marking the previously opened file as non-active
  4. 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

Availability and Testing

References #297451 (closed), #292498 (closed)

Edited by David O'Regan

Merge request reports