IDE should not show folders in staged / unstaged section
Description
It creates many confusing scenarios when we include folders in the staged / unstaged section of the Web IDE.
Proposal
Folders should not be included in the staged / unstaged section of the Web IDE.
But Why?
Reason 1 - Consistency
It's inconsistent with other source code providers, editors, and the rest of GitLab (i.e. MR diffs). It's also inconsistent with the Web IDE itself. When adding a new folder and nested file, we do not show the folder, only the newly added file.
Reason 2 - UX Complexity
If we allow folders in the staged / unstaged section it creates some weird scenarios (this is mostly because files are a derivative of folders, so including them in the same list breaks normalization).
UX Scenario 1 - "Staged file deletion / Unstaged folder deletion"
Say a user deletes an entire folder through the editor. They actually want to keep the folders alive, so they stage the file deletion but unstage the folder deletion. Our UI looks like we'll let the folders live, but this is not how git
works and the folders will be deleted since they are empty.
UX Scenario 2 - "Unstaged file deletion / Staged folder deletion"
Say a user deletes an entire folder through the editor. Since they just want to remove everything, they think that staging the folder deletion is enough. Our UI looks like we'll delete the folders and we even let them commit an empty commit.
Deleting folders | Empty commit |
---|---|
Context
The following discussion from gitlab-ce!31727 should be addressed:
-
@pslaughter started a discussion: praise: Thanks for catching this! This is a good immediate fix to the problem
🎉
issue: IMO, it's concerning that these
tree
files are even showing up instage
/unstage
. This is a much deeper issue than the one at hand, so I'll create a follow up issue and ping the usual suspects.