This solution works together with the bicycle rest. A cord goes from the saddle and holds the handlebar in position, slightly turned so that is is keep in position by gravity. In this way, the bicycle can stand safely.
In the cord end there is a hook which, besides holding the handlebar, also activates the brake so this it can also be used on steep streets.
When not in use, the cord, which has a small weight in the other end, is collected to the saddle tube by gravity (another solution to hide the cord is to use a curl spring).
This is already implemented and in use! We made it in aluminum. Now we also made a 3D printed prototype in plastic! Soon we will share the 3D models so anyone can print it.