pydata-sphinx-theme
pydata-sphinx-theme copied to clipboard
allow to dismiss announcement bars
#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:
- show banner / require clicking X on every page
- keep track if banner was dismissed for all pages within that site version
- 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.
- Big yes
- Smaller yes, as persisting the information is not that complicated in the session.
- 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.
+1 on this feature. My preference would be option 3:
- I feel having the banner close in one single page and then require the user to close it on every page would be a poor user experience
- As a neurodiverse individual, banners and announcements can be pretty distracting, so having a way to close them is helpful. Again, if I were required to close this banner every time, I would get annoyed.
- My gut tells me option two would be more challenging than 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.
If we were to do a pro/con of each option, here's how that'd go:
Option 1:
- Pros: As mentioned, this is simple to implement, and it ensures that users are aware of the announcement or warning each time they visit a page.
- Cons: Users need to dismiss the banner on every page visit, which could be repetitive and potentially annoying. It may not be the most user-friendly approach, especially for frequent visitors.
Option 2:
- Pros: More convenience to users, as they won't have to dismiss the banner repeatedly during their visit.
- Cons: Users will encounter the banner when accessing different versions of the documentation. It may not provide a consistent experience if users switch between versions frequently.
Option 3:
- Pros: It offers the most persistent dismissal for users, regardless of the specific version they're accessing.
- Cons: Users who dismiss the banner may not be aware of new announcements or warnings if they switch to a different version. It may lead to missed information or updates if users rely on the persistent dismissal.
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 and Don't Show Again
would emulate Option 3.
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:
- I'm searching for the
tolist
method of numpy because I never remember the exact syntax. I searched on google with the following keywords: "numpy", "to_list". - Because of my search engine history, because I made a spelling mistake in the method name, maybe also some dark magic from google itself, the first link is v1.17 (https://numpy.org/doc/1.17/reference/generated/numpy.ndarray.tolist.html). Lucky for me there is a banner telling me: "move to v1.25".
- Hypothesis: you implement a "don't show again button", of course I'll click on it because I don't want to see this stupid banner again. Then I proceed to move to 1.25 and find the information I've been looking for.
- Now I do a search again with the following keywords: "numpy", "ndarray". And again I'm sent to v1.17. If I've dismissed the banner forever, I have 0 indication that I'm not on latest and 100% chance to think its the correct one.
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.
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.
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 ? 😄
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.
I'm attempting something in #1763 if some of you are interested.