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

Global alert level configuration and persistence across sessions #215

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

JeffersonBledsoe
Copy link
Member

Screen.Recording.2024-12-06.at.01.59.54.mov

Todo

  • Configure cookies so we can have multiple global banners?
  • Configure cookies so it's a different cookie per site

@JeffersonBledsoe
Copy link
Member Author

@djay Any ideas on cookie configuration? We could use the site title to at least relate each cookie to the site, but that doesn't solve the multiple banners problem (if it's even a problem)

@djay
Copy link

djay commented Dec 6, 2024

I'm guessing at your problem since don't really describe it.
Are you saying that currently the dismiss doesn't work when the user refreshes the page?
if so

  • yes you need a cookie
  • I'd either use block UID ie alert-xxxxxx: true
  • OR probably nicer is a hash of the block contents. because I bet they will disable the alert and then re-edit it later and think this will show again for users. hash of the block will avoid that.

if you set a expiry of say 6 months on the cookies it will help prevent them building up too much if the content changed a lot

@JeffersonBledsoe
Copy link
Member Author

OR probably nicer is a hash of the block contents

We should be able to hash the whole block data fairly easily, so this seems like a good approach.

if you set a expiry of say 6 months on the cookies it will help prevent them building up too much if the content changed a lot

NSW code seems to default to 7 days actually!

@djay
Copy link

djay commented Dec 9, 2024

@JeffersonBledsoe 7 days it is then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants