Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.4k stars 1.98k forks source link

Sticky block gap when the admin bar is deactivated #91397

Open ariel-maidana opened 3 months ago

ariel-maidana commented 3 months ago

Quick summary

When the admin bar is deactivated on the user profile and the site has a sticky header, the user who has deactivated it will see a gap at the top of the site when they visit the site frontend. The gap will be in the same spot where the admin bar would be if it were active.

Steps to reproduce

  1. Go to Users ---> All Users.
  2. Switch to Classic View.
  3. Click on "Edit" under your profile.
  4. Disable Toolbar/Show Toolbar when viewing site.
  5. Click on Update Profile.
  6. Set the Site Header as sticky in the Site Editor.
  7. Save the template in the Site Editor.
  8. Go to the site frontend.

What you expected to happen

The header should be shown as sticky at the top of the page.

What actually happened

There's a gap at the top where the admin bar would be if it were active.

Impact

Some (< 50%)

Available workarounds?

No and the platform is unusable

Platform (Simple and/or Atomic)

Atomic

Logs or notes

Reported here: 8254974-zd-a8c

github-actions[bot] commented 3 months ago

Support References

This comment is automatically generated. Please do not edit it.

liviopv commented 3 months ago

📌 REPRODUCTION RESULTS

📌 FINDINGS/SCREENSHOTS/VIDEO

Atomic - Default Style:

CleanShot 2024-06-03 at 13 39 27@2x

Atomic - Classic style:

CleanShot 2024-06-03 at 13 43 57@2x

Local: CleanShot 2024-06-03 at 13 34 32@2x

📌 ACTIONS

📌 Message to Author @ariel-maidana I wasn't able to reproduce it on Atomic because the WP.com bar can't be disabled by that setting, afaik - it requires a custom snippet even when using Classic Style P9HQHe-j2-p2

How did the user managed to disable the toolbar completely?

Also cc @mrfoxtalbot as you might have more info on how this should work with UCNR

ariel-maidana commented 3 months ago

On a test site with all user plugins deactivated, I still can see the "Show Toolbar when viewing site" option and I'm able to deactivate it.

Here's a screenshot of the profile screen:

Captura de pantalla 2024-06-04 a la(s) 1 31 42 p  m

This is a recording of the site frontend when the option is deactivated:

https://github.com/Automattic/wp-calypso/assets/4965723/599ba092-055a-4f3c-9222-0971d604c3ad

The settings are at /wp-admin/profile.php?wp_http_referer=%2Fwp-admin%2Fusers.php

mrfoxtalbot commented 3 months ago

I can confirm this seems to be coming from core. I will search for an existing issue and open one if needed.

mrfoxtalbot commented 3 months ago

I'm going to take back the above. After some more testing, I cannot reproduce this on a self-hosted site.

I can not hide the master bar on any of my sites either... that's odd.

The new master bar was added by UCNR so I opened an issue: https://github.com/Automattic/dotcom-forge/issues/7622

mrfoxtalbot commented 3 months ago

@ariel-maidana, just to confirm, are you still able to hide the master bar? Thank you!

ariel-maidana commented 3 months ago

@mrfoxtalbot yes, I still can hide it using my test account.

liviopv commented 3 months ago

@ariel-maidana can you share a link to your site to see if I can take a look at the setup and replicate it? I'm wondering if there's something we're missing.

ariel-maidana commented 3 months ago

@liviopv I tested here: https://proplantest2022.wpcomstaging.com/

mrfoxtalbot commented 3 months ago

Thank you for the link, Ariel. I see you are using theme "Tenaz" on that site but Livio's testing (where he could not replicate it) was done using TT4.

Are you able to replicate this using other themes, @ariel-maidana? Thanks again!

ariel-maidana commented 3 months ago

@mrfoxtalbot I was able to replicate it with Alonso. I haven't tried other themes yet.

mrfoxtalbot commented 2 months ago

This is very odd. I cannot hide the master bar (https://github.com/Automattic/dotcom-forge/issues/7622) OR replicate the issue you describe @ariel-maidana. Do you think you could share a short screencast to illustrate the issue step by step? Thanks a lot!

ariel-maidana commented 2 months ago

I created a new site, with Twenty Twenty-Four and no custom plugins. I replicated the issue and recorded a screen cast.

https://github.com/Automattic/wp-calypso/assets/4965723/06ae655a-4119-47f6-98cc-c9f182eb1e46

Site URL: https://bartestsite4.wpcomstaging.com/

mrfoxtalbot commented 2 months ago

Thank you for the video @ariel-maidana I have seen this in the past with other themes.

If I am not mistaken, it only appears to be affecting logged in users so the impact is relatively minor.

Screenshot 2024-06-28 at 16 07 47

I have lowered the priority and marked it as triaged. Thanks again for your help, Ariel!