The `/getDefinition` API should prefer the name with which it was queried
hojberg opened this issue · 1 comments
hojberg commented
Problem
Currently base definition on Unison Share is named after a fork of base in a contributors namespace.
Examples
Proposed solution
When finding a definition via the /getDefinition API and there are multiple names:
- If queried with a Hash, the shortest FQN should be selected
- If queried with a name, prefer that name
- If queried with an ambiguous name, prefer the shortest
This change could be done by updating this function to take a queried FQN argument: https://github.com/unisonweb/codebase-ui/blob/main/src/Definition/Info.elm#L36
hojberg commented
The frontend has all the knowledge to do this correctly. Going to move the ticket to the codebase-ui repo.

