You are right, technically speaking it is true we already have the name of views and we can avoid to ask them again to the users.
However what you proposed It's not so straightforward with the current editor structure, I don't say it is impossible. At first sight we should:
1- migrate the file list sidebar into an indipendent component (currently it is part of the editor page) (backend part)
2- for each opened file(tab) stores in a javascript variable the current available views (js)
3- periodically or on demand, parse the python file to find the current declared endpoints (js)
4- remove from the declared endpoints(discovered in point3) those already available (point 2). (js)
5- feed the dropdown menu with those discovered in point4 (js)
6- when a new file is created, add the new view to the available views(point3) and update the file list sidebar(point 1).(backend/js)
I start with 1, I can work on the other points in the coming days/week.