unisonweb / unison

A friendly programming language from the future

Home Page:https://unison-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Share: URL doesn't update correctly when changing perspectives

hojberg opened this issue · comments

If a definition is open, and a the perspective is changed to still include that definition but one namespace level deeper, the original definition url remains the same, meaning the namespace portion of the url is repeated.

To reproduce:

  1. Visit https://share-next.unison-lang.org/users/unison
  2. Select the definition public.base.main.Boolean in the left sidebar
  3. Now select to change perspective to public.base.main in the left sidebar

Notice URL is now https://share-next.unison-lang.org/users/unison/code/latest/namespaces/public/base/main/;/types/public/base/main/Boolean with public/base/main appearing twice, both at the perspective level (first part of url) and definition level (last part of url).

The namespace information like that should be removed from the definition part of the url whenever possible (can't do it if the definition is outside of the new perspective, in which case it should revert to a hash)

Fixed :)