Add toggling between branch and leaf selection modes