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

initial notifications prototype [copilot] #12567

Draft
wants to merge 9 commits into
base: latest
Choose a base branch
from

Conversation

andrewscfc
Copy link
Contributor

@andrewscfc andrewscfc commented Mar 25, 2025

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:
image

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

If they click allow the folow button changes to this:
image

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

  • A bullet point list of key code changes that have been made.

Developer Checklist

  • UX
    • UX Criteria met (visual UX & screenreader UX)
  • Accessibility
    • Accessibility Acceptance Criteria met
    • Accessibility swarm completed
    • Component Health updated
    • P1 accessibility bugs resolved
    • P2/P3 accessibility bugs planned (if not resolved)
  • Security
    • Security issues addressed
    • Threat Model updated
  • Documentation
    • Docs updated (runbook, READMEs)
  • Testing
    • Feature tested on relevant environments
  • Comms
    • Relevant parties notified of changes

Testing

  • Manual Testing required?
    • Local (Ready-For-Test, Local)
    • Test (Ready-For-Test, Test)
    • Preview (Ready-For-Test, Preview)
    • Live (Ready-For-Test, Live)
  • Manual Testing complete?
    • Local
    • Test
    • Preview
    • Live

Additional Testing Steps

  1. List the steps required to test this PR.

Useful Links


if (periodicSyncRegistration.periodicSync) {
await periodicSyncRegistration.periodicSync.register("get-latest-news", {
minInterval: 1 * 60 * 1000,
Copy link
Contributor Author

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

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

Successfully merging this pull request may close these issues.

1 participant