Enable a diff preview when using the online text file editor
Description
Problem: When one opens a text file in the repository for editing, loses context (due to working on something else in parallel etc.) an returns, there is no way to check if any changes have been made since the file has been opened. This leads to issues outlined in gitlab-ce#22036 - the user committing an empty changeset to be sure no changes were lost.
Use Cases: Prevention of committing empty changesets and checking if changes have been made to be confident in closing the online editor tab without losing the changes that could have been made but one doesn't have a way to know.
Proposal
Please fix gitlab-ce#22036 as a part of this feature request to avoid empty changesets being committed and then add a new tab atop the online code editor that says "Diff" and computes the difference between the current text editor contents and the contents of the file persisted in the repository. This difference should drive the enabled/disabled state of the Commit Changes button. Alternatively, consider making the diff view a default on the Preview tab. Another alternative is to list diff in the combo that says "text" and "base64", but I am not sure that's enough visibility for this functionality.