unisonweb / codebase-ui

Unison Codebase UI
https://share.unison-lang.org
MIT License
46 stars 7 forks source link

Perspective: Improve rendering of very long names #277

Closed hojberg closed 2 years ago

hojberg commented 2 years ago

Overview

Now, with a very long namespace perspective, always ensure that the visual slug is visible and clip the namespace on the left side, favoring the tail end of the namespace: base.List.NonEmpty might become ...List.NonEmpty rather than base.List.NonE....

CleanShot 2021-11-23 at 16 26 33@2x

Fixes https://github.com/unisonweb/codebase-ui/issues/264

Implementation notes

This uses a bit of a hackish way to determine overflow to add a css class, but the low effort compared to alternatives seemed worth it.

Caveats

I also removed the "up" icon for going from a perspective to the root. The user can always just click the top left area (where it says "Unison Share"). I might put the up icon there later on to better indicate this behavior.