editor
editor copied to clipboard
feat: switch editor action
Description
Initial implementation for quickly switching between editor types. Two major issues:
- History entries cannot persist upon switching editors
- Transferring current (unsaved) document state over is complex
Possible solution: Only allow this action to work if the tab does not contain unsaved content.
Motivation
closes #801
Run & review this pull request in StackBlitz Codeflow.
I propose a solution to both of the issues:
-
We don't need to save history between editors. The action of switching editors kind of acts as switching workspaces. The new workspace won't include edit history.
-
If there is invalid JSON we show a popup notifying the user. If the JSON and the file is saved, we switch editors. Otherwise, we prompt the user to save and switch editors allowing them to cancel.