At the moment, deleting a branch lets you select "force delete" only before trying to delete the branch.
If you didn't select "force delete" then it will fail with a red message in case it actually required "force delete", error:
git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks branch -d test/test3
error: the branch 'test/test3' is not fully merged
hint: If you are sure you want to delete it, run 'git branch -D test/test3'
hint: Disable this message with "git config advice.forceDeleteBranch false"Completed with errors, see above.
This ends up with users having to delete twice after they realize they required to "force delete", and also if they did select "force delete" beforehand, they don't know if that check was really required in the first place if this was their first option.
To improve the user-experience, please, ask for confirmation to try to "force delete" if and only if the deletion fails in the first try. That way there is no need to show any red error to the user unless the "force delete" also fails.
The flow should be:
Delete branch > Show confirmation dialog "Are you sure you want to delete the following branches?" > Yes/No (remove the "force delete" from this first dialog)
Then if the user clicks "Yes" and it fails to delete, instead of showing an error, show another modal dialog with:
"The branch "name-of-branch-here" is not fully merged. Would you like to force delete it?"
"Yes, force delete branch" / "Cancel"