URLs fail to work when opening a definition from one namespace and changing perspective to another
hojberg opened this issue · 3 comments
The current way we lookup names mean that names from a namespace thats not the current perspective can't be loaded.
To reproduce:
- Expand
unison.base.Listin the sidebar - Click on
map - Change perspective to
unison.http - Refresh the screen and notice an error on the page
Note that urls with a definition hash always work regardless of the perspective.
Reported by @runarorama
Possible fixes:
- Remove all open definitions if a perspective is set (this seems very harsh and jarring)
- Keep definitions from other namespaces around, but don't support them in the URL (this seems not great for sharing definitions)
- When changing perspective, change all open definitions that are not in that perspective to be hash based (do we always have the hash?).
3 seems like the best option to me right now. We'd likely want to do something like this anyway to give things better names as perspectives change. The big open question is whether or not we reload all those open definitions with the new context to re-render their source (this could mean a bunch of names jumping around on screen and be kinda jarring).
@pchiusano @runarorama thoughts on the above?
What I really wanted to do was get the URL for the namespace I was changing perspective to, so I was really looking for option 1.