ui-core icon indicating copy to clipboard operation
ui-core copied to clipboard

render width seems too low on wide monitor

Open ceedubs opened this issue 3 years ago • 4 comments

I'm using a 24 inch display, and the render width of code/docs on share seems a lot smaller than I would expect. For example, see how the type signature is cut off even though I have close to half of my screen still available on the right.

I believe that https://github.com/unisonweb/unison/issues/3407 is the reason that the signature gets cut off, but I don't think that it explains why the UI is trying to give me such a small renderWidth.

Screen Shot 2022-09-16 at 2 56 37 PM

ceedubs avatar Sep 16 '22 19:09 ceedubs

There's a couple of reasons for this, both UX wise and technical, and a good solution isn't completely obvious.

  1. There's a lot of screen sizes Share can be viewed at. Some people like a split view on a small laptop, some folks read on their phones via a link from twitter etc, and some view things in full on a laptop and some in full on a very wide monitor. Currently we slot into 4 different screen width categories (based on other design systems like GitHub Primer and Tailwind CSS). Check out the size details in viewport.css

  2. There are other plans for the space on the right that adds a limiting factor, like split views, or a right hand side pane for dependencies or authors of the currently selected definition.

  3. Reading documentation on a wide screen that goes edge to edge makes for a terrible reading experience. Having code go wide, but the docs below render at different width is going to look quite odd.

  4. Code is rendered on the server. We can ask for it to be rendered in a certain width, but given the many sizes we encounter and the fact that folks can resize their browser at any time, re-rendering by going to the server when the window is resized is going to be pretty involved to get right. We could decide a render width based on initial window size and have people refresh to force a new width, but currently that would mean that all by the currently selected definition is lost.

Anyway thats a bit of a longwinded way of saying that we definitely want to see improvements in this area, but there are a lot of considerations in play, making this a less than straight forward effort.

hojberg avatar Sep 16 '22 19:09 hojberg

@hojberg thank you for the detailed response. It is indeed trickier than I realized. Hopefully when unisonweb/unison#3407 is merged it will look considerably better.

I'm really excited for a split view!

ceedubs avatar Sep 19 '22 14:09 ceedubs

Seems like this no longer an issue, so it can be closed.

https://share.unison-lang.org/@unison/base/code/releases/2.12.0/latest/terms/data/Stream/%2B%2B

shot-2024-01-25-at-21-06-20--area

andreystepanov avatar Jan 25 '24 19:01 andreystepanov

Hmm is this browser dependent? For me (on Firefox) it behaves nicely until it pops open the navigation pane on the left and then it stops expanding the code render width.

Screencast from 2024-04-05 10-04-19.webm

ceedubs avatar Apr 05 '24 14:04 ceedubs