cue icon indicating copy to clipboard operation
cue copied to clipboard

cuelang.org: visiting an anchor/section should hide the floating header

Open mvdan opened this issue 1 year ago • 4 comments

What page were you looking at?

https://cuelang.org/docs/concept/modules-packages-instances/#instances

What version of the site were you looking at?

https://github.com/cue-lang/cuelang.org/commit/47796448e1dfc31c188db061f7d785ee94df4fa8

What did you do?

Navigate to the "instances" section with the link above via a new browser tab.

What did you expect?

To be able to read the section, for example: image

What did you see instead?

Not much! image

mvdan avatar Apr 24 '24 11:04 mvdan

I realise that the header disappears and reappears as I scroll, but it should definitely default to being hidden if I navigate to any part of the page that isn't the very top.

The very same issue happens if I navigate to the page without an anchor, scroll halfway down the page (hiding the header), and refresh with Ctrl+R. The header reappears, hiding a good chunk of the visible text.

mvdan avatar Apr 24 '24 11:04 mvdan

One more thought: right now the header reappears as soon as I scroll up by a single pixel. I reckon it should take a little bit more than that, because otherwise it reappears extremely easily - for example, when I scroll down with my fingers, sometimes I'm not perfect and I scroll up by a few pixels at the start or end, due to the nature of how my fingers move. This can make the header re-appear when I don't want it to, causing a bit of frustration as it eats into my reading space.

mvdan avatar Apr 24 '24 11:04 mvdan

@mvdan Please could you check if this issue's headline problem still strikes and, if so, using which browser?

Either way, I think we should use this issue to track the later point:

One more thought: right now the header reappears as soon as I scroll up by a single pixel. I reckon it should take a little bit more than that

... as that's definitely still a problem.

jpluscplusm avatar Sep 26 '24 12:09 jpluscplusm

It seems the scrolling to anchor has not been picked up by the listener that should hide the header on scroll down. In #2971 I also fixed an issue related to anchor links so it could be this is related and maybe fixed by this.

One more thought: right now the header reappears as soon as I scroll up by a single pixel. I reckon it should take a little bit more than that, because otherwise it reappears extremely easily - for example, when I scroll down with my fingers, sometimes I'm not perfect and I scroll up by a few pixels at the start or end, due to the nature of how my fingers move. This can make the header re-appear when I don't want it to, causing a bit of frustration as it eats into my reading space.

We can add some logic that will show the header on scroll up after x pixels are scrolled (100 or so?) Let's create a separate issue for that. @mvdan @jpluscplusm

JorindeUsMedia avatar Oct 16 '24 09:10 JorindeUsMedia