initial notifications prototype [copilot] #12567
Draft
+123
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves JIRA: NA
NOTE - Does not currently work correctly on homepages
Summary
This PR demonstrates a simple prototype where a 'news catch up' notification can be shown (probably once per week). In production it would likey contact a JSON endpoint per service to get the latest news and show it in a notification.
Where a user has never clicked the 'follow' button they see this in header:

Once they click the button they get the browser permission modal:

If they click allow the folow button changes to this:

It will also look as above on subsequent visits with notifications permitted
If they click 'Block' the button disappears, you can only get the button back if you change the notification settings in the browser for the site, there is no programatic way to ask again
The PR also enables a hardcoded notification to show the latest news to catch up on; the code sets an interval of a minute but browsers limit this interval to a day to prevent malicious use.
If you follow the instructions here you can trigger the notification using the tag
get-latest-news
.Code changes
Developer Checklist
Testing
Ready-For-Test, Local
)Ready-For-Test, Test
)Ready-For-Test, Preview
)Ready-For-Test, Live
)Additional Testing Steps
Useful Links