-
Notifications
You must be signed in to change notification settings - Fork 237
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
initial notifications prototype [copilot] #12567
Draft
andrewscfc
wants to merge
11
commits into
latest
Choose a base branch
from
notifications-prototype
base: latest
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
andrewscfc
commented
Mar 25, 2025
|
||
if (periodicSyncRegistration.periodicSync) { | ||
await periodicSyncRegistration.periodicSync.register("get-latest-news", { | ||
minInterval: 1 * 60 * 1000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In production this would have an interval of probably a week as agreed by product
…type' into notifications-prototype
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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