Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sticky notification bar overlaps and hides search bar on website #10199

Closed
avats-dev opened this issue Oct 17, 2021 · 12 comments · Fixed by #10204
Closed

Sticky notification bar overlaps and hides search bar on website #10199

avats-dev opened this issue Oct 17, 2021 · 12 comments · Fixed by #10204
Labels
bug 🐛 UX/UI design, user experience, user interface

Comments

@avats-dev
Copy link

Describe the bug

The new alert bar on PYPI overlaps and hides search bar on pypi when on a particular module page.

Expected behavior

Obviously one should have access to the search bar and I think there should be an option (like a ❌ to remove the bar if one need so). It should be placed in a way that pushes the whole screen below by its height and is above to avoid any usage issues.

Also, if a user opts to visit and provide feedback from there, the bar should not be there then but currently this is not the case.

To Reproduce

Visit here or any other similar page.

My Platform

OS : Windows 10/11
Chrome : Version 94.0.4606.71 (Official Build) (64-bit)

Additional context

@ewjoachim
Copy link
Contributor

ewjoachim commented Oct 17, 2021

Hm, it works correctly if we click on a link leading to a project page, but it doesn't if we reload the page (under firefox 93)

EDIT: never mind, it was probably a cached file. Problem occurs on every page now.

@ewjoachim
Copy link
Contributor

I believe this is the file responsible for shifting the body with the width of the sticky element:

https://github.com/pypa/warehouse/blob/main/warehouse/static/js/warehouse/utils/position-warning.js

@ewjoachim
Copy link
Contributor

Hm, I could be wrong but it might be a race condition:

This line:
https://github.com/pypa/warehouse/blob/c6392cb8035d8f3f570dee4f4bfe664d1d2e17ef/warehouse/static/js/warehouse/index.js#L109

Says that within 200ms of the document being ready, the height of the HTML element is computed and added to an inline padding on body.

The flash messages are computed by loading a different page and embedding its partial-html content into our page. So depending on the total timing, the page already has the content or not, which results on the bar being sometimes correct, sometimes incorrect. Not 100% sure it's that, but this could be the reason.

@asottile
Copy link
Contributor

this makes pypi search nearly unusable -- as a workaround I'm using this adblock rule:

pypi.org##.notification-bar.notification-bar--banner

@ewjoachim
Copy link
Contributor

Maybe it's linked to the new banner feature, and maybe the fastly caching parameters for the banner are slight different, or something ?

@pradyunsg
Copy link
Contributor

IIUC, this is the first time we're using #9656.

@yeraydiazdiaz
Copy link
Contributor

yeraydiazdiaz commented Oct 18, 2021

Just noticed this only happens to me on Firefox, Chrome and Safari push the content down correctly. (I'm on Mac Big Sur, btw)

@ewdurbin
Copy link
Member

For now I've disabled the banner.

@ewdurbin
Copy link
Member

I'm not positive if #10204 resolves this or not, so will leave this open. After it deploys I will re-enable the banner and see what people report.

@ewdurbin
Copy link
Member

Confirmed that #10204 does not resolve this issue.

@miketheman miketheman added the UX/UI design, user experience, user interface label Nov 3, 2022
@miketheman
Copy link
Member

I've confirmed today that the notification banners no longer overlap with the search bar on the index and any package page, in desktop and mobile modes.

We've also since introduced the ability to dismiss certain banners (if the admin sets it so).

Closing since it doesn't appear any longer, but if any reporter still has this problem, please reopen with details like browser version, pages, and a screenshot with the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 UX/UI design, user experience, user interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants