Automatically stage all changes in the Web IDE
The Issue has been identified in the discussion related to committing deleted and changed entires at the same time.
The current behavior:
- If there are no files staged, clicking "Commit" stages all unstaged files automatically
- If there is at least one file staged ("Staged Changes" field) then this is what gets into the commit and hence to the MR. Those changed files that were not explicitly staged are simply ignored. This is, technically, by design.
To reproduce:
- Open web IDE on a project
- Delete a file
- Modify a file
- Go to the "Commit" view. Note deleted file being staged, while the changed one is still in "Unstaged changes"
- Select "Create new Merge Request" and "Create a new branch" options
- Click the "Commit" button without staging the changed file.
- In the new MR form, note that the changed file has not been picked up in "Changes" tab for the MR (at the bottom of the form)
This might look counter-intuitive for the end-users even though it follows the original path of git
.
Video from #31704 (comment 226025679)
Proposal
In order to make the workflow easier to understand, we are going to automatically stage all changes.
In addition to that, the following changes have to be made:
On the Edit
tab, change the sentence x unstaged and x staged changes
to x staged and x unstaged changes
. It could otherwise be confusing if the user makes a change and the first number they read is 0.
In addition to that, as soon as the user presses the button "Commit" in either the Edit
or Review
tab, they will switch to the commit tab with the commit message, branch selection and merge request checkbox expanded. So far the user first arrived at this screen where they had to click on "Commit" again.
Instead, we want to lead the user directly to this state: