pydata / pydata-sphinx-theme

A clean, three-column Sphinx theme with Bootstrap for the PyData community
https://pydata-sphinx-theme.readthedocs.io
BSD 3-Clause "New" or "Revised" License
618 stars 321 forks source link

allow to dismiss announcement bars #1384

Open drammock opened 1 year ago

drammock commented 1 year ago

1354 adds a version warning bar in addition to our announcement bar. It would be nice if users could click an X to dismiss the announcements/warnings (they take up quite some space at the top of every page). Not sure how easy it is to persist that setting (or if we even want to do that), seems like options ought to be:

  1. show banner / require clicking X on every page
  2. keep track if banner was dismissed for all pages within that site version
  3. keep track if banner was dismissed for all pages in that URL domain (all docs versions)

I lean toward the simplest (option 1) but I'm open to being convinced otherwise.

12rambau commented 1 year ago
  1. Big yes
  2. Smaller yes, as persisting the information is not that complicated in the session.
  3. I think it's a bad idea. A simple use case is if you land on documentation from a search result (e.g. pandas) then you could be send to the wrong version. You want to notifiy the user even if it's not the first time he comes to this version by accident.
trallard commented 1 year ago

+1 on this feature. My preference would be option 3:

Docusaurus follows the approach from option 3. We could also have a look at how they achieve this.

Also, I am pinging @smeragoel in case she has other valuable UX insights.

smeragoel commented 1 year ago

If we were to do a pro/con of each option, here's how that'd go:

Option 1:

Option 2:

Option 3:

I feel that if users work across different versions then it may be more user-friendly to implement Option 2. It would provide a balance between convenience and ensuring users are aware of important information.

But I understand @trallard's point, and in that case, we could introduce Dismiss and Don't Show Again buttons on the banner to leave that choice to the user. Dismiss would emulate the behaviour in Option 2 andDon't Show Again would emulate Option 3.

12rambau commented 1 year ago

Just to enphasis again why I thing any implementation of 3 is a bad idea with a use case that I did just now on my computer:

My point is, I land on PST based documentation searching on google and I'm pretty sure my way of searching is standard. As long as you do this and depending on your search tool/parameter/history people could change version without knowing it, so to me me "don't show again" even if fancy is not adapted to multi-version technical documentation websites.

trallard commented 1 year ago

I think we might be conflating or confusing banners.

When I think of an announcement banner it can be like the one we have in our docs "Pydata sphinx is an open source project..."

"numpy sprints at scipy" things like that.

I suppose we can allow for these to be dismissed for a version or until these banners are updated so folks do not miss information.

While version warning banners are a different thing (and I think those are still in progress) - but basically tells you "this is not the most up to date version". These make sense not to dismiss them forever.

So my suggestion was more about the former than the latter.

12rambau commented 1 year ago

My bad there was effectively a confusion. And then yes 3 makes sense because once you know "Pydata sphinx is an open source project" do you really need a reminder on daily basis ? 😄

lucascolley commented 8 months ago

this came up in SciPy with respect to version warning banners. I think option 2 makes most sense. Option 3 makes no sense in this context, and option 1 would probably cause a bit of annoyance.

Carreau commented 7 months ago

I'm attempting something in #1763 if some of you are interested.