WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.4k stars 4.15k forks source link

Customizer Widgets: Make editor top bar visible on scroll #30912

Open critterverse opened 3 years ago

critterverse commented 3 years ago

Hi all, re-sharing an idea that came up in https://github.com/WordPress/gutenberg/issues/30720#issuecomment-818278219 around the scrolling behavior for the editor "top bar."

I'm wondering if the top bar should act as a sticky element on scroll — meaning the Customizer navigation area could scroll as normal and disappear out of view, while the editor top bar could lock into position directly underneath the Customizer top bar. This can help maximize space in the canvas area while keeping important actions visible.

In order to achieve this affect, I think we could try treating the editor top bar more like its own proper bar/section (right now it's more like a part of the canvas).

For added clarity, these are the different sections I'm referencing:

Arrows pointing to 4 areas: Customizer top bar, Customizer navigation, Editor top bar, and Canvas

Scrolled:

https://user-images.githubusercontent.com/77359364/114959955-156ec100-9e34-11eb-93df-9574e2c25c87.mov

Figma file is here :)

critterverse commented 3 years ago

Closing this issue for now as there are several ongoing conversations about adding functionality to the top area of this Customizer screen #30886 and #30720. No need to make this area more complicated while things are still being figured out!

noisysocks commented 3 years ago

I saw that @talldan was working in this area so assigning him and moving to In Progress. Feel free to move it around if that's not right 🙂

talldan commented 3 years ago

I tried to implement the sticky aspect of the top bar as part of #31589, but it's complicated because the floating block toolbar anchors itself to the top of the scroll container when scrolling down. This implicit behavior caused it to sit underneath the top bar.

There were some potential solutions with trade offs:

But there might be better options, it needs more investigation.

critterverse commented 3 years ago

it's complicated because the floating block toolbar anchors itself to the top of the scroll container when scrolling down. This implicit behavior caused it to sit underneath the top bar.

I can see what you mean @talldan. Due to a similar issue, I think we should also the remove the reappear-on-reverse-scroll that is currently applied to the Customizer description container (where it says "Footer" with the back arrow):

https://user-images.githubusercontent.com/77359364/118919460-8a855880-b902-11eb-9e86-5a29ca7f68aa.mov

^ Even when the fixed toolbar option is turned on, there are some issues with reshowing that container area on reverse scroll (it causes the fixed toolbar to lose stickiness and get knocked back into its default position at the top of the editor when scrolling from bottom to top). So either way, removing it seems like a step in the right direction.