unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.75k stars 269 forks source link

UI/Local - long strings should be truncated or wrapped or something #4392

Open kylegoetz opened 10 months ago

kylegoetz commented 10 months ago

I added a very long string that is the contents of a PEM file for a private CA that is publicly known. It makes sense to have this be in the codebase instead of requiring users to seek this out.

I added something like

cert : '{Exception} SignedCert
cert = do """
----BEGIN......
....
....
....
----END... |> toUtf8 |> decodeCert |> toException

However, later, in the UI, when I view it, I see this

Screen Shot 2023-11-15 at 2 41 14 PM

Maybe a wrap calculation on render based on where newlines are located if the total string is longer than, say, 80 chars or something?

ceedubs commented 10 months ago

I think that the pretty-printer was recently changed to use the multiline string-literal syntax for strings that contain newlines. I wonder if this change just hasn't been integrated into Share yet? @ChrisPenner