Skip to content

Merge request UI implies protected branches and forked branches can be deleted

Problem

Protected branches cannot be deleted: https://docs.gitlab.com/ce/user/project/protected_branches.html. Currently, when you create a merge request, you have the option to select removing a branch. This option should not appear anywhere in the merge request create/edit web form, and should not appear in the merge request widget. As shown in the screenshot, there is a disabled checkbox with the label in the widget. Currently, when you merge the merge request, it does not delete the branch. This is correct. But the UI is misleading. This should be corrected.

img

Similarly, for a merge request where the source branch is a fork, the author can toggle removing the source branch in the edit web form of the merge request. However, in the widget itself, the maintainer of the master branch cannot change the checkbox because it is disabled. In this case, it is confusing to see an empty checkbox.

img

Design

Edit/create merge request screen

User does not have permissions
  • Don't show option at all. Don't show the checkbox. Don't show the text label. Show nothing.

  • We don't have to show anything all because the user will see anything (if they need to), later on the widget itself.

User does have permissions
  • [CHECKBOX] Remove source branch

Merge request widget

User does not have permissions
  • Merging will not remove the source branch. Therefore, show nothing at all.

MR-merged-environment-performance-1_Copy_31

  • Merging will remove the source branch.

MR-merged-environment-performance-1_Copy_29

MR-merged-environment-performance-1_Copy_37

User does have permissions
  • [CHECKBOX] Remove source branch

MR-merged-environment-performance-1_Copy_35

MR-merged-environment-performance-1_Copy_33

Edited by Victor Wu