You need to look at the video of the Tesla gull wing doors operating again.
They are double-jointed so they can move up vertically without increasing the width as much as a conventional door does, and they have sensors so they are designed to stop before they touch anything. They just fold out of the way like an electric roof on a convertible.