readthedocs / ext-theme

Read the Docs drop in replacement site templates
2 stars 2 forks source link

Announcements: allow user to close feature announcements #377

Closed humitos closed 3 months ago

humitos commented 3 months ago

Add a small "X" next in the right top corner of the announcement to let the users to close the announcement. It uses a cookie to avoid showing it next time they load the page.

Peek 2024-06-11 17-08

Related

humitos commented 3 months ago

I will update this PR to add the same X button to all the other cards as well. I added only on "traffic analytics" just as a test to get some feedback.

I am wondering now if we do more display time logic on the front end side. That is, with templates deciding what announcement to show, we can back down to the next notification. With front end logic in addition, templates will decide to show a notification but then it will just be hidden instead of backing down to another notification.

I'm not sure to understand this. Do you mean returning the HTML for all the notifications and decide which one to show on the front-end side? What's that logic? I'm happy to discuss this more and include it in another PR.

humitos commented 3 months ago

I updated the PR to reflect this. Let me know if it's ready to merge 👍🏼

agjohnson commented 3 months ago

I will update this PR to add the same X button to all the other cards as well. I added only on "traffic analytics" just as a test to get some feedback.

:+1: Yeah figured this was just a start.

I'm not sure to understand this. Do you mean returning the HTML for all the notifications and decide which one to show on the front-end side? What's that logic? I'm happy to discuss this more and include it in another PR.

I haven't thought of how to solve this. We could use front end logic for 100% of the announcement decision, or use a proper cookie and use the cookie in the backend/template when deciding which announcement to show.

The goal would be to ensure the user always has an announcement available to show. With mixed template and front end logic deciding if an announcement shows, users will end up pinned to an announcement they have hidden. These are onboarding steps, so this would effectively end the onboarding progression for the user.

humitos commented 3 months ago

OK, I quickly opened https://github.com/readthedocs/ext-theme/issues/378 to discuss this more. I'm merging this chunk of work for now.